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,32 ****
* 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;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
--- 21,36 ----
* 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 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,78 ****
/**
* Tests setting the value of style for a primary Stage
*/
@Test public void testStyleSetPrimary() {
Stage stage = new Stage();
! assertFalse(stage.isPrimary());
stage.impl_setPrimary(true);
! assertTrue(stage.isPrimary());
assertEquals(StageStyle.DECORATED, stage.getStyle());
stage.initStyle(StageStyle.UNDECORATED);
assertEquals(StageStyle.UNDECORATED, stage.getStyle());
stage.initStyle(StageStyle.DECORATED);
assertEquals(StageStyle.DECORATED, stage.getStyle());
--- 70,82 ----
/**
* Tests setting the value of style for a primary Stage
*/
@Test public void testStyleSetPrimary() {
Stage stage = new Stage();
! assertFalse(StageShim.isPrimary(stage));
stage.impl_setPrimary(true);
! 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,167 ****
/**
* Tests setting the value of modality for a primary Stage
*/
@Test public void testModalitySetPrimary() {
Stage stage = new Stage();
! assertFalse(stage.isPrimary());
stage.impl_setPrimary(true);
! assertTrue(stage.isPrimary());
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);
--- 159,171 ----
/**
* Tests setting the value of modality for a primary Stage
*/
@Test public void testModalitySetPrimary() {
Stage stage = new Stage();
! assertFalse(StageShim.isPrimary(stage));
stage.impl_setPrimary(true);
! 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);