ApplicationDeployment implements eu.cloud4soa.api.soa.ApplicationDeployment { @Override public List<ApplicationInstance> retrieveAllDeployedApplicationProfiles( String userInstanceUriId) throws SOAException{ List<ApplicationInstance> retrievedDeployedApplicationInstances = new ArrayList<ApplicationInstance>(); logger.debug("received userInstanceUriId: "+userInstanceUriId); logger.debug("call applicationProfilesRepository.retrieveAllApplicationProfile(userInstanceUriId)"); List<ApplicationInstance> applicationInstances; try { applicationInstances = applicationProfilesRepository.retrieveAllApplicationProfile(userInstanceUriId); } catch (RepositoryException ex) { throw new SOAException(Response.Status.INTERNAL_SERVER_ERROR, ex.getMessage()); } logger.debug("filtering applicationInstances: "+applicationInstances); for (ApplicationInstance applicationInstance : applicationInstances) { if(applicationInstance.getStatus()!=null){ retrievedDeployedApplicationInstances.add(applicationInstance); logger.debug("found deployed applicationInstance: "+applicationInstance); } } logger.debug("retrievedDeployedApplicationInstances: "+retrievedDeployedApplicationInstances); return retrievedDeployedApplicationInstances; }  void setSlaModule(SLAModule slaModule); void setApplicationProfilesRepository(ApplicationProfilesRepository applicationProfilesRepository); void setPaaSOfferingProfilesRepository(PaaSOfferingProfilesRepository paaSOfferingProfilesRepository); void setExecutionManagementServiceModule(ExecutionManagementServiceModule executionManagementServiceModule); void setUserManagementAndSecurityModule(UserManagementAndSecurityModule userManagementAndSecurityModule); @Deprecated @Override Response deployApplication(  String          applicationInstanceUriId, 
                                        String          paaSInstanceUriId,
                                        InputStream     archiveFileStream); @Deprecated @Override Response deployApplication(  String          applicationInstanceUriId, 
                                        String          paaSInstanceUriId,
                                        String          slaTemplateId,
                                        InputStream     archiveFileStream ); @Override Response deployApplication( ApplicationDeploymentParameters parameters ); @Override Response startStopApplication(String applicationInstanceUriId,
            String startStopCommand); @Override List<ApplicationInstance> retrieveAllDeployedApplicationProfiles(
                    String userInstanceUriId); @Override Response removeApplication(String applicationInstanceUriId); @Override Response createDatabase(String applicationInstanceUriId, String paaSInstanceUriId, String dbStorageComponentUriId); @Override Response initializeDatabase(String applicationInstanceUriId, String paaSInstanceUriId, String dbStorageComponentUriId, InputStream is); @Override InputStream dumpDatabase(String applicationInstanceUriId, String paaSInstanceUriId, String dbStorageComponentUriId); @Override GitRepoInfo initializeGitProxy(String userInstanceUriId, String paaSInstanceUriId, String applicationInstanceUriId ); @Override GitRepoInfo createGitRepo(String userInstanceUriId, String paaSInstanceUriId, String applicationInstanceUriId ); GitRepoInfo createGitRepo(String userInstanceUriId, PaaSInstance paaSInstance, ApplicationInstance applicationInstance ); GitRepoInfo UpdateGitRepo(GitRepoInfo gitRepoInfo,String userInstanceUriId, PaaSInstance paaSInstance, ApplicationInstance applicationInstance ); @Override Response commitGitDeploy(String userInstanceUriId, String paaSInstanceUriId, String applicationInstanceUriId); @Override Response deleteRepo(String c4sUserId, String repoId); @Override // < repoId, <gitUrl, repoName>> Map<Long, Entry<String, String>> getGitRepos( String userInstanceUriId ); @Override // < proxyId, <repoName, repoId>> Map<Long, Entry<String, Long>> getGitProxies(String userInstanceUriId); @Override Response registerGitRepository(String applicationInstanceUriId, String userInstanceUriId, String paaSInstanceUriId, String repositoryName, String gitUrl); @Override Response registerGitProxy(String userInstanceUriId, String proxyName); @Override Response bindProxyToGit(String userInstanceUriId, String proxyId, String gitRepoId ); @Override Response relocateRepo(String c4sUserId, String newPaasUriId); @Override GitRepoInfo getGitRepoInfos(String userInstanceUriId, String paaSInstanceUriId, String applicationInstanceUriId); @Override String getC4SOAPublicKey(); @Override Response registerPublicKeyForUser(String userInstanceUriId, String publicKey); @Override StringList getPublicKeysForUser(String userInstanceUriId); @Override Response deletePublicKeyFromUser(String userInstanceUriId, String publicKey); @Override SlaContract getSLAContract(String applicationInstanceUriId); @Deprecated @Override Response deployApplication(String applicationInstanceUriId, String paaSInstanceUriId, String publicKey, String secretKey, InputStream is); @Deprecated @Override Response startStopApplication(String applicationInstanceUriId, String startStopCommand, String publicKey, String secretKey); @Deprecated @Override Response removeApplication(String applicationInstanceUriId, String publicKey, String secretKey); @Deprecated @Override Response createDatabase(String applicationInstanceUriId, String paaSInstanceUriId, String dbStorageComponentUriId, String publicKey, String secretKey);  }
@Ignore @Test public void TestRetrieveAllDeployedApplicationProfiles() { List<ApplicationInstance> applications = null; try { applications = appDeployment.retrieveAllDeployedApplicationProfiles(userInstance.getUriId()); } catch (SOAException ex) { Assert.fail("storePaaSInstance method has thrown an exception!"); } Assert.assertTrue(!applications.isEmpty()); }
@Ignore @Test public void TestUndeployApplication() { String publicKey = null; String secretKey = null; if (paaSInstance.getTitle().equals("Beanstalk")) { publicKey = "AKIAJRSZ7FBNKBAOUR6A"; secretKey = "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"; } if (paaSInstance.getTitle().equals("CloudBees")) { publicKey = "4184E8A5D19D02D9"; secretKey = "UZPYSQVJMQLVNNVK6GSZQPRUTAZ+QKNB9QCKDWVNQMK="; } List<ApplicationInstance> applications = null; try { applications = appDeployment.retrieveAllDeployedApplicationProfiles(userInstance.getUriId()); } catch (SOAException ex) { Assert.fail("retrieveAllDeployedApplicationProfiles method has thrown an exception!"); } Assert.assertTrue(applications.isEmpty()); }