Bedingte Ausführung JUnit4

  • Beitrags-Autor:
  • Beitrags-Kategorie:Java
@Before
public void beforeTests() {
	String hostname = null;
	try {
		hostname = InetAddress.getLocalHost().getHostName();
	} catch (UnknownHostException e) {
		e.printStackTrace();
	}
	System.out.printf("[hostname] %s%n", hostname);
	org.junit.Assume.assumeTrue(
			"abc".equals(hostname) || "def".equals(hostname));
}