@Test public void testGetDatabaseNames() throws Exception { List<String> databaseNames = client.getDatabaseNames(); assertTrue("Expected _users db to showup", databaseNames.indexOf("_users") >= 0); }
public List<String> getDatabaseNames() throws IOException { CouchDBResponse response = get("_all_dbs"); JSONArray array = response.getBodyAsJSONArray(); if (array.size() > 0) { assert array.get(0).getClass() == String.class; } return (List<String>) array; }
CouchDBClient implements Closeable { public List<String> getDatabaseNames() throws IOException { CouchDBResponse response = get("_all_dbs"); JSONArray array = response.getBodyAsJSONArray(); if (array.size() > 0) { assert array.get(0).getClass() == String.class; } return (List<String>) array; } }
CouchDBClient implements Closeable { public List<String> getDatabaseNames() throws IOException { CouchDBResponse response = get("_all_dbs"); JSONArray array = response.getBodyAsJSONArray(); if (array.size() > 0) { assert array.get(0).getClass() == String.class; } return (List<String>) array; } CouchDBClient(String root); }
CouchDBClient implements Closeable { public List<String> getDatabaseNames() throws IOException { CouchDBResponse response = get("_all_dbs"); JSONArray array = response.getBodyAsJSONArray(); if (array.size() > 0) { assert array.get(0).getClass() == String.class; } return (List<String>) array; } 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 List<String> getDatabaseNames() throws IOException { CouchDBResponse response = get("_all_dbs"); JSONArray array = response.getBodyAsJSONArray(); if (array.size() > 0) { assert array.get(0).getClass() == String.class; } return (List<String>) array; } 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();  }