<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>de.qsheltier</groupId>
+ <artifactId>msta-test</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.11.3</version>
<modules>
<module>server</module>
<module>client</module>
+ <module>test</module>
</modules>
</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>de.qsheltier</groupId>
+ <artifactId>msta</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>msta-test</artifactId>
+
+ <name>MSTA – Test</name>
+ <description>Manual Software Testing Avoidance – Testing Component</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>de.qsheltier</groupId>
+ <artifactId>msta-client</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+</project>
--- /dev/null
+package de.qsheltier.msta.test;
+
+import java.awt.GraphicsEnvironment;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.condition.DisabledIf;
+
+/**
+ * Annotation for a test that requires a GUI toolkit to be available.
+ * If no GUI toolkit is available (as per {@link IsHeadless#isHeadless()},
+ * tests annotated with this annotation are skipped.
+ */
+@Inherited
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@Tag("gui")
+@DisabledIf("de.qsheltier.msta.test.IsHeadless#isHeadless")
+public @interface GuiTest {
+}
+
+/**
+ * Helper for JUnit’s {@link DisabledIf}, to determine if {@link GuiTest}s
+ * should be run.
+ */
+@SuppressWarnings("unused")
+class IsHeadless {
+
+ /**
+ * Returns {@code true} if not GUI toolkit is available.
+ *
+ * @return {@code true} if no GUI toolkit is available,
+ * {@code false} otherwise
+ */
+ public static boolean isHeadless() {
+ return GraphicsEnvironment.isHeadless();
+ }
+
+}