airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1414928 - in /airavata/trunk/modules: airavata-client/src/main/java/org/apache/airavata/client/api/ airavata-client/src/main/java/org/apache/airavata/client/impl/ test-suite/src/test/java/org/apache/airavata/test/suite/gfac/
Date Wed, 28 Nov 2012 21:21:28 GMT
Author: samindaw
Date: Wed Nov 28 21:21:27 2012
New Revision: 1414928

URL: http://svn.apache.org/viewvc?rev=1414928&view=rev
Log:
fixing the test suit break

Modified:
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationManagerImpl.java
    airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/FileBreedGramTest.java
    airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderMPIRangerTest.java
    airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderPwscfRangerTest.java
    airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderTest.java

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java?rev=1414928&r1=1414927&r2=1414928&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ApplicationManager.java
Wed Nov 28 21:21:27 2012
@@ -190,6 +190,8 @@ public interface ApplicationManager {
     public void removeHostDescriptor(String hostName) throws AiravataAPIInvocationException;
 
     public boolean isServiceDescriptorExists(String descriptorName) throws AiravataAPIInvocationException;
+    
+    public boolean isDeploymentDescriptorExists(String serviceName, String hostName, String
descriptorName)throws AiravataAPIInvocationException;
 
     public void removeServiceDescriptor(String serviceName) throws AiravataAPIInvocationException;
 

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationManagerImpl.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationManagerImpl.java?rev=1414928&r1=1414927&r2=1414928&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationManagerImpl.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationManagerImpl.java
Wed Nov 28 21:21:27 2012
@@ -333,4 +333,15 @@ public class ApplicationManagerImpl impl
 		this.client = client;
 	}
 
+	@Override
+	public boolean isDeploymentDescriptorExists(String serviceName,
+			String hostName, String descriptorName)
+			throws AiravataAPIInvocationException {
+        try {
+            return getClient().getRegistryClient().isApplicationDescriptorExists(serviceName,
hostName, descriptorName);
+        } catch (Exception e) {
+            throw new AiravataAPIInvocationException(e);
+        }
+	}
+
 }

Modified: airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/FileBreedGramTest.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/FileBreedGramTest.java?rev=1414928&r1=1414927&r2=1414928&view=diff
==============================================================================
--- airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/FileBreedGramTest.java
(original)
+++ airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/FileBreedGramTest.java
Wed Nov 28 21:21:27 2012
@@ -29,6 +29,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
+import org.apache.airavata.client.AiravataAPIFactory;
+import org.apache.airavata.client.api.AiravataAPI;
 import org.apache.airavata.commons.gfac.type.ActualParameter;
 import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
 import org.apache.airavata.commons.gfac.type.HostDescription;
@@ -39,10 +41,6 @@ import org.apache.airavata.core.gfac.con
 import org.apache.airavata.core.gfac.context.security.impl.GSISecurityContext;
 import org.apache.airavata.core.gfac.notification.impl.LoggingNotification;
 import org.apache.airavata.core.gfac.services.impl.PropertiesBasedServiceImpl;
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.AiravataRegistryFactory;
-import org.apache.airavata.registry.api.AiravataUser;
-import org.apache.airavata.registry.api.Gateway;
 import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
 import org.apache.airavata.schemas.gfac.DataType;
 import org.apache.airavata.schemas.gfac.GlobusHostType;
@@ -61,7 +59,7 @@ public class FileBreedGramTest {
 
     public static final String MYPROXY = "myproxy";
     public static final String GRAM_PROPERTIES = "gram.properties";
-    private AiravataRegistry2 jcrRegistry = null;
+    private AiravataAPI airavataAPI = null;
 
     @Before
     public void setUp() throws Exception {
@@ -71,8 +69,8 @@ public class FileBreedGramTest {
 
 
        Map<String,String> config = new HashMap<String,String>();
-
-       jcrRegistry = AiravataRegistryFactory.getRegistry(new Gateway("default"), new AiravataUser("admin"));
+       airavataAPI=AiravataAPIFactory.getAPI("default","admin");
+//       jcrRegistry = AiravataRegistryFactory.getRegistry(new Gateway("default"), new AiravataUser("admin"));
 	   config.put("org.apache.jackrabbit.repository.home","target");
 	   
         /*
@@ -138,9 +136,9 @@ public class FileBreedGramTest {
         /*
         * Save deployment descriptions to registry
         */
-        jcrRegistry.addHostDescriptor(host);
-        jcrRegistry.addApplicationDescriptor(serv.getType().getName(), host.getType().getHostName(),
appDesc);
-        jcrRegistry.addServiceDescriptor(serv);
+        airavataAPI.getApplicationManager().saveHostDescription(host);
+        airavataAPI.getApplicationManager().saveDeploymentDescription(serv.getType().getName(),
host.getType().getHostName(), appDesc);
+        airavataAPI.getApplicationManager().saveServiceDescription(serv);
 //        jcrRegistry.deployServiceOnHost(serv.getType().getName(), host.getType().getHostName());
     }
 
@@ -154,7 +152,7 @@ public class FileBreedGramTest {
             DefaultInvocationContext ct = new DefaultInvocationContext();
             DefaultExecutionContext ec = new DefaultExecutionContext();
             ec.addNotifiable(new LoggingNotification());
-            ec.setRegistryService(jcrRegistry);
+            ec.setRegistryService(airavataAPI);
             ct.setExecutionContext(ec);
 
 

Modified: airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderMPIRangerTest.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderMPIRangerTest.java?rev=1414928&r1=1414927&r2=1414928&view=diff
==============================================================================
--- airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderMPIRangerTest.java
(original)
+++ airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderMPIRangerTest.java
Wed Nov 28 21:21:27 2012
@@ -29,6 +29,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
+import org.apache.airavata.client.AiravataAPIFactory;
+import org.apache.airavata.client.api.AiravataAPI;
 import org.apache.airavata.commons.gfac.type.ActualParameter;
 import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
 import org.apache.airavata.commons.gfac.type.HostDescription;
@@ -39,10 +41,6 @@ import org.apache.airavata.core.gfac.con
 import org.apache.airavata.core.gfac.context.security.impl.GSISecurityContext;
 import org.apache.airavata.core.gfac.notification.impl.LoggingNotification;
 import org.apache.airavata.core.gfac.services.impl.PropertiesBasedServiceImpl;
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.AiravataRegistryFactory;
-import org.apache.airavata.registry.api.AiravataUser;
-import org.apache.airavata.registry.api.Gateway;
 import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
 import org.apache.airavata.schemas.gfac.GlobusHostType;
 import org.apache.airavata.schemas.gfac.GramApplicationDeploymentType;
@@ -60,14 +58,14 @@ public class GramProviderMPIRangerTest {
 
     public static final String MYPROXY = "myproxy";
     public static final String GRAM_PROPERTIES = "gram-ranger.properties";
-    private AiravataRegistry2 jcrRegistry = null;
+    private AiravataAPI airavataAPI = null;
 
     @Before
     public void setUp() throws Exception {
         Map<String,String> config = new HashMap<String,String>();
             config.put("org.apache.jackrabbit.repository.home","target");
 
-        jcrRegistry = AiravataRegistryFactory.getRegistry(new Gateway("default"), new AiravataUser("admin"));
+        airavataAPI=AiravataAPIFactory.getAPI("default","admin");
 
 
         // Host
@@ -119,9 +117,9 @@ public class GramProviderMPIRangerTest {
         serv.getType().setOutputParametersArray(outputParamList);
 
         /* Save to Registry */
-        jcrRegistry.addHostDescriptor(host);
-        jcrRegistry.addApplicationDescriptor(serv.getType().getName(), host.getType().getHostName(),
appDesc);
-        jcrRegistry.addServiceDescriptor(serv);
+        airavataAPI.getApplicationManager().saveHostDescription(host);
+        airavataAPI.getApplicationManager().saveDeploymentDescription(serv.getType().getName(),
host.getType().getHostName(), appDesc);
+        airavataAPI.getApplicationManager().saveServiceDescription(serv);
 //        jcrRegistry.deployServiceOnHost(serv.getType().getName(), host.getType().getHostName());
     }
 
@@ -135,7 +133,7 @@ public class GramProviderMPIRangerTest {
             DefaultInvocationContext ct = new DefaultInvocationContext();
             DefaultExecutionContext ec = new DefaultExecutionContext();
             ec.addNotifiable(new LoggingNotification());
-            ec.setRegistryService(jcrRegistry);
+            ec.setRegistryService(airavataAPI);
             ct.setExecutionContext(ec);
 
 

Modified: airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderPwscfRangerTest.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderPwscfRangerTest.java?rev=1414928&r1=1414927&r2=1414928&view=diff
==============================================================================
--- airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderPwscfRangerTest.java
(original)
+++ airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderPwscfRangerTest.java
Wed Nov 28 21:21:27 2012
@@ -30,6 +30,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
+import org.apache.airavata.client.AiravataAPIFactory;
+import org.apache.airavata.client.api.AiravataAPI;
 import org.apache.airavata.commons.gfac.type.ActualParameter;
 import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
 import org.apache.airavata.commons.gfac.type.HostDescription;
@@ -40,10 +42,6 @@ import org.apache.airavata.core.gfac.con
 import org.apache.airavata.core.gfac.context.security.impl.GSISecurityContext;
 import org.apache.airavata.core.gfac.notification.impl.LoggingNotification;
 import org.apache.airavata.core.gfac.services.impl.PropertiesBasedServiceImpl;
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.AiravataRegistryFactory;
-import org.apache.airavata.registry.api.AiravataUser;
-import org.apache.airavata.registry.api.Gateway;
 import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
 import org.apache.airavata.schemas.gfac.GlobusHostType;
 import org.apache.airavata.schemas.gfac.GramApplicationDeploymentType;
@@ -59,14 +57,14 @@ import org.junit.Test;
 public class GramProviderPwscfRangerTest {
     public static final String MYPROXY = "myproxy";
     public static final String GRAM_PROPERTIES = "gram-ranger.properties";
-    private AiravataRegistry2 jcrRegistry = null;
+    private AiravataAPI airavataAPI = null;
 
     @Before
     public void setUp() throws Exception {
         Map<String,String> config = new HashMap<String,String>();
             config.put("org.apache.jackrabbit.repository.home","target");
 
-        jcrRegistry = AiravataRegistryFactory.getRegistry(new Gateway("default"), new AiravataUser("admin"));
+        airavataAPI=AiravataAPIFactory.getAPI("default","admin");
 
 
         // Host
@@ -118,9 +116,9 @@ public class GramProviderPwscfRangerTest
         serv.getType().setOutputParametersArray(outputParamList);
 
         /* Save to Registry */
-        jcrRegistry.addHostDescriptor(host);
-        jcrRegistry.addApplicationDescriptor(serv.getType().getName(), host.getType().getHostName(),
appDesc);
-        jcrRegistry.addServiceDescriptor(serv);
+        airavataAPI.getApplicationManager().saveHostDescription(host);
+        airavataAPI.getApplicationManager().saveDeploymentDescription(serv.getType().getName(),
host.getType().getHostName(), appDesc);
+        airavataAPI.getApplicationManager().saveServiceDescription(serv);
 //        jcrRegistry.deployServiceOnHost(serv.getType().getName(), host.getType().getHostName());
     }
 
@@ -134,7 +132,7 @@ public class GramProviderPwscfRangerTest
             DefaultInvocationContext ct = new DefaultInvocationContext();
             DefaultExecutionContext ec = new DefaultExecutionContext();
             ec.addNotifiable(new LoggingNotification());
-            ec.setRegistryService(jcrRegistry);
+            ec.setRegistryService(airavataAPI);
             ct.setExecutionContext(ec);
 
 

Modified: airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderTest.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderTest.java?rev=1414928&r1=1414927&r2=1414928&view=diff
==============================================================================
--- airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderTest.java
(original)
+++ airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderTest.java
Wed Nov 28 21:21:27 2012
@@ -29,6 +29,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
+import org.apache.airavata.client.AiravataAPIFactory;
+import org.apache.airavata.client.api.AiravataAPI;
 import org.apache.airavata.commons.gfac.type.ActualParameter;
 import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
 import org.apache.airavata.commons.gfac.type.HostDescription;
@@ -39,10 +41,6 @@ import org.apache.airavata.core.gfac.con
 import org.apache.airavata.core.gfac.context.security.impl.GSISecurityContext;
 import org.apache.airavata.core.gfac.notification.impl.LoggingNotification;
 import org.apache.airavata.core.gfac.services.impl.PropertiesBasedServiceImpl;
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.AiravataRegistryFactory;
-import org.apache.airavata.registry.api.AiravataUser;
-import org.apache.airavata.registry.api.Gateway;
 import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
 import org.apache.airavata.schemas.gfac.GlobusHostType;
 import org.apache.airavata.schemas.gfac.GramApplicationDeploymentType;
@@ -61,7 +59,7 @@ public class GramProviderTest {
     public static final String MYPROXY = "myproxy";
 //    public static final String GRAM_PROPERTIES = "gram.properties";
     public static final String GRAM_PROPERTIES = "gram-ranger.properties";
-    private AiravataRegistry2 jcrRegistry = null;
+    private AiravataAPI airavataAPI = null;
 
     @Before
     public void setUp() throws Exception {
@@ -71,7 +69,7 @@ public class GramProviderTest {
         Map<String,String> config = new HashMap<String,String>();
             config.put("org.apache.jackrabbit.repository.home","target");
 
-        jcrRegistry = AiravataRegistryFactory.getRegistry(new Gateway("default"), new AiravataUser("admin"));
+        airavataAPI=AiravataAPIFactory.getAPI("default","admin");
 
     
         /*
@@ -135,24 +133,24 @@ public class GramProviderTest {
            * Save to registry
            */
 
-        jcrRegistry.getApplicationDescriptors(serv.getType().getName());
+        airavataAPI.getApplicationManager().getApplicationDescriptors(serv.getType().getName());
 
-        if(jcrRegistry.isHostDescriptorExists(host.getType().getHostName())) {
-            jcrRegistry.updateHostDescriptor(host);
+        if(airavataAPI.getApplicationManager().isHostDescriptorExists(host.getType().getHostName()))
{
+            airavataAPI.getApplicationManager().updateHostDescriptor(host);
         } else {
-            jcrRegistry.addHostDescriptor(host);
+            airavataAPI.getApplicationManager().saveHostDescription(host);
         }
 
-        if (jcrRegistry.isApplicationDescriptorExists(serv.getType().getName(),host.getType().getHostName(),appDesc.getType().getApplicationName().getStringValue())){
-            jcrRegistry.updateApplicationDescriptor(serv.getType().getName(), host.getType().getHostName(),
appDesc);
+        if (airavataAPI.getApplicationManager().isDeploymentDescriptorExists(serv.getType().getName(),host.getType().getHostName(),appDesc.getType().getApplicationName().getStringValue())){
+            airavataAPI.getApplicationManager().updateApplicationDescriptor(serv.getType().getName(),
host.getType().getHostName(), appDesc);
         } else {
-            jcrRegistry.addApplicationDescriptor(serv.getType().getName(), host.getType().getHostName(),
appDesc);
+            airavataAPI.getApplicationManager().saveDeploymentDescription(serv.getType().getName(),
host.getType().getHostName(), appDesc);
         }
 
-        if (jcrRegistry.isServiceDescriptorExists(serv.getType().getName())){
-            jcrRegistry.updateServiceDescriptor(serv);
+        if (airavataAPI.getApplicationManager().isServiceDescriptorExists(serv.getType().getName())){
+            airavataAPI.getApplicationManager().updateServiceDescriptor(serv);
         } else {
-            jcrRegistry.addServiceDescriptor(serv);
+            airavataAPI.getApplicationManager().saveServiceDescription(serv);
         }
 //        jcrRegistry.deployServiceOnHost(serv.getType().getName(), host.getType().getHostName());
     }
@@ -167,7 +165,7 @@ public class GramProviderTest {
             DefaultInvocationContext ct = new DefaultInvocationContext();
             DefaultExecutionContext ec = new DefaultExecutionContext();
             ec.addNotifiable(new LoggingNotification());
-            ec.setRegistryService(jcrRegistry);
+            ec.setRegistryService(airavataAPI);
             ct.setExecutionContext(ec);
 
 



Mime
View raw message