modules/graphics/src/test/java/test/javafx/scene/shape/ShapeTest.java

Print this page
rev 9250 : 8134762: Refactor Javafx graphics module tests for clear separation of tests
Reviewed-by:


   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javafx.scene.shape;
  27 
  28 import com.sun.javafx.scene.DirtyBits;
  29 import com.sun.javafx.sg.prism.NGNode;
  30 import com.sun.javafx.sg.prism.NGShape;
  31 import javafx.beans.value.WritableValue;
  32 import javafx.collections.FXCollections;
  33 import javafx.collections.ListChangeListener;
  34 import javafx.collections.ObservableList;
  35 import javafx.css.CssMetaData;
  36 import javafx.css.Styleable;
  37 import javafx.css.StyleableProperty;
  38 import javafx.scene.Group;
  39 import javafx.scene.NodeTest;
  40 import javafx.scene.Scene;
  41 import javafx.scene.paint.Color;
  42 import org.junit.Assert;
  43 import org.junit.Test;
  44 
  45 import java.util.ArrayList;
  46 import java.util.Collections;
  47 import java.util.List;




  48 
  49 import static org.junit.Assert.*;
  50 
  51 public class ShapeTest {
  52 
  53     @Test public void testBoundPropertySync_StrokeType() throws Exception {
  54         NodeTest.assertObjectProperty_AsStringSynced(
  55                 new StubShape(),
  56                 "strokeType", "strokeType", StrokeType.CENTERED);
  57     }
  58 
  59     @Test public void testBoundPropertySync_StrokeLineCap() throws Exception {
  60         NodeTest.assertObjectProperty_AsStringSynced(
  61                 new StubShape(),
  62                 "strokeLineCap", "strokeLineCap", StrokeLineCap.SQUARE);
  63     }
  64 
  65     @Test public void testBoundPropertySync_StrokeLineJoin() throws Exception {
  66         NodeTest.assertObjectProperty_AsStringSynced(
  67                 new StubShape(),




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package test.javafx.scene.shape;
  27 
  28 import com.sun.javafx.scene.DirtyBits;
  29 import com.sun.javafx.sg.prism.NGNode;
  30 import com.sun.javafx.sg.prism.NGShape;
  31 import javafx.beans.value.WritableValue;
  32 import javafx.collections.FXCollections;
  33 import javafx.collections.ListChangeListener;
  34 import javafx.collections.ObservableList;
  35 import javafx.css.CssMetaData;
  36 import javafx.css.Styleable;
  37 import javafx.css.StyleableProperty;
  38 import javafx.scene.Group;
  39 import test.javafx.scene.NodeTest;
  40 import javafx.scene.Scene;
  41 import javafx.scene.paint.Color;
  42 import org.junit.Assert;
  43 import org.junit.Test;
  44 
  45 import java.util.ArrayList;
  46 import java.util.Collections;
  47 import java.util.List;
  48 import javafx.scene.shape.Shape;
  49 import javafx.scene.shape.StrokeLineCap;
  50 import javafx.scene.shape.StrokeLineJoin;
  51 import javafx.scene.shape.StrokeType;
  52 
  53 import static org.junit.Assert.*;
  54 
  55 public class ShapeTest {
  56 
  57     @Test public void testBoundPropertySync_StrokeType() throws Exception {
  58         NodeTest.assertObjectProperty_AsStringSynced(
  59                 new StubShape(),
  60                 "strokeType", "strokeType", StrokeType.CENTERED);
  61     }
  62 
  63     @Test public void testBoundPropertySync_StrokeLineCap() throws Exception {
  64         NodeTest.assertObjectProperty_AsStringSynced(
  65                 new StubShape(),
  66                 "strokeLineCap", "strokeLineCap", StrokeLineCap.SQUARE);
  67     }
  68 
  69     @Test public void testBoundPropertySync_StrokeLineJoin() throws Exception {
  70         NodeTest.assertObjectProperty_AsStringSynced(
  71                 new StubShape(),