Skip to content

Commit

Permalink
Disable UI tests in headless environments.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdferris-v2 committed Apr 7, 2023
1 parent a8952b6 commit 807d8a8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
import static com.google.common.truth.Truth8.assertThat;
import static org.mockito.Mockito.verify;

import java.awt.GraphicsEnvironment;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Path;
import javax.swing.JButton;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand All @@ -33,6 +35,10 @@ public class GtfsValidatorAppTest {

@Before
public void before() {
// This test uses Swing and AWT classes that will fail if we are in a headless environment,
// so we skip the test if that's the case.
Assume.assumeFalse(GraphicsEnvironment.isHeadless());

this.app = new GtfsValidatorApp(runner, display);
app.constructUI();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import static com.google.common.truth.Truth.assertThat;

import java.awt.GraphicsEnvironment;
import java.nio.file.Path;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -20,6 +23,13 @@ public class GtfsValidatorPreferencesTest {
@Mock private MonitoredValidationRunner runner;
@Mock private ValidationDisplay display;

@Before
public void before() {
// This test uses Swing and AWT classes that will fail if we are in a headless environment,
// so we skip the test if that's the case.
Assume.assumeFalse(GraphicsEnvironment.isHeadless());
}

@Test
public void testEndToEnd() {
{
Expand Down

0 comments on commit 807d8a8

Please sign in to comment.