modules/graphics/src/test/java/test/javafx/scene/shape/RectangleTest.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.geom.transform.BaseTransform;
  29 import com.sun.javafx.sg.prism.NGNode;
  30 import com.sun.javafx.sg.prism.NGRectangle;
  31 import com.sun.javafx.test.TestHelper;
  32 import javafx.geometry.Bounds;
  33 import javafx.scene.NodeTest;
  34 import javafx.scene.paint.Paint;

  35 import org.junit.Test;
  36 
  37 import static com.sun.javafx.test.TestHelper.assertSimilar;
  38 import static org.junit.Assert.*;
  39 
  40 public class RectangleTest {
  41 
  42     @Test public void testPropertyPropagation_visible() throws Exception {
  43         final Rectangle node = new StubRectangle();
  44         NodeTest.testBooleanPropertyPropagation(node, "visible", false, true);
  45     }
  46 
  47     @Test public void testPropertyPropagation_x() throws Exception {
  48         final Rectangle node = new StubRectangle();
  49         NodeTest.testDoublePropertyPropagation(node, "x", 100, 200);
  50     }
  51 
  52     @Test public void testPropertyPropagation_y() throws Exception {
  53         final Rectangle node = new StubRectangle();
  54         NodeTest.testDoublePropertyPropagation(node, "y", 100, 200);
  55     }
  56 
  57     @Test public void testPropertyPropagation_width() throws Exception {




   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.geom.transform.BaseTransform;
  29 import com.sun.javafx.sg.prism.NGNode;
  30 import com.sun.javafx.sg.prism.NGRectangle;
  31 import test.com.sun.javafx.test.TestHelper;
  32 import javafx.geometry.Bounds;
  33 import test.javafx.scene.NodeTest;
  34 import javafx.scene.paint.Paint;
  35 import javafx.scene.shape.Rectangle;
  36 import org.junit.Test;
  37 
  38 import static test.com.sun.javafx.test.TestHelper.assertSimilar;
  39 import static org.junit.Assert.*;
  40 
  41 public class RectangleTest {
  42 
  43     @Test public void testPropertyPropagation_visible() throws Exception {
  44         final Rectangle node = new StubRectangle();
  45         NodeTest.testBooleanPropertyPropagation(node, "visible", false, true);
  46     }
  47 
  48     @Test public void testPropertyPropagation_x() throws Exception {
  49         final Rectangle node = new StubRectangle();
  50         NodeTest.testDoublePropertyPropagation(node, "x", 100, 200);
  51     }
  52 
  53     @Test public void testPropertyPropagation_y() throws Exception {
  54         final Rectangle node = new StubRectangle();
  55         NodeTest.testDoublePropertyPropagation(node, "y", 100, 200);
  56     }
  57 
  58     @Test public void testPropertyPropagation_width() throws Exception {