@Test public void testOpenDBConnection() throws Exception { CouchDBConnection db = client.createDB(getTestDB()); assertEquals(getTestDB(), client.openDBConnection(getTestDB()).getName()); db.delete(); try { client.openDBConnection("nonexistent"); fail("expected error"); } catch (CouchDBException cex) { assertTrue("expected useful failure message", cex.getMessage().indexOf("not_found") > 0); } }
public CouchDBConnection openDBConnection(String name) throws CouchDBException, IOException { CouchDBResponse resp = get(name); resp.checkOK("Unable to open DB '" + name + "'"); return new CouchDBConnection(resp, this); }
CouchDBClient implements Closeable { public CouchDBConnection openDBConnection(String name) throws CouchDBException, IOException { CouchDBResponse resp = get(name); resp.checkOK("Unable to open DB '" + name + "'"); return new CouchDBConnection(resp, this); } }
CouchDBClient implements Closeable { public CouchDBConnection openDBConnection(String name) throws CouchDBException, IOException { CouchDBResponse resp = get(name); resp.checkOK("Unable to open DB '" + name + "'"); return new CouchDBConnection(resp, this); } CouchDBClient(String root); }
CouchDBClient implements Closeable { public CouchDBConnection openDBConnection(String name) throws CouchDBException, IOException { CouchDBResponse resp = get(name); resp.checkOK("Unable to open DB '" + name + "'"); return new CouchDBConnection(resp, this); } CouchDBClient(String root); List<String> getDatabaseNames(); CouchDBConnection openDBConnection(String name); CouchDBConnection createDB(String name); CouchDBResponse delete(String path); CouchDBResponse post(String path, String content); CouchDBResponse post(String path, RequestEntity content); CouchDBResponse post(String path, File content); CouchDBResponse put(String path); CouchDBResponse put(String path, String content); CouchDBResponse put(String path, File content); CouchDBResponse get(String path); CouchDBResponse get(String path, NameValuePair[] queryParams); void close(); }
CouchDBClient implements Closeable { public CouchDBConnection openDBConnection(String name) throws CouchDBException, IOException { CouchDBResponse resp = get(name); resp.checkOK("Unable to open DB '" + name + "'"); return new CouchDBConnection(resp, this); } CouchDBClient(String root); List<String> getDatabaseNames(); CouchDBConnection openDBConnection(String name); CouchDBConnection createDB(String name); CouchDBResponse delete(String path); CouchDBResponse post(String path, String content); CouchDBResponse post(String path, RequestEntity content); CouchDBResponse post(String path, File content); CouchDBResponse put(String path); CouchDBResponse put(String path, String content); CouchDBResponse put(String path, File content); CouchDBResponse get(String path); CouchDBResponse get(String path, NameValuePair[] queryParams); void close();  }