modules/graphics/src/test/java/test/javafx/scene/effect/DropShadowTest.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.effect;
  27 
  28 import static org.junit.Assert.assertEquals;
  29 import static org.junit.Assert.assertNull;
  30 import javafx.beans.property.DoubleProperty;
  31 import javafx.beans.property.SimpleDoubleProperty;
  32 import javafx.scene.paint.Color;
  33 
  34 import org.junit.Before;
  35 import org.junit.Test;
  36 
  37 import com.sun.scenario.effect.AbstractShadow.ShadowMode;
  38 import com.sun.scenario.effect.Color4f;



  39 
  40 public class DropShadowTest extends EffectsTestBase {
  41     private DropShadow effect;
  42 
  43     @Before
  44     public void setUp() {
  45         effect = new DropShadow();
  46         setupTest(effect);
  47     }
  48 
  49     @Test
  50     public void testSetBlurType() {
  51         // try setting correct value
  52         effect.setBlurType(BlurType.ONE_PASS_BOX);
  53         assertEquals(BlurType.ONE_PASS_BOX, effect.getBlurType());
  54         pulse();
  55         assertEquals(ShadowMode.ONE_PASS_BOX, ((com.sun.scenario.effect.DropShadow) effect.impl_getImpl()).getShadowMode());
  56 
  57         effect.setBlurType(BlurType.TWO_PASS_BOX);
  58         assertEquals(BlurType.TWO_PASS_BOX, effect.getBlurType());




   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.effect;
  27 
  28 import static org.junit.Assert.assertEquals;
  29 import static org.junit.Assert.assertNull;
  30 import javafx.beans.property.DoubleProperty;
  31 import javafx.beans.property.SimpleDoubleProperty;
  32 import javafx.scene.paint.Color;
  33 
  34 import org.junit.Before;
  35 import org.junit.Test;
  36 
  37 import com.sun.scenario.effect.AbstractShadow.ShadowMode;
  38 import com.sun.scenario.effect.Color4f;
  39 import javafx.scene.effect.BlurType;
  40 import javafx.scene.effect.BoxBlur;
  41 import javafx.scene.effect.DropShadow;
  42 
  43 public class DropShadowTest extends EffectsTestBase {
  44     private DropShadow effect;
  45 
  46     @Before
  47     public void setUp() {
  48         effect = new DropShadow();
  49         setupTest(effect);
  50     }
  51 
  52     @Test
  53     public void testSetBlurType() {
  54         // try setting correct value
  55         effect.setBlurType(BlurType.ONE_PASS_BOX);
  56         assertEquals(BlurType.ONE_PASS_BOX, effect.getBlurType());
  57         pulse();
  58         assertEquals(ShadowMode.ONE_PASS_BOX, ((com.sun.scenario.effect.DropShadow) effect.impl_getImpl()).getShadowMode());
  59 
  60         effect.setBlurType(BlurType.TWO_PASS_BOX);
  61         assertEquals(BlurType.TWO_PASS_BOX, effect.getBlurType());