Skip to content

Commit

Permalink
Tests: sprinkle some @TestFX annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
wirew0rm committed Aug 10, 2023
1 parent dad3ac9 commit af73ef2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import java.util.Collections;

import io.fair_acc.chartfx.ui.utils.TestFx;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
Expand Down Expand Up @@ -74,13 +75,20 @@ public void start(Stage stage) {
@EnumSource(LineStyle.class)
public void testRendererNominal(final LineStyle lineStyle) throws Exception {
for (ErrorStyle eStyle : ErrorStyle.values()) {
renderer.setErrorType(eStyle);
testRenderer(lineStyle);
FXUtils.runAndWait(() -> {
renderer.setErrorType(eStyle);
try {
testRenderer(lineStyle);
} catch (Exception e) {
throw new RuntimeException(e);
}
});
}
}

@Test
public void testRendererSepcialCases() throws Exception {
@TestFx
public void testRendererSpecialCases() throws Exception {
final LineStyle lineStyle = LineStyle.NORMAL;

renderer.setPointReduction(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ public void testSetterGetter() {
localRenderer.enableHorizontalMarker(true);
assertTrue(localRenderer.isHorizontalMarker());

assertNull(localRenderer.getStyle());
assertEquals("", localRenderer.getStyle());
localRenderer.setStyle("arbitrary");
assertEquals("arbitrary", localRenderer.getStyle());
localRenderer.setStyle(null);
assertNull(localRenderer.getStyle());
assertEquals("", localRenderer.getStyle());
}

@Test
Expand Down

0 comments on commit af73ef2

Please sign in to comment.