modules/graphics/src/test/java/test/javafx/stage/StageMutabilityTest.java
Print this page
rev 9250 : 8134762: Refactor Javafx graphics module tests for clear separation of tests
Reviewed-by:
@@ -21,12 +21,16 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-package javafx.stage;
+package test.javafx.stage;
+import javafx.stage.Modality;
+import javafx.stage.Stage;
+import javafx.stage.StageShim;
+import javafx.stage.StageStyle;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
@@ -66,13 +70,13 @@
/**
* Tests setting the value of style for a primary Stage
*/
@Test public void testStyleSetPrimary() {
Stage stage = new Stage();
- assertFalse(stage.isPrimary());
+ assertFalse(StageShim.isPrimary(stage));
stage.impl_setPrimary(true);
- assertTrue(stage.isPrimary());
+ assertTrue(StageShim.isPrimary(stage));
assertEquals(StageStyle.DECORATED, stage.getStyle());
stage.initStyle(StageStyle.UNDECORATED);
assertEquals(StageStyle.UNDECORATED, stage.getStyle());
stage.initStyle(StageStyle.DECORATED);
assertEquals(StageStyle.DECORATED, stage.getStyle());
@@ -155,13 +159,13 @@
/**
* Tests setting the value of modality for a primary Stage
*/
@Test public void testModalitySetPrimary() {
Stage stage = new Stage();
- assertFalse(stage.isPrimary());
+ assertFalse(StageShim.isPrimary(stage));
stage.impl_setPrimary(true);
- assertTrue(stage.isPrimary());
+ assertTrue(StageShim.isPrimary(stage));
assertEquals(Modality.NONE, stage.getModality());
try {
stage.initModality(Modality.WINDOW_MODAL);
// Error if we get here we didn't get the expected exception
assertTrue(false);