modules/graphics/src/test/java/javafx/scene/effect/EffectTest.java

Print this page
rev 6167 : RT-35330 [Monocle] Remove StubToolkit and replace it with headless glass implementation


  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 
  64     /*
  65      * Test for testing value propagation in complicated effect hierarchy
  66      */




  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 
  34 import com.sun.javafx.FXUnit;
  35 import javafx.beans.property.ObjectProperty;
  36 import javafx.beans.property.SimpleObjectProperty;
  37 import javafx.scene.Group;
  38 import javafx.scene.Scene;
  39 import javafx.scene.shape.Rectangle;
  40 import javafx.stage.Stage;
  41 
  42 import org.junit.Rule;
  43 import org.junit.Test;
  44 
  45 import com.sun.javafx.pgstub.StubToolkit;
  46 import com.sun.javafx.tk.Toolkit;
  47 
  48 public class EffectTest {
  49 
  50     @Rule
  51     public FXUnit fx = new FXUnit();
  52     
  53     @Test
  54     public void testAdding() {
  55         Bloom b = new Bloom();
  56         Group g = new Group();
  57         g.setEffect(b);
  58         assertEquals(b, g.getEffect());
  59     }
  60     
  61     @Test
  62     public void testRemoving() {
  63         Bloom b = new Bloom();
  64         Group g = new Group();
  65         g.setEffect(b);
  66         g.setEffect(null);
  67         assertNull(g.getEffect());
  68     }
  69 
  70     /*
  71      * Test for testing value propagation in complicated effect hierarchy
  72      */