modules/graphics/src/test/java/javafx/scene/SceneTest.java

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


   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;
  27 

  28 import javafx.beans.value.ChangeListener;
  29 import javafx.beans.value.ObservableValue;
  30 import javafx.scene.layout.StackPane;
  31 import javafx.scene.layout.TilePane;
  32 import javafx.scene.layout.VBox;
  33 import javafx.scene.shape.Rectangle;
  34 import javafx.scene.transform.Scale;
  35 import javafx.stage.Stage;
  36 import com.sun.javafx.pgstub.StubScene;
  37 import com.sun.javafx.pgstub.StubToolkit;
  38 import com.sun.javafx.sg.prism.NGCamera;
  39 import com.sun.javafx.test.MouseEventGenerator;
  40 import com.sun.javafx.tk.Toolkit;
  41 import javafx.application.Platform;
  42 import javafx.beans.InvalidationListener;
  43 import javafx.beans.Observable;
  44 import javafx.scene.input.MouseEvent;
  45 import org.junit.After;
  46 import org.junit.Before;

  47 import org.junit.Test;
  48 import static org.junit.Assert.assertEquals;
  49 import static org.junit.Assert.assertFalse;
  50 import static org.junit.Assert.assertNull;
  51 import static org.junit.Assert.assertSame;
  52 import static org.junit.Assert.assertTrue;
  53 import static org.junit.Assert.fail;
  54 
  55 /**
  56  * Tests various aspects of Scene.
  57  *
  58  */
  59 public class SceneTest {
  60 



  61     private Stage stage;
  62     private boolean handler1Called = false;
  63     private boolean handler2Called = false;
  64 
  65 
  66     @Before
  67     public void setUp() {
  68         stage = new Stage();
  69         stage.show();
  70         stage.requestFocus();
  71     }
  72 
  73     @After
  74     public void tearDown() {
  75         stage.hide();
  76     }
  77 
  78     /***************************************************************************
  79      *                                                                         *
  80      *                           Lookup related tests                          *




   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;
  27 
  28 import com.sun.javafx.FXUnit;
  29 import javafx.beans.value.ChangeListener;
  30 import javafx.beans.value.ObservableValue;
  31 import javafx.scene.layout.StackPane;
  32 import javafx.scene.layout.TilePane;
  33 import javafx.scene.layout.VBox;
  34 import javafx.scene.shape.Rectangle;
  35 import javafx.scene.transform.Scale;
  36 import javafx.stage.Stage;
  37 import com.sun.javafx.pgstub.StubScene;
  38 import com.sun.javafx.pgstub.StubToolkit;
  39 import com.sun.javafx.sg.prism.NGCamera;
  40 import com.sun.javafx.test.MouseEventGenerator;
  41 import com.sun.javafx.tk.Toolkit;
  42 import javafx.application.Platform;
  43 import javafx.beans.InvalidationListener;
  44 import javafx.beans.Observable;
  45 import javafx.scene.input.MouseEvent;
  46 import org.junit.After;
  47 import org.junit.Before;
  48 import org.junit.Rule;
  49 import org.junit.Test;
  50 import static org.junit.Assert.assertEquals;
  51 import static org.junit.Assert.assertFalse;
  52 import static org.junit.Assert.assertNull;
  53 import static org.junit.Assert.assertSame;
  54 import static org.junit.Assert.assertTrue;
  55 import static org.junit.Assert.fail;
  56 
  57 /**
  58  * Tests various aspects of Scene.
  59  *
  60  */
  61 public class SceneTest {
  62 
  63     @Rule
  64     public FXUnit fx = new FXUnit();
  65 
  66     private Stage stage;
  67     private boolean handler1Called = false;
  68     private boolean handler2Called = false;
  69 
  70 
  71     @Before
  72     public void setUp() {
  73         stage = new Stage();
  74         stage.show();
  75         stage.requestFocus();
  76     }
  77 
  78     @After
  79     public void tearDown() {
  80         stage.hide();
  81     }
  82 
  83     /***************************************************************************
  84      *                                                                         *
  85      *                           Lookup related tests                          *