mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1173 - Ebean server should read ebean.mf entity-packages to locate entity beans
This commit is contained in:
@@ -22,9 +22,32 @@ public class ManifestReaderTest {
|
||||
assertThat(packageSet).contains("com.foo.domain", "com.bar.domain");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readEntityPackages() throws Exception {
|
||||
|
||||
Set<String> packageSet = readMf("META-INF/test/test-entity-packages.mf");
|
||||
assertThat(packageSet).contains("com.baz", "org.bax.domain");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readCombined() throws Exception {
|
||||
|
||||
Set<String> packageSet = readMf("META-INF/test/test-combined.mf");
|
||||
assertThat(packageSet).contains("com.foo.domain", "com.bar.domain", "com.baz.domain");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readAgentOnlyUse() throws Exception {
|
||||
|
||||
Set<String> packageSet = readMf("META-INF/test/test-agent-only-use.mf");
|
||||
assertThat(packageSet).isEmpty();
|
||||
}
|
||||
|
||||
private Set<String> readMf(String path) {
|
||||
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
||||
return ManifestReader.readManifests(classLoader, path);
|
||||
return ManifestReader.create(classLoader)
|
||||
.read(path)
|
||||
.entityPackages();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user