Example #1
0
 @org.junit.Test
 public void testExcludes() {
   assertSame(test, test.exclude(TEST_PATTERN_1, TEST_PATTERN_2));
   assertEquals(toLinkedSet(TEST_PATTERN_1, TEST_PATTERN_2), test.getExcludes());
   test.exclude(TEST_PATTERN_3);
   assertEquals(toLinkedSet(TEST_PATTERN_1, TEST_PATTERN_2, TEST_PATTERN_3), test.getExcludes());
 }
Example #2
0
  @org.junit.Test
  public void testScansForTestClassesInTheTestClassesDir() {
    configureTask();
    test.include("include");
    test.exclude("exclude");

    FileTree classFiles = test.getCandidateClassFiles();
    assertThat(classFiles, instanceOf(ConfigurableFileTree.class));
    ConfigurableFileTree files = (ConfigurableFileTree) classFiles;
    assertThat(files.getDir(), equalTo(classesDir));
    assertThat(files.getIncludes(), equalTo(toSet("include")));
    assertThat(files.getExcludes(), equalTo(toSet("exclude")));
  }