コード例 #1
0
  @After
  public void dropDatabase() {
    Set<String> names = dbManager.getDB().getCollectionNames();
    for (String each : names) {
      if (!each.startsWith("system")) {
        dbManager.getDB().getCollection(each).drop();
      }
    }

    // dbManager.getDB().dropDatabase();
  }
コード例 #2
0
 public static void initDbManager() {
   // to be able to do lazy loading of associations inside test class
   DbManager dbManager = new DbManager();
   dbManager.setDbname("Library-test");
   DbManager.setThreadInstance(dbManager);
 }
コード例 #3
0
 private int countRowsInDBCollection(String name) {
   return (int) dbManager.getDBCollection(name).getCount();
 }
コード例 #4
0
 @Before
 public void initDbManagerThreadInstance() throws Exception {
   // to be able to do lazy loading of associations inside test class
   DbManager.setThreadInstance(dbManager);
 }