コード例 #1
0
 @Test(expected = NoResourceException.class)
 public void getDbInfo_dbNotExist_exception() {
   String dbName = "mazha_test_getdbinfo_dbnotexist";
   CouchClient customClient = new CouchClient(getCouchConfig(dbName));
   Preconditions.checkArgument(!isDbExist(dbName), "%s must not exist", dbName);
   customClient.getDbInfo();
 }
コード例 #2
0
 private boolean isDbExist(String dbName) {
   try {
     CouchClient c = new CouchClient(getCouchConfig(dbName));
     c.getDbInfo();
     return true;
   } catch (CouchException ce) {
     return false;
   }
 }
コード例 #3
0
 @Test(expected = CouchException.class)
 public void getDbInfo_invalidDbName_exception() {
   String dbName = "mazha_test_A";
   CouchClient customClient = new CouchClient(getCouchConfig(dbName));
   customClient.getDbInfo();
 }