strangedb/src/test/java/org/warp/jcwdb/tests/DBRootCreation.java

50 lines
965 B
Java

package org.warp.jcwdb.tests;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.warp.jcwdb.ann.DBObject;
import org.warp.jcwdb.ann.DBObjectIndicesManager;
import org.warp.jcwdb.ann.JCWDatabase;
import org.warp.jcwdb.utils.TestUtils;
import java.io.IOException;
import static org.junit.Assert.assertTrue;
public class DBRootCreation {
private TestUtils.WrappedDb db;
@Before
public void setUp() throws Exception {
db = TestUtils.wrapDb().create();
}
@Test
public void shouldCreateRoot() throws IOException {
RootClass root = db.get().loadRoot(RootClass.class);
assertTrue(root.test());
}
@After
public void tearDown() throws Exception {
db.delete();
}
public static class RootClass extends DBObject {
public RootClass(JCWDatabase database) throws IOException {
super(database);
}
public boolean test() {
return true;
}
@Override
public void initialize() throws IOException {
}
}
}