@@ -0,0 +1,2932 @@
+package com.github.ferstl.junit.testgroups;%0A%0Aimport org.junit.After;%0Aimport org.junit.ClassRule;%0Aimport org.junit.Test;%0Aimport org.junit.runner.JUnitCore;%0Aimport org.junit.runner.Result;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0A/**%0A * A bunch of tests that use %7B@link JUnitCore#runClasses(Class...)%7D.%0A */%0Apublic class IntegrationTest %7B%0A%0A  private static final String USER_DEFINED_KEY = %22myKey%22;%0A  private static final String USER_DEFINED_GROUP = %22myGroup%22;%0A%0A  @After%0A  public void after() %7B%0A    System.clearProperty(TestGroup.DEFAULT_KEY);%0A    System.clearProperty(USER_DEFINED_KEY);%0A  %7D%0A%0A  @Test%0A  public void userDefinedGroupDisabled() %7B%0A    Result result = JUnitCore.runClasses(UserDefinedGroup.class);%0A    assertEquals(1, result.getIgnoreCount());%0A    assertEquals(0, result.getFailureCount());%0A  %7D%0A%0A  @Test%0A  public void userDefinedGroupEnabled() %7B%0A    System.setProperty(TestGroup.DEFAULT_KEY, USER_DEFINED_GROUP);%0A%0A    Result result = JUnitCore.runClasses(UserDefinedGroup.class);%0A    assertEquals(0, result.getIgnoreCount());%0A    assertEquals(2, result.getFailureCount());%0A  %7D%0A%0A  @Test%0A  public void testGroupInheritenceDisabled() %7B%0A    Result result = JUnitCore.runClasses(SubClass.class);%0A    assertEquals(1, result.getIgnoreCount());%0A    assertEquals(0, result.getFailureCount());%0A  %7D%0A%0A  @Test%0A  public void testGroupInheritenceEnabled() %7B%0A    System.setProperty(TestGroup.DEFAULT_KEY, USER_DEFINED_GROUP);%0A%0A    Result result = JUnitCore.runClasses(SubClass.class);%0A    assertEquals(0, result.getIgnoreCount());%0A    assertEquals(1, result.getFailureCount());%0A  %7D%0A%0A  @Test%0A  public void userDefinedKeyDisabled() %7B%0A    Result result = JUnitCore.runClasses(UserDefinedKey.class);%0A    assertEquals(0, result.getFailureCount());%0A    assertEquals(1, result.getIgnoreCount());%0A  %7D%0A%0A  @TestGroup(USER_DEFINED_GROUP)%0A  public static class UserDefinedGroup %7B%0A    @ClassRule%0A    public static TestGroupRule rule = new TestGroupRule();%0A%0A    @Test%0A    public void test() %7B%0A      throw new IllegalStateException(%22boom%22);%0A    %7D%0A%0A    @Test%0A    public void test2() %7B%0A      throw new IllegalStateException(%22boom%22);%0A    %7D%0A%0A  %7D%0A%0A%0A  /**%0A   * Abstract class defining a test group and the %7B@link TestGroupRule%7D.%0A   */%0A  @TestGroup(USER_DEFINED_GROUP)%0A  public static abstract class BaseClass %7B%0A    @ClassRule%0A    public static TestGroupRule rule = new TestGroupRule();%0A  %7D%0A%0A  /**%0A   * Subclass of %7B@link BaseClass%7D containing the actual tests.%0A   */%0A  public static class SubClass extends BaseClass %7B%0A%0A    @Test%0A    public void test() %7B%0A      throw new IllegalStateException(%22boom%22);%0A    %7D%0A  %7D%0A%0A  /**%0A   * This test class' test group has a user-defined key.%0A   */%0A  @TestGroup(key = USER_DEFINED_KEY, value = USER_DEFINED_GROUP)%0A  public static class UserDefinedKey %7B%0A    @ClassRule%0A    public static TestGroupRule rule = new TestGroupRule();%0A%0A    @Test%0A    public void test() %7B%0A      throw new IllegalStateException(%22boom%22);%0A    %7D%0A  %7D%0A%7D%0A

Add some "integration tests"