Skip to content

Commit 44219d6

Browse files
committed
Run tests maximized based on property, remove redundant test method argument.
1 parent f79b6b3 commit 44219d6

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/test/java/com/github/mfl28/boundingboxeditor/BoundingBoxEditorTestBase.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,7 @@ protected void onStart(Stage stage) {
190190
model = controller.getModel();
191191
// To make sure that the window is on top of all other windows at the start.
192192
stage.setAlwaysOnTop(true);
193-
194-
if(Boolean.getBoolean(FULL_SCREEN_TESTS_SYSTEM_PROPERTY_NAME)) {
195-
stage.setMaximized(true);
196-
}
193+
stage.setMaximized(Boolean.getBoolean(FULL_SCREEN_TESTS_SYSTEM_PROPERTY_NAME));
197194

198195
final Scene scene = createSceneFromParent(mainView);
199196
scene.getStylesheets().add(getClass().getResource(STYLESHEET_PATH).toExternalForm());
@@ -409,7 +406,7 @@ protected void timeOutAssertNoTopModelStage(FxRobot robot, TestInfo testinfo) {
409406
TIMEOUT_DURATION_IN_SEC + " sec."));
410407
}
411408

412-
protected void timeOutAssertThreadCount(FxRobot robot, String threadName, int count, TestInfo testinfo) {
409+
protected void timeOutAssertThreadCount(String threadName, int count, TestInfo testinfo) {
413410
Assertions.assertDoesNotThrow(() -> WaitForAsyncUtils.waitFor(TIMEOUT_DURATION_IN_SEC, TimeUnit.SECONDS,
414411
() -> threadCount(threadName) == count),
415412
() -> saveScreenshotAndReturnMessage(testinfo,

src/test/java/com/github/mfl28/boundingboxeditor/ui/ImageFolderOpenedBasicTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void onImageFolderOpened_WhenImageFileChanges_ShouldForceReloadFolder(FxRobot ro
8888
saveScreenshot(testinfo));
8989

9090
// Verify that exactly one Image file change watcher thread is running:
91-
timeOutAssertThreadCount(robot, "ImageFileChangeWatcher", 1, testinfo);
91+
timeOutAssertThreadCount("ImageFileChangeWatcher", 1, testinfo);
9292

9393
// Rename the loaded image file:
9494
Assertions.assertDoesNotThrow(() -> Files.move(tempDir.toPath().resolve("foo.jpg"),
@@ -105,7 +105,7 @@ void onImageFolderOpened_WhenImageFileChanges_ShouldForceReloadFolder(FxRobot ro
105105

106106
verifyThat(model.getCurrentImageFile(), Matchers.equalTo(tempDir.toPath().resolve("bar.jpg").toFile()),
107107
saveScreenshot(testinfo));
108-
timeOutAssertThreadCount(robot, "ImageFileChangeWatcher", 1, testinfo);
108+
timeOutAssertThreadCount("ImageFileChangeWatcher", 1, testinfo);
109109

110110
timeOutAssertNoTopModelStage(robot, testinfo);
111111

@@ -129,7 +129,7 @@ void onImageFolderOpened_WhenImageFileChanges_ShouldForceReloadFolder(FxRobot ro
129129

130130
WaitForAsyncUtils.waitForFxEvents();
131131

132-
timeOutAssertThreadCount(robot, "ImageFileChangeWatcher", 0, testinfo);
132+
timeOutAssertThreadCount("ImageFileChangeWatcher", 0, testinfo);
133133

134134
verifyThat(model.containsImageFiles(), Matchers.is(false), saveScreenshot(testinfo));
135135
verifyThat(mainView.isWorkspaceVisible(), Matchers.is(false), saveScreenshot(testinfo));
@@ -143,7 +143,7 @@ void onImageFolderOpened_WhenImageFileChanges_ShouldForceReloadFolder(FxRobot ro
143143

144144
WaitForAsyncUtils.waitForFxEvents();
145145

146-
timeOutAssertThreadCount(robot, "ImageFileChangeWatcher", 0, testinfo);
146+
timeOutAssertThreadCount("ImageFileChangeWatcher", 0, testinfo);
147147
}
148148

149149
private void verifyNodeVisibilities(TestInfo testinfo) {

0 commit comments

Comments
 (0)