示例#1
0
文件: TestTest.java 项目: peas/gradle
  @org.junit.Test
  public void testAddsDefaultIncludeAndExcludePatternsWhenTestScanningIsOff() {
    configureTask();
    test.setScanForTestClasses(false);

    ConfigurableFileTree files = (ConfigurableFileTree) test.getCandidateClassFiles();
    assertThat(files.getDir(), equalTo(classesDir));
    assertThat(files.getIncludes(), equalTo(toSet("**/*Tests.class", "**/*Test.class")));
    assertThat(files.getExcludes(), equalTo(toSet("**/Abstract*.class")));
  }
示例#2
0
文件: TestTest.java 项目: peas/gradle
  @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")));
  }