jdk/test/java/lang/module/ModuleFinderTest.java
changeset 44545 83b611b88ac8
parent 44359 c6761862ca0b
--- a/jdk/test/java/lang/module/ModuleFinderTest.java	Thu Apr 06 17:01:03 2017 +0000
+++ b/jdk/test/java/lang/module/ModuleFinderTest.java	Fri Apr 07 08:05:54 2017 +0000
@@ -529,6 +529,30 @@
 
 
     /**
+     * Test ModuleFinder.of with a directory containing hidden files
+     */
+    public void testOfWithHiddenFiles() throws Exception {
+        Path dir = Files.createTempDirectory(USER_DIR, "mods");
+        createExplodedModule(dir.resolve("m"), "m",
+                "com/.ignore",
+                "com/foo/.ignore",
+                "com/foo/foo.properties");
+
+        ModuleFinder finder = ModuleFinder.of(dir);
+        ModuleReference mref = finder.find("m").orElse(null);
+        assertNotNull(mref);
+
+        Set<String> expectedPackages;
+        if (System.getProperty("os.name").startsWith("Windows")) {
+            expectedPackages = Set.of("com", "com.foo");
+        } else {
+            expectedPackages = Set.of("com.foo");
+        }
+        assertEquals(mref.descriptor().packages(), expectedPackages);
+    }
+
+
+    /**
      * Test ModuleFinder.of with a truncated module-info.class
      */
     public void testOfWithTruncatedModuleInfo() throws Exception {