modules/graphics/src/test/java/test/javafx/scene/transform/ShearTest.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.transform;
  27 
  28 import static javafx.scene.transform.TransformTest.assertTx;
  29 import javafx.scene.shape.Rectangle;
  30 
  31 import org.junit.Test;
  32 import static org.junit.Assert.*;
  33 
  34 import com.sun.javafx.test.TransformHelper;
  35 import com.sun.javafx.geom.transform.Affine2D;


  36 
  37 public class ShearTest {
  38 
  39     @Test
  40     public void testShear() {
  41         final Shear t = new Shear(112, 114);
  42         final Rectangle rect = new Rectangle();
  43         rect.getTransforms().add(t);
  44         Affine2D expT = new Affine2D();
  45         expT.setToShear(112, 114);
  46         assertTx(rect, expT);
  47 
  48         final Shear trans = new Shear() {{
  49             setX(25);
  50             setY(52);
  51         }};
  52         final Rectangle n = new Rectangle();
  53         n.getTransforms().add(trans);
  54 
  55         TransformHelper.assertMatrix(trans,




   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.transform;
  27 
  28 import static test.javafx.scene.transform.TransformTest.assertTx;
  29 import javafx.scene.shape.Rectangle;
  30 
  31 import org.junit.Test;
  32 import static org.junit.Assert.*;
  33 
  34 import test.com.sun.javafx.test.TransformHelper;
  35 import com.sun.javafx.geom.transform.Affine2D;
  36 import javafx.scene.transform.Shear;
  37 import javafx.scene.transform.Transform;
  38 
  39 public class ShearTest {
  40 
  41     @Test
  42     public void testShear() {
  43         final Shear t = new Shear(112, 114);
  44         final Rectangle rect = new Rectangle();
  45         rect.getTransforms().add(t);
  46         Affine2D expT = new Affine2D();
  47         expT.setToShear(112, 114);
  48         assertTx(rect, expT);
  49 
  50         final Shear trans = new Shear() {{
  51             setX(25);
  52             setY(52);
  53         }};
  54         final Rectangle n = new Rectangle();
  55         n.getTransforms().add(trans);
  56 
  57         TransformHelper.assertMatrix(trans,