addPackage test

This commit is contained in:
Albert Shift 2015-06-06 15:27:14 -07:00
parent 6e3a130279
commit a46421fcce
2 changed files with 5 additions and 2 deletions

View file

@ -139,7 +139,10 @@ public final class SessionInitializer extends AbstractSessionOperations {
public SessionInitializer addPackage(String packageName) {
try {
PackageUtil.getClasses(packageName).forEach(initList::add);
PackageUtil.getClasses(packageName)
.stream()
.filter(c -> c.isInterface())
.forEach(initList::add);
} catch (ClassNotFoundException e) {
throw new CasserException("fail to add package " + packageName, e);
}

View file

@ -34,7 +34,7 @@ public class StaticColumnTest extends AbstractEmbeddedCassandraTest {
@BeforeClass
public static void beforeTest() {
Casser.init(getSession()).showCql().add(Message.class).autoCreateDrop().singleton();
Casser.init(getSession()).showCql().addPackage(Message.class.getPackage().getName()).autoCreateDrop().singleton();
}
@Test