Skip to content

Commit 4802879

Browse files
committed
Fixed unit test issues
1 parent 91c799c commit 4802879

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

CodenameOne/src/com/codename1/ui/Container.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,12 @@ public Container(Layout layout, String uiid) {
152152
setFocusable(false);
153153
}
154154

155-
static void blockOverdraw() {
156-
blockOverdraw = true;
155+
static void setBlockOverdraw(boolean b) {
156+
blockOverdraw = b;
157+
}
158+
159+
static boolean isBlockOverdraw() {
160+
return blockOverdraw;
157161
}
158162

159163
/**

CodenameOne/src/com/codename1/ui/Display.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3516,7 +3516,7 @@ public void setProperty(String key, String value) {
35163516
return;
35173517
}
35183518
if ("blockOverdraw".equals(key)) {
3519-
Container.blockOverdraw();
3519+
Container.setBlockOverdraw(true);
35203520
return;
35213521
}
35223522
if ("blockCopyPaste".equals(key)) {

maven/core-unittests/src/test/java/com/codename1/ui/DisplayTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public void run() {
3333

3434
@AfterEach
3535
void resetStatics() {
36-
Container.blockOverdraw = false;
37-
Component.revalidateOnStyleChange = true;
36+
Container.setBlockOverdraw(false);
37+
Component.setRevalidateOnStyleChange(true);
3838
}
3939

4040
@Test
@@ -62,16 +62,16 @@ void testSetPropertyHandlesSpecialKeys() {
6262
assertEquals("launch", display.getProperty("AppArg", ""));
6363

6464
display.setProperty("blockOverdraw", "ignored");
65-
assertTrue(Container.blockOverdraw);
65+
assertTrue(Container.isBlockOverdraw());
6666

6767
display.setProperty("blockCopyPaste", "true");
6868
assertTrue(implementation.isBlockCopyAndPaste());
6969

7070
display.setProperty("Component.revalidateOnStyleChange", "false");
71-
assertFalse(Component.revalidateOnStyleChange);
71+
assertFalse(Component.isRevalidateOnStyleChange());
7272

7373
display.setProperty("Component.revalidateOnStyleChange", "TRUE");
74-
assertTrue(Component.revalidateOnStyleChange);
74+
assertTrue(Component.isRevalidateOnStyleChange());
7575
}
7676

7777
@Test

0 commit comments

Comments
 (0)