modules/graphics/src/test/java/test/javafx/scene/effect/EffectTest.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.assertFalse;
  30 import static org.junit.Assert.assertNull;
  31 import static org.junit.Assert.assertTrue;
  32 import static org.junit.Assert.fail;
  33 import javafx.beans.property.ObjectProperty;
  34 import javafx.beans.property.SimpleObjectProperty;
  35 import javafx.scene.Group;
  36 import javafx.scene.Scene;
  37 import javafx.scene.shape.Rectangle;
  38 import javafx.stage.Stage;
  39 
  40 import org.junit.Test;
  41 
  42 import com.sun.javafx.pgstub.StubToolkit;
  43 import com.sun.javafx.tk.Toolkit;














  44 
  45 public class EffectTest {
  46     
  47     @Test
  48     public void testAdding() {
  49         Bloom b = new Bloom();
  50         Group g = new Group();
  51         g.setEffect(b);
  52         assertEquals(b, g.getEffect());
  53     }
  54     
  55     @Test
  56     public void testRemoving() {
  57         Bloom b = new Bloom();
  58         Group g = new Group();
  59         g.setEffect(b);
  60         g.setEffect(null);
  61         assertNull(g.getEffect());
  62     }
  63 




   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.assertFalse;
  30 import static org.junit.Assert.assertNull;
  31 import static org.junit.Assert.assertTrue;
  32 import static org.junit.Assert.fail;
  33 import javafx.beans.property.ObjectProperty;
  34 import javafx.beans.property.SimpleObjectProperty;
  35 import javafx.scene.Group;
  36 import javafx.scene.Scene;
  37 import javafx.scene.shape.Rectangle;
  38 import javafx.stage.Stage;
  39 
  40 import org.junit.Test;
  41 
  42 import test.com.sun.javafx.pgstub.StubToolkit;
  43 import com.sun.javafx.tk.Toolkit;
  44 import javafx.scene.effect.Blend;
  45 import javafx.scene.effect.Bloom;
  46 import javafx.scene.effect.BoxBlur;
  47 import javafx.scene.effect.ColorAdjust;
  48 import javafx.scene.effect.DisplacementMap;
  49 import javafx.scene.effect.DropShadow;
  50 import javafx.scene.effect.GaussianBlur;
  51 import javafx.scene.effect.Glow;
  52 import javafx.scene.effect.InnerShadow;
  53 import javafx.scene.effect.MotionBlur;
  54 import javafx.scene.effect.PerspectiveTransform;
  55 import javafx.scene.effect.Reflection;
  56 import javafx.scene.effect.SepiaTone;
  57 import javafx.scene.effect.Shadow;
  58 
  59 public class EffectTest {
  60     
  61     @Test
  62     public void testAdding() {
  63         Bloom b = new Bloom();
  64         Group g = new Group();
  65         g.setEffect(b);
  66         assertEquals(b, g.getEffect());
  67     }
  68     
  69     @Test
  70     public void testRemoving() {
  71         Bloom b = new Bloom();
  72         Group g = new Group();
  73         g.setEffect(b);
  74         g.setEffect(null);
  75         assertNull(g.getEffect());
  76     }
  77