コード例 #1
0
 /** Example of hidden files/directories : .DSStore, .svn, .git */
 @Test
 public void hiddenFilesAreIgnored() {
   if (!SystemUtils.IS_OS_WINDOWS) {
     // hidden files/directories can not be stored in svn windows
     // On Mac/Linux it's easy, just prefix the filename by '.'
     project =
         MavenTestUtils.loadProjectFromPom(
             DefaultProjectFileSystemTest.class, "hidden-files/pom.xml");
     ProjectFileSystem fs = newDefaultProjectFileSystem(project);
     List<File> files = fs.getSourceFiles();
     assertThat(files.size(), is(1));
     assertThat(files.get(0).getName(), is("foo.sql"));
   }
 }
コード例 #2
0
  @Test
  public void languageWithNoSpecificFileSuffixes() {
    class NoSuffixLanguage implements Language {
      public String getKey() {
        return "no-suffix";
      }

      public String getName() {
        return "no-suffix";
      }

      public String[] getFileSuffixes() {
        return new String[0];
      }
    }

    project =
        MavenTestUtils.loadProjectFromPom(
            DefaultProjectFileSystemTest.class, "sample-with-different-suffixes/pom.xml");
    ProjectFileSystem fs = newDefaultProjectFileSystem(project);
    List<File> files = fs.getSourceFiles(new NoSuffixLanguage());
    assertThat(files.size(), is(2));
  }