modules/graphics/src/test/java/test/javafx/scene/shape/Shape_cssMethods_Test.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 java.util.Arrays;
  29 import java.util.Collection;
  30 
  31 import javafx.scene.paint.Color;




  32 
  33 import org.junit.runner.RunWith;
  34 import org.junit.runners.Parameterized;
  35 import org.junit.runners.Parameterized.Parameters;
  36 
  37 import com.sun.javafx.test.CssMethodsTestBase;
  38 
  39 @RunWith(Parameterized.class)
  40 public class Shape_cssMethods_Test extends CssMethodsTestBase {
  41     private static final Rectangle TEST_SHAPE = new Rectangle(100, 100);
  42 
  43     @Parameters
  44     public static Collection data() {
  45         return Arrays.asList(new Object[] {
  46             config(TEST_SHAPE, "fill", null, "-fx-fill", Color.RED),
  47             config(TEST_SHAPE, "fill", null, "-fx-fill", null),
  48             config(TEST_SHAPE, "smooth", false, "-fx-smooth", true),
  49             config(TEST_SHAPE, "stroke", null, "-fx-stroke", Color.BLUE),
  50             config(TEST_SHAPE, "strokeDashOffset", 0.0,
  51                    "-fx-stroke-dash-offset", 2.0),
  52             config(TEST_SHAPE, "strokeLineCap", StrokeLineCap.SQUARE,
  53                    "-fx-stroke-line-cap", StrokeLineCap.ROUND),
  54             config(TEST_SHAPE, "strokeLineJoin", StrokeLineJoin.BEVEL,
  55                    "-fx-stroke-line-join", StrokeLineJoin.MITER),
  56             config(TEST_SHAPE, "strokeType", StrokeType.CENTERED,
  57                    "-fx-stroke-type", StrokeType.INSIDE),




   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 java.util.Arrays;
  29 import java.util.Collection;
  30 
  31 import javafx.scene.paint.Color;
  32 import javafx.scene.shape.Rectangle;
  33 import javafx.scene.shape.StrokeLineCap;
  34 import javafx.scene.shape.StrokeLineJoin;
  35 import javafx.scene.shape.StrokeType;
  36 
  37 import org.junit.runner.RunWith;
  38 import org.junit.runners.Parameterized;
  39 import org.junit.runners.Parameterized.Parameters;
  40 
  41 import test.com.sun.javafx.test.CssMethodsTestBase;
  42 
  43 @RunWith(Parameterized.class)
  44 public class Shape_cssMethods_Test extends CssMethodsTestBase {
  45     private static final Rectangle TEST_SHAPE = new Rectangle(100, 100);
  46 
  47     @Parameters
  48     public static Collection data() {
  49         return Arrays.asList(new Object[] {
  50             config(TEST_SHAPE, "fill", null, "-fx-fill", Color.RED),
  51             config(TEST_SHAPE, "fill", null, "-fx-fill", null),
  52             config(TEST_SHAPE, "smooth", false, "-fx-smooth", true),
  53             config(TEST_SHAPE, "stroke", null, "-fx-stroke", Color.BLUE),
  54             config(TEST_SHAPE, "strokeDashOffset", 0.0,
  55                    "-fx-stroke-dash-offset", 2.0),
  56             config(TEST_SHAPE, "strokeLineCap", StrokeLineCap.SQUARE,
  57                    "-fx-stroke-line-cap", StrokeLineCap.ROUND),
  58             config(TEST_SHAPE, "strokeLineJoin", StrokeLineJoin.BEVEL,
  59                    "-fx-stroke-line-join", StrokeLineJoin.MITER),
  60             config(TEST_SHAPE, "strokeType", StrokeType.CENTERED,
  61                    "-fx-stroke-type", StrokeType.INSIDE),