modules/graphics/src/test/java/test/com/sun/javafx/sg/prism/DirtyRegionTestBase.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 com.sun.javafx.sg.prism;
  27 
  28 import javafx.geometry.Insets;
  29 import javafx.scene.layout.Background;
  30 import javafx.scene.layout.BackgroundFill;
  31 import javafx.scene.layout.CornerRadii;
  32 import java.lang.reflect.Field;
  33 import java.util.ArrayList;
  34 import java.util.Arrays;
  35 import java.util.Collection;
  36 import java.util.HashSet;
  37 import java.util.List;
  38 import java.util.Set;
  39 import com.sun.javafx.geom.BaseBounds;
  40 import com.sun.javafx.geom.DirtyRegionContainer;
  41 import com.sun.javafx.geom.DirtyRegionPool;
  42 import com.sun.javafx.geom.RectBounds;
  43 import com.sun.javafx.geom.transform.BaseTransform;
  44 import com.sun.javafx.geom.transform.GeneralTransform3D;






  45 import com.sun.prism.paint.Color;
  46 import org.junit.runners.Parameterized;
  47 import static org.junit.Assert.assertEquals;
  48 
  49 /**
  50  * A base class for all testing of the dirty regions. This class contains
  51  * some useful infrastructure for testing dirty regions, such as the ability
  52  * to assert that a dirty region matches the expected region; the ability to
  53  * manage the state on an NG node appropriately (ensuring that the transform,
  54  * transformed bounds, effect, etc are all managed correctly); and ensuring
  55  * that all test are run over a set of common parameters, such as when a
  56  * Node becomes dirty due to opacity changing, visibility changing, geometry
  57  * changing, and so forth.
  58  * <p>
  59  * The DirtyRegionTestBase is parametrized, using different node types
  60  * (rectangle, ellipse, group) and different methods for becoming dirty
  61  * (visibility change, geometry change, etc). The cross product of these
  62  * forms the parameters for the test. Each test method is called using the
  63  * combination of a node type & dirty method.
  64  */




   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.com.sun.javafx.sg.prism;
  27 
  28 import javafx.geometry.Insets;
  29 import javafx.scene.layout.Background;
  30 import javafx.scene.layout.BackgroundFill;
  31 import javafx.scene.layout.CornerRadii;
  32 import java.lang.reflect.Field;
  33 import java.util.ArrayList;
  34 import java.util.Arrays;
  35 import java.util.Collection;
  36 import java.util.HashSet;
  37 import java.util.List;
  38 import java.util.Set;
  39 import com.sun.javafx.geom.BaseBounds;
  40 import com.sun.javafx.geom.DirtyRegionContainer;
  41 import com.sun.javafx.geom.DirtyRegionPool;
  42 import com.sun.javafx.geom.RectBounds;
  43 import com.sun.javafx.geom.transform.BaseTransform;
  44 import com.sun.javafx.geom.transform.GeneralTransform3D;
  45 import com.sun.javafx.sg.prism.NGCircle;
  46 import com.sun.javafx.sg.prism.NGGroup;
  47 import com.sun.javafx.sg.prism.NGNode;
  48 import com.sun.javafx.sg.prism.NGRectangle;
  49 import com.sun.javafx.sg.prism.NGRegion;
  50 import com.sun.javafx.sg.prism.NGShape;
  51 import com.sun.prism.paint.Color;
  52 import org.junit.runners.Parameterized;
  53 import static org.junit.Assert.assertEquals;
  54 
  55 /**
  56  * A base class for all testing of the dirty regions. This class contains
  57  * some useful infrastructure for testing dirty regions, such as the ability
  58  * to assert that a dirty region matches the expected region; the ability to
  59  * manage the state on an NG node appropriately (ensuring that the transform,
  60  * transformed bounds, effect, etc are all managed correctly); and ensuring
  61  * that all test are run over a set of common parameters, such as when a
  62  * Node becomes dirty due to opacity changing, visibility changing, geometry
  63  * changing, and so forth.
  64  * <p>
  65  * The DirtyRegionTestBase is parametrized, using different node types
  66  * (rectangle, ellipse, group) and different methods for becoming dirty
  67  * (visibility change, geometry change, etc). The cross product of these
  68  * forms the parameters for the test. Each test method is called using the
  69  * combination of a node type & dirty method.
  70  */