Skip to content
Permalink
Browse files
8239822: Intermittent unit test failures in RegionCSSTest
Reviewed-by: aghaisas
  • Loading branch information
kevinrushforth committed Feb 25, 2020
1 parent 3150562 commit c3ee1a30caec3eb06fcca9a8bb9879a5d2184c1d
@@ -41,6 +41,7 @@
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.scene.shape.Rectangle;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;

@@ -62,8 +63,7 @@
public StyleManagerTest() {
}

@Before
public void setUp() {
private static void resetStyleManager() {
StyleManagerShim sm = StyleManagerShim.getInstance();
sm.userAgentStylesheetContainers_clear();
sm.platformUserAgentStylesheetContainers_clear();
@@ -72,6 +72,16 @@ public void setUp() {
sm.set_hasDefaultUserAgentStylesheet(false);
}

@Before
public void setUp() {
resetStyleManager();
}

@AfterClass
public static void cleanupOnce() {
resetStyleManager();
}

@Test
public void testMethod_getInstance() {
Scene scene = new Scene(new Group());
@@ -41,6 +41,7 @@
import javafx.scene.shape.Rectangle;
import static org.junit.Assert.*;

import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;

@@ -49,8 +50,7 @@
public Node_cssStateTransition_Test() {
}

@Before
public void setUp() {
private static void resetStyleManager() {
StyleManager sm = StyleManager.getInstance();
sm.userAgentStylesheetContainers.clear();
sm.platformUserAgentStylesheetContainers.clear();
@@ -59,6 +59,16 @@ public void setUp() {
sm.hasDefaultUserAgentStylesheet = false;
}

@Before
public void setUp() {
resetStyleManager();
}

@AfterClass
public static void cleanupOnce() {
resetStyleManager();
}

@Test
public void testPropertiesResetOnStyleclassChange() {

@@ -40,6 +40,7 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;

@@ -49,19 +50,27 @@
private Stage stage;
private StackPane root;

private static void resetStyleManager() {
StyleManager sm = StyleManager.getInstance();
sm.userAgentStylesheetContainers.clear();
sm.platformUserAgentStylesheetContainers.clear();
sm.stylesheetContainerMap.clear();
sm.cacheContainerMap.clear();
sm.hasDefaultUserAgentStylesheet = false;
}

@Before
public void setup() {
root = new StackPane();
scene = new Scene(root);
stage = new Stage();
stage.setScene(scene);
resetStyleManager();
}

StyleManager sm = StyleManager.getInstance();
sm.userAgentStylesheetContainers.clear();
sm.platformUserAgentStylesheetContainers.clear();
sm.stylesheetContainerMap.clear();
sm.cacheContainerMap.clear();
sm.hasDefaultUserAgentStylesheet = false;
@AfterClass
public static void cleanupOnce() {
resetStyleManager();
}

@Test

0 comments on commit c3ee1a3

Please sign in to comment.