Skip to content

Commit

Permalink
Issue #16: Disable UI tests during normal runs.
Browse files Browse the repository at this point in the history
* Normal runs exclude Junitcategory UITest.
* Profile uitest does not yet include them :-(
  • Loading branch information
ottlinger committed Feb 13, 2016
1 parent f55b806 commit 815a95e
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 16 deletions.
26 changes: 13 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,16 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<excludes>
<exclude>**/**UITest.java</exclude>
</excludes>
<excludedGroups>de.aikiit.spamprotector.UITest</excludedGroups>
<enableAssertions>true</enableAssertions>
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
<!--systemProperties>
<property>
<name>java.awt.headless</name>
<value>true</value>
</property>
</systemProperties-->
<property>
<name>java.awt.headless</name>
<value>true</value>
</property>
</systemProperties-->
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -591,11 +589,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<includes>
<include>
**/*UITest.java
</include>
</includes>
<groups>de.aikiit.spamprotector.UITest</groups>
<enableAssertions>true</enableAssertions>
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
Expand All @@ -609,6 +603,12 @@
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
</plugin>
</plugins>
</build>
</profile>
<!-- Run mvn clean install -Plive-demo for a live demo of this tool -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
package de.aikiit.spamprotector;

import org.junit.Test;
import org.junit.experimental.categories.Category;

import static org.junit.Assert.assertNotNull;

/**
* @author hirsch
* @version 2011-12-28, 13:20
*/
@org.junit.Ignore("Not working on Travis")
@Category(UITest.class)
public class AntiSpamAppletTest {
@Test
public final void instantiationDone() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@
package de.aikiit.spamprotector;

import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.experimental.categories.Category;

import static org.junit.Assert.assertNotNull;

/**
* @author hirsch
* @version 2011-12-28, 13:26
*/
public class AntiSpamApplicationUITest {
@Category(UITest.class)
public class AntiSpamApplicationTest {
@Test
public final void instantiationDone() {
AntiSpamApplication.main(null);
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/de/aikiit/spamprotector/GUITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
package de.aikiit.spamprotector;

import org.junit.Test;
import org.junit.experimental.categories.Category;

import static org.junit.Assert.assertNotNull;

/**
* @author hirsch
* @version 2011-12-28, 13:57
*/
@Category(UITest.class)
public class GUITest {
@Test
public final void startGuiNoApplet() {
Expand Down
27 changes: 27 additions & 0 deletions src/test/java/de/aikiit/spamprotector/UITest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
SpamSchutz - simple way to protect your mail adresses from naiive spammers
Copyright (C) 2011, Aiki IT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.aikiit.spamprotector;

/**
* Marker interface to be used with Junit categories to mark Tests that need a Graphical UI.
*
* @author hirsch
* @version 2016-02-13, 20:07
*/
public interface UITest {
}

0 comments on commit 815a95e

Please sign in to comment.