ApplicationWsDelegate { public List<Component> listAllComponents( String applicationName ) { this.logger.finer( "Listing components for application " + applicationName + "..." ); WebResource path = this.resource.path( UrlConstants.APP ).path( applicationName ).path( "components" ); List<Component> result = this.wsClient.createBuilder( path ) .accept( MediaType.APPLICATION_JSON ) .get( new GenericType<List<Component>> () {}); if( result != null ) { this.logger.finer( result.size() + " components were found for the application " + applicationName + "." ); } else { this.logger.finer( "No component was found for the application " + applicationName + "." ); result = new ArrayList<>( 0 ); } return result; } ApplicationWsDelegate( WebResource resource, WsClient wsClient ); void changeInstanceState( String applicationName, InstanceStatus newStatus, String instancePath ); void setDescription( String applicationName, String newDesc ); void deployAndStartAll( String applicationName, String instancePath ); void stopAll( String applicationName, String instancePath ); void undeployAll( String applicationName, String instancePath ); List<Instance> listChildrenInstances( String applicationName, String instancePath, boolean all ); void addInstance( String applicationName, String parentInstancePath, Instance instance ); void removeInstance( String applicationName, String instancePath ); void resynchronize( String applicationName ); List<Component> listAllComponents( String applicationName ); List<Component> findComponentChildren( String applicationName, String componentName ); List<Component> findComponentAncestors( String applicationName, String componentName ); void bindApplication( String applicationName, String boundTplName, String boundApp ); List<String> listAllCommands( String applicationName );  }
@Test public void testListAllComponents() throws Exception { List<Component> components = this.client.getApplicationDelegate().listAllComponents( "inexisting" ); Assert.assertEquals( 0, components.size()); components = this.client.getApplicationDelegate().listAllComponents( this.app.getName()); Assert.assertEquals( ComponentHelpers.findAllComponents( this.app ).size(), components.size()); }