NX01: Set all unit tests to headless and disable 2 offenders
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 1m33s

This commit is contained in:
Willem Cazander 2026-01-29 19:04:04 +01:00
parent ce544764a4
commit 67dd3e4628
4 changed files with 19 additions and 1 deletions

View file

@ -14,4 +14,4 @@ jobs:
- name: Check out - name: Check out
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Run asserts - name: Run asserts
run: mvn clean test -Djava.awt.headless=true run: mvn clean test

View file

@ -33,6 +33,7 @@ import java.io.OutputStream;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.x4o.xml.X4ODriver; import org.x4o.xml.X4ODriver;
import org.x4o.xml.test.TestDriver; import org.x4o.xml.test.TestDriver;
@ -74,6 +75,7 @@ public class X4OWriterTest {
} }
@Test @Test
@Disabled("Caused by: java.awt.HeadlessException")
public void testWriterSwiXmlOutput() throws Exception { public void testWriterSwiXmlOutput() throws Exception {
Accelerator3 ac3 = new Accelerator3(false); Accelerator3 ac3 = new Accelerator3(false);
SwingEngine engine = new SwingEngine(ac3); SwingEngine engine = new SwingEngine(ac3);

View file

@ -29,6 +29,7 @@ import javax.swing.JMenu;
import javax.swing.JMenuItem; import javax.swing.JMenuItem;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.x4o.xml.io.X4OReader; import org.x4o.xml.io.X4OReader;
@ -41,6 +42,7 @@ import org.x4o.xml.io.X4OReader;
public class Accelerator3Test { public class Accelerator3Test {
@Test @Test
@Disabled("Caused by: java.awt.HeadlessException")
public void testSwingMenuAbout() throws Exception { public void testSwingMenuAbout() throws Exception {
Accelerator3 ac3 = new Accelerator3(false); Accelerator3 ac3 = new Accelerator3(false);
SwingEngine engine = new SwingEngine(ac3); SwingEngine engine = new SwingEngine(ac3);

14
pom.xml
View file

@ -527,6 +527,11 @@
<artifactId>maven-gpg-plugin</artifactId> <artifactId>maven-gpg-plugin</artifactId>
<version>3.2.4</version> <version>3.2.4</version>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.4</version>
</plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId> <artifactId>build-helper-maven-plugin</artifactId>
@ -535,6 +540,15 @@
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<java.awt.headless>true</java.awt.headless>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
<profiles> <profiles>