@Test public void shouldGetWorkspacesForRepository() throws Exception { Workspaces workspaces = REST_CLIENT.getWorkspaces("repo"); assertNotNull(workspaces); List<String> wsList = workspaces.getWorkspaces(); assertEquals(1, wsList.size()); assertEquals("default", wsList.get(0)); }
public Workspaces getWorkspaces( String repositoryName ) { String url = jsonRestClient.appendToBaseURL(repositoryName); JSONRestClient.Response response = jsonRestClient.doGet(url); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new Workspaces(response.json()); }
ModeShapeRestClient { public Workspaces getWorkspaces( String repositoryName ) { String url = jsonRestClient.appendToBaseURL(repositoryName); JSONRestClient.Response response = jsonRestClient.doGet(url); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new Workspaces(response.json()); } }
ModeShapeRestClient { public Workspaces getWorkspaces( String repositoryName ) { String url = jsonRestClient.appendToBaseURL(repositoryName); JSONRestClient.Response response = jsonRestClient.doGet(url); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new Workspaces(response.json()); } ModeShapeRestClient( String repoUrl,
                                String username,
                                String password ); }
ModeShapeRestClient { public Workspaces getWorkspaces( String repositoryName ) { String url = jsonRestClient.appendToBaseURL(repositoryName); JSONRestClient.Response response = jsonRestClient.doGet(url); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new Workspaces(response.json()); } ModeShapeRestClient( String repoUrl,
                                String username,
                                String password ); String serverUrl(); Repositories getRepositories(); Repositories.Repository getRepository( String name ); Workspaces getWorkspaces( String repositoryName ); NodeTypes getNodeTypes(); QueryResult query( String query,
                              String queryLanguage ); String queryPlan( String query,
                             String queryLanguage ); }
ModeShapeRestClient { public Workspaces getWorkspaces( String repositoryName ) { String url = jsonRestClient.appendToBaseURL(repositoryName); JSONRestClient.Response response = jsonRestClient.doGet(url); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new Workspaces(response.json()); } ModeShapeRestClient( String repoUrl,
                                String username,
                                String password ); String serverUrl(); Repositories getRepositories(); Repositories.Repository getRepository( String name ); Workspaces getWorkspaces( String repositoryName ); NodeTypes getNodeTypes(); QueryResult query( String query,
                              String queryLanguage ); String queryPlan( String query,
                             String queryLanguage );  }