< prev index next >
test/java/lang/module/ModuleFinderTest.java
Print this page
*** 371,381 ****
assertTrue(descriptor.packages().contains("p.resources"));
}
/**
! * Test ModuleModule with a JAR file containing a .class file in the top
* level directory.
*/
public void testOfOneJarFileWithTopLevelClass() throws Exception {
Path dir = Files.createTempDirectory(USER_DIR, "mods");
Path jar = createModularJar(dir.resolve("m.jar"), "m", "Mojo.class");
--- 371,381 ----
assertTrue(descriptor.packages().contains("p.resources"));
}
/**
! * Test ModuleFinder with a JAR file containing a .class file in the top
* level directory.
*/
public void testOfOneJarFileWithTopLevelClass() throws Exception {
Path dir = Files.createTempDirectory(USER_DIR, "mods");
Path jar = createModularJar(dir.resolve("m.jar"), "m", "Mojo.class");
*** 384,406 ****
try {
finder.find("m");
assertTrue(false);
} catch (FindException e) {
assertTrue(e.getCause() instanceof InvalidModuleDescriptorException);
}
finder = ModuleFinder.of(jar);
try {
finder.findAll();
assertTrue(false);
} catch (FindException e) {
assertTrue(e.getCause() instanceof InvalidModuleDescriptorException);
}
}
/**
! * Test ModuleModule with a JAR file containing a .class file in the top
* level directory.
*/
public void testOfOneExplodedModuleWithTopLevelClass() throws Exception {
Path dir = Files.createTempDirectory(USER_DIR, "mods");
Path m_dir = createExplodedModule(dir.resolve("m"), "m", "Mojo.class");
--- 384,408 ----
try {
finder.find("m");
assertTrue(false);
} catch (FindException e) {
assertTrue(e.getCause() instanceof InvalidModuleDescriptorException);
+ assertTrue(e.getCause().getMessage().contains("Mojo.class"));
}
finder = ModuleFinder.of(jar);
try {
finder.findAll();
assertTrue(false);
} catch (FindException e) {
assertTrue(e.getCause() instanceof InvalidModuleDescriptorException);
+ assertTrue(e.getCause().getMessage().contains("Mojo.class"));
}
}
/**
! * Test ModuleFinder with a JAR file containing a .class file in the top
* level directory.
*/
public void testOfOneExplodedModuleWithTopLevelClass() throws Exception {
Path dir = Files.createTempDirectory(USER_DIR, "mods");
Path m_dir = createExplodedModule(dir.resolve("m"), "m", "Mojo.class");
*** 409,426 ****
--- 411,430 ----
try {
finder.find("m");
assertTrue(false);
} catch (FindException e) {
assertTrue(e.getCause() instanceof InvalidModuleDescriptorException);
+ assertTrue(e.getCause().getMessage().contains("Mojo.class"));
}
finder = ModuleFinder.of(m_dir);
try {
finder.findAll();
assertTrue(false);
} catch (FindException e) {
assertTrue(e.getCause() instanceof InvalidModuleDescriptorException);
+ assertTrue(e.getCause().getMessage().contains("Mojo.class"));
}
}
/**
< prev index next >