modules/graphics/src/test/java/test/com/sun/javafx/sg/prism/GridDirtyRegionTest.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 java.util.ArrayList;
  29 import java.util.List;
  30 import com.sun.javafx.geom.BaseBounds;
  31 import com.sun.javafx.geom.RectBounds;
  32 import com.sun.javafx.geom.transform.BaseTransform;

  33 import com.sun.scenario.effect.DropShadow;
  34 import org.junit.Before;
  35 import org.junit.Test;
  36 import org.junit.runner.RunWith;
  37 import org.junit.runners.Parameterized;
  38 import static org.junit.Assert.assertEquals;
  39 import static org.junit.Assert.assertFalse;
  40 
  41 /**
  42  * A series of tests where we are checking for the dirty region on a grid
  43  * of nodes. This is a parameterized test (based on its base class).
  44  * Each time the test is run, it will be given a way to create nodes,
  45  * and a way to make them dirty. Each test then only has to invoke the
  46  * creator to make nodes and the polluter to make them dirty, and then
  47  * check that the right methods were called and the right dirty regions
  48  * computed. There is some magic here -- every node created by the creator
  49  * must implement TestNGNode; the base class must set the "root" in the
  50  * parent class.
  51  */
  52 @RunWith(Parameterized.class)




   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 test.com.sun.javafx.sg.prism.TestGraphics;
  29 import java.util.ArrayList;
  30 import java.util.List;
  31 import com.sun.javafx.geom.BaseBounds;
  32 import com.sun.javafx.geom.RectBounds;
  33 import com.sun.javafx.geom.transform.BaseTransform;
  34 import com.sun.javafx.sg.prism.NGNode;
  35 import com.sun.scenario.effect.DropShadow;
  36 import org.junit.Before;
  37 import org.junit.Test;
  38 import org.junit.runner.RunWith;
  39 import org.junit.runners.Parameterized;
  40 import static org.junit.Assert.assertEquals;
  41 import static org.junit.Assert.assertFalse;
  42 
  43 /**
  44  * A series of tests where we are checking for the dirty region on a grid
  45  * of nodes. This is a parameterized test (based on its base class).
  46  * Each time the test is run, it will be given a way to create nodes,
  47  * and a way to make them dirty. Each test then only has to invoke the
  48  * creator to make nodes and the polluter to make them dirty, and then
  49  * check that the right methods were called and the right dirty regions
  50  * computed. There is some magic here -- every node created by the creator
  51  * must implement TestNGNode; the base class must set the "root" in the
  52  * parent class.
  53  */
  54 @RunWith(Parameterized.class)