MCPcopy Create free account
hub / github.com/directwebremoting/dwr / ClasspathScannerTest

Class ClasspathScannerTest

etc/future/scanner/ClasspathScannerTest.java:8–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6import static org.junit.Assert.*;
7
8public class ClasspathScannerTest {
9 private ClasspathScanner scanner;
10
11 @Test
12 public void getPackage() {
13 scanner = new ClasspathScanner("org.hibernate.*");
14 assertEquals("Package was sanitized", "org/hibernate", scanner.getPackage());
15 }
16
17 @Test(expected = IllegalArgumentException.class)
18 public void getClasses() throws IOException {
19 scanner = new ClasspathScanner("org.hibernate.annotations.common.*");
20 Set<String> classes = scanner.getClasses();
21 assertTrue(classes.size() == 2);
22 assertTrue(classes.contains("org.hibernate.annotations.common.AssertionFailure"));
23 assertTrue(classes.contains("org.hibernate.annotations.common.TestDirectoryScan"));
24 scanner = new ClasspathScanner("org.hibernate.annotations.common.*", true);
25 classes = scanner.getClasses();
26 assertTrue(classes.size() == 61);
27 assertTrue(classes.contains("org.hibernate.annotations.common.other.another.AnotherTestDirectoryScan"));
28 scanner = new ClasspathScanner("x.y.z", true);
29 assertTrue(scanner.getClasses().size() == 0);
30 scanner = new ClasspathScanner("");
31 }
32
33}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…