airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: adding client to check airavata server functions
Date Thu, 27 Feb 2014 21:16:18 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 57ccaa5d0 -> 04a8b5efd


adding client to check airavata server functions


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/04a8b5ef
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/04a8b5ef
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/04a8b5ef

Branch: refs/heads/master
Commit: 04a8b5efd0e24cc7293b099c98c46f766a4db753
Parents: 57ccaa5
Author: chathuri <chathuri@apache.org>
Authored: Thu Feb 27 16:16:10 2014 -0500
Committer: chathuri <chathuri@apache.org>
Committed: Thu Feb 27 16:16:10 2014 -0500

----------------------------------------------------------------------
 .../java-client-samples/pom.xml                 | 10 ++++
 .../client/samples/CreateLaunchExperiment.java  | 32 ++++++++++--
 airavata-api/pom.xml                            |  2 +-
 .../org/apache/airavata/gfac/cpi/GFacImpl.java  |  1 -
 .../gfac/provider/utils/DataTransferrer.java    |  1 -
 .../airavata/gfac/utils/GramRSLGenerator.java   |  1 -
 .../orchestrator/core/NewOrchestratorTest.java  | 53 ++++++++++----------
 .../core/OrchestratorTestWithGRAM.java          | 51 +++++++++----------
 .../core/OrchestratorTestWithGSISSH.java        | 51 +++++++++----------
 .../persistance/registry/jpa/ResourceUtils.java |  7 +--
 10 files changed, 120 insertions(+), 89 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/04a8b5ef/airavata-api/airavata-client-sdks/java-client-samples/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/pom.xml b/airavata-api/airavata-client-sdks/java-client-samples/pom.xml
index 7491e15..c3282e9 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/pom.xml
+++ b/airavata-api/airavata-client-sdks/java-client-samples/pom.xml
@@ -29,6 +29,16 @@
 
         <dependency>
             <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-data-models</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-model-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
             <artifactId>airavata-api-stubs</artifactId>
             <version>${project.version}</version>
         </dependency>

http://git-wip-us.apache.org/repos/asf/airavata/blob/04a8b5ef/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index 300326f..bfe631c 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -23,22 +23,48 @@ package org.apache.airavata.client.samples;
 
 import org.apache.airavata.api.Airavata;
 import org.apache.airavata.api.client.AiravataClientFactory;
+import org.apache.airavata.api.error.AiravataClientException;
+import org.apache.airavata.api.error.AiravataSystemException;
+import org.apache.airavata.api.error.InvalidRequestException;
+import org.apache.airavata.model.util.ExperimentModelUtil;
 import org.apache.thrift.TException;
+import org.apache.airavata.model.workspace.experiment.Experiment;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class CreateLaunchExperiment {
 
     //FIXME: Read from a config file
     public static final String THRIFT_SERVER_HOST = "localhost";
     public static final int THRIFT_SERVER_PORT = 8930;
+    private static Airavata.Client airavata;
+    private final static Logger logger = LoggerFactory.getLogger(CreateLaunchExperiment.class);
 
     public static void main(String[] args) {
-        AiravataClientFactory airavataClientFactory = new AiravataClientFactory();
-        Airavata.Client airavata = airavataClientFactory.createAiravataClient(THRIFT_SERVER_HOST,
THRIFT_SERVER_PORT);
+        airavata = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST, THRIFT_SERVER_PORT);
         try {
             System.out.println("API version is " + airavata.GetAPIVersion());
+            createExperiment(airavata);
         } catch (TException e) {
-            e.printStackTrace();
+           logger.error("Error while connecting with server", e.getMessage());
         }
+    }
 
+    public static String createExperiment (Airavata.Client client){
+        try{
+            Experiment experiment = ExperimentModelUtil.createSimpleExperiment("testProject",
"admin", "experiment1", "testDescription", "testApp", null);
+            String expId = client.createExperiment(experiment);
+            System.out.println("Experiment ID : " + expId);
+            return expId;
+        } catch (AiravataSystemException e) {
+            e.printStackTrace();
+        } catch (InvalidRequestException e) {
+            e.printStackTrace();
+        } catch (AiravataClientException e) {
+            e.printStackTrace();
+        }catch (TException e) {
+            e.printStackTrace();
+        }
+        return null;
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/04a8b5ef/airavata-api/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-api/pom.xml b/airavata-api/pom.xml
index 8c593fb..05c16f9 100644
--- a/airavata-api/pom.xml
+++ b/airavata-api/pom.xml
@@ -31,8 +31,8 @@
                 <activeByDefault>true</activeByDefault>
             </activation>
             <modules>
-                <module>airavata-api-stubs</module>
                 <module>airavata-data-models</module>
+                <module>airavata-api-stubs</module>
                 <module>airavata-model-utils</module>
                 <module>airavata-api-server</module>
                 <module>airavata-client-sdks</module>

http://git-wip-us.apache.org/repos/asf/airavata/blob/04a8b5ef/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacImpl.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacImpl.java
index 4dbca11..095f02c 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/cpi/GFacImpl.java
@@ -52,7 +52,6 @@ import org.apache.airavata.gsi.ssh.impl.PBSCluster;
 import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPasswordAuthenticationInfo;
 import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPublicKeyFileAuthentication;
 import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
-import org.apache.airavata.model.experiment.ConfigurationData;
 import org.apache.airavata.model.workspace.experiment.DataObjectType;
 import org.apache.airavata.model.workspace.experiment.TaskDetails;
 import org.apache.airavata.registry.api.AiravataRegistry2;

http://git-wip-us.apache.org/repos/asf/airavata/blob/04a8b5ef/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/utils/DataTransferrer.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/utils/DataTransferrer.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/utils/DataTransferrer.java
index a88db7e..ff3f9e2 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/utils/DataTransferrer.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/utils/DataTransferrer.java
@@ -34,7 +34,6 @@ import org.apache.airavata.commons.gfac.type.ApplicationDescription;
 import org.apache.airavata.gfac.Constants;
 import org.apache.airavata.gfac.context.JobExecutionContext;
 import org.apache.airavata.gfac.provider.GFacProviderException;
-import org.apache.airavata.model.experiment.ConfigurationData;
 import org.apache.airavata.model.workspace.experiment.TaskDetails;
 import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
 import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;

http://git-wip-us.apache.org/repos/asf/airavata/blob/04a8b5ef/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramRSLGenerator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramRSLGenerator.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramRSLGenerator.java
index d54296b..187d8f1 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramRSLGenerator.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramRSLGenerator.java
@@ -32,7 +32,6 @@ import org.apache.airavata.gfac.ToolsException;
 import org.apache.airavata.gfac.context.JobExecutionContext;
 import org.apache.airavata.gfac.context.MessageContext;
 import org.apache.airavata.gfac.provider.GFacProviderException;
-import org.apache.airavata.model.experiment.ConfigurationData;
 import org.apache.airavata.model.workspace.experiment.ComputationalResourceScheduling;
 import org.apache.airavata.model.workspace.experiment.TaskDetails;
 import org.apache.airavata.schemas.gfac.FileArrayType;

http://git-wip-us.apache.org/repos/asf/airavata/blob/04a8b5ef/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
index 8bda644..3506659 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/NewOrchestratorTest.java
@@ -27,7 +27,6 @@ import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.model.experiment.*;
 import org.apache.airavata.orchestrator.cpi.Orchestrator;
 import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
 import org.apache.airavata.persistance.registry.jpa.impl.RegistryImpl;
@@ -59,32 +58,32 @@ public class NewOrchestratorTest extends BaseOrchestratorTest {
         // creating host description
 
         //Using new airavata-api methods to store experiment metadata
-        BasicMetadata basicMetadata = new BasicMetadata();
-        basicMetadata.setExperimentName("test123");
-        basicMetadata.setUserName("admin");
-        basicMetadata.setUserNameIsSet(true);
-        basicMetadata.setProjectID("default");
-
-        AdvancedInputDataHandling advancedInputDataHandling = new AdvancedInputDataHandling();
-        AdvancedOutputDataHandling advancedOutputDataHandling = new AdvancedOutputDataHandling();
-        ComputationalResourceScheduling computationalResourceScheduling = new ComputationalResourceScheduling();
-        QualityOfServiceParams qualityOfServiceParams = new QualityOfServiceParams();
-        ConfigurationData configurationData = new ConfigurationData();
-
-
-        HashMap<String, String> exInputs = new HashMap<String, String>();
-        exInputs.put("echo_input", "echo_output=hello");
-
-        configurationData.setExperimentInputs(exInputs);
-        configurationData.setAdvanceInputDataHandling(advancedInputDataHandling);
-        configurationData.setAdvanceOutputDataHandling(advancedOutputDataHandling);
-        configurationData.setComputationalResourceScheduling(computationalResourceScheduling);
-        configurationData.setQosParams(qualityOfServiceParams);
-        configurationData.setApplicationId("Echo");
-
-        Registry registry = new RegistryImpl();
-        experimentID = (String) registry.add(ParentDataType.EXPERIMENT, basicMetadata);
-        registry.add(ChildDataType.EXPERIMENT_CONFIGURATION_DATA, configurationData, experimentID);
+//        BasicMetadata basicMetadata = new BasicMetadata();
+//        basicMetadata.setExperimentName("test123");
+//        basicMetadata.setUserName("admin");
+//        basicMetadata.setUserNameIsSet(true);
+//        basicMetadata.setProjectID("default");
+//
+//        AdvancedInputDataHandling advancedInputDataHandling = new AdvancedInputDataHandling();
+//        AdvancedOutputDataHandling advancedOutputDataHandling = new AdvancedOutputDataHandling();
+//        ComputationalResourceScheduling computationalResourceScheduling = new ComputationalResourceScheduling();
+//        QualityOfServiceParams qualityOfServiceParams = new QualityOfServiceParams();
+//        ConfigurationData configurationData = new ConfigurationData();
+//
+//
+//        HashMap<String, String> exInputs = new HashMap<String, String>();
+//        exInputs.put("echo_input", "echo_output=hello");
+//
+//        configurationData.setExperimentInputs(exInputs);
+//        configurationData.setAdvanceInputDataHandling(advancedInputDataHandling);
+//        configurationData.setAdvanceOutputDataHandling(advancedOutputDataHandling);
+//        configurationData.setComputationalResourceScheduling(computationalResourceScheduling);
+//        configurationData.setQosParams(qualityOfServiceParams);
+//        configurationData.setApplicationId("Echo");
+//
+//        Registry registry = new RegistryImpl();
+//        experimentID = (String) registry.add(ParentDataType.EXPERIMENT, basicMetadata);
+//        registry.add(ChildDataType.EXPERIMENT_CONFIGURATION_DATA, configurationData, experimentID);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/airavata/blob/04a8b5ef/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java
b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java
index b33ee65..202de71 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGRAM.java
@@ -21,7 +21,6 @@
 package org.apache.airavata.orchestrator.core;
 
 import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.model.experiment.*;
 import org.apache.airavata.orchestrator.cpi.Orchestrator;
 import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
 import org.apache.airavata.persistance.registry.jpa.impl.RegistryImpl;
@@ -53,31 +52,31 @@ public class OrchestratorTestWithGRAM extends BaseOrchestratorTest {
 
     private void createJobRequestWithDocuments() throws Exception{
         //Using new airavata-api methods to store experiment metadata
-        BasicMetadata basicMetadata = new BasicMetadata();
-        basicMetadata.setExperimentName("test-trestles");
-        basicMetadata.setUserName("admin");
-        basicMetadata.setUserNameIsSet(true);
-        basicMetadata.setProjectID("default");
-
-        AdvancedInputDataHandling advancedInputDataHandling = new AdvancedInputDataHandling();
-        AdvancedOutputDataHandling advancedOutputDataHandling = new AdvancedOutputDataHandling();
-        ComputationalResourceScheduling computationalResourceScheduling = new ComputationalResourceScheduling();
-        QualityOfServiceParams qualityOfServiceParams = new QualityOfServiceParams();
-        ConfigurationData configurationData = new ConfigurationData();
-
-        HashMap<String, String> exInputs = new HashMap<String, String>();
-        exInputs.put("echo_input", "echo_output=hello");
-
-        configurationData.setExperimentInputs(exInputs);
-        configurationData.setAdvanceInputDataHandling(advancedInputDataHandling);
-        configurationData.setAdvanceOutputDataHandling(advancedOutputDataHandling);
-        configurationData.setComputationalResourceScheduling(computationalResourceScheduling);
-        configurationData.setQosParams(qualityOfServiceParams);
-        configurationData.setApplicationId("SimpleEcho1");
-
-        Registry registry = new RegistryImpl();
-        experimentID = (String) registry.add(ParentDataType.EXPERIMENT, basicMetadata);
-        registry.add(ChildDataType.EXPERIMENT_CONFIGURATION_DATA, configurationData, experimentID);
+//        BasicMetadata basicMetadata = new BasicMetadata();
+//        basicMetadata.setExperimentName("test-trestles");
+//        basicMetadata.setUserName("admin");
+//        basicMetadata.setUserNameIsSet(true);
+//        basicMetadata.setProjectID("default");
+//
+//        AdvancedInputDataHandling advancedInputDataHandling = new AdvancedInputDataHandling();
+//        AdvancedOutputDataHandling advancedOutputDataHandling = new AdvancedOutputDataHandling();
+//        ComputationalResourceScheduling computationalResourceScheduling = new ComputationalResourceScheduling();
+//        QualityOfServiceParams qualityOfServiceParams = new QualityOfServiceParams();
+//        ConfigurationData configurationData = new ConfigurationData();
+//
+//        HashMap<String, String> exInputs = new HashMap<String, String>();
+//        exInputs.put("echo_input", "echo_output=hello");
+//
+//        configurationData.setExperimentInputs(exInputs);
+//        configurationData.setAdvanceInputDataHandling(advancedInputDataHandling);
+//        configurationData.setAdvanceOutputDataHandling(advancedOutputDataHandling);
+//        configurationData.setComputationalResourceScheduling(computationalResourceScheduling);
+//        configurationData.setQosParams(qualityOfServiceParams);
+//        configurationData.setApplicationId("SimpleEcho1");
+//
+//        Registry registry = new RegistryImpl();
+//        experimentID = (String) registry.add(ParentDataType.EXPERIMENT, basicMetadata);
+//        registry.add(ChildDataType.EXPERIMENT_CONFIGURATION_DATA, configurationData, experimentID);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/airavata/blob/04a8b5ef/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGSISSH.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGSISSH.java
b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGSISSH.java
index 9d321f0..82f4f7b 100644
--- a/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGSISSH.java
+++ b/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/OrchestratorTestWithGSISSH.java
@@ -24,7 +24,6 @@ import junit.framework.Assert;
 
 import org.apache.airavata.client.api.AiravataAPI;
 import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.model.experiment.*;
 import org.apache.airavata.orchestrator.cpi.Orchestrator;
 import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
 import org.apache.airavata.persistance.registry.jpa.impl.RegistryImpl;
@@ -55,31 +54,31 @@ public class OrchestratorTestWithGSISSH extends BaseOrchestratorTest {
 
      private void createJobRequestWithDocuments() throws Exception{
          //Using new airavata-api methods to store experiment metadata
-         BasicMetadata basicMetadata = new BasicMetadata();
-         basicMetadata.setExperimentName("test-trestles-gsissh");
-         basicMetadata.setUserName("admin");
-         basicMetadata.setUserNameIsSet(true);
-         basicMetadata.setProjectID("default");
-
-         AdvancedInputDataHandling advancedInputDataHandling = new AdvancedInputDataHandling();
-         AdvancedOutputDataHandling advancedOutputDataHandling = new AdvancedOutputDataHandling();
-         ComputationalResourceScheduling computationalResourceScheduling = new ComputationalResourceScheduling();
-         QualityOfServiceParams qualityOfServiceParams = new QualityOfServiceParams();
-         ConfigurationData configurationData = new ConfigurationData();
-
-         HashMap<String, String> exInputs = new HashMap<String, String>();
-         exInputs.put("echo_input", "echo_output=hello");
-
-         configurationData.setExperimentInputs(exInputs);
-         configurationData.setAdvanceInputDataHandling(advancedInputDataHandling);
-         configurationData.setAdvanceOutputDataHandling(advancedOutputDataHandling);
-         configurationData.setComputationalResourceScheduling(computationalResourceScheduling);
-         configurationData.setQosParams(qualityOfServiceParams);
-         configurationData.setApplicationId("SimpleEcho2");
-
-         Registry registry = new RegistryImpl();
-         experimentID = (String) registry.add(ParentDataType.EXPERIMENT, basicMetadata);
-         registry.add(ChildDataType.EXPERIMENT_CONFIGURATION_DATA, configurationData, experimentID);
+//         BasicMetadata basicMetadata = new BasicMetadata();
+//         basicMetadata.setExperimentName("test-trestles-gsissh");
+//         basicMetadata.setUserName("admin");
+//         basicMetadata.setUserNameIsSet(true);
+//         basicMetadata.setProjectID("default");
+//
+//         AdvancedInputDataHandling advancedInputDataHandling = new AdvancedInputDataHandling();
+//         AdvancedOutputDataHandling advancedOutputDataHandling = new AdvancedOutputDataHandling();
+//         ComputationalResourceScheduling computationalResourceScheduling = new ComputationalResourceScheduling();
+//         QualityOfServiceParams qualityOfServiceParams = new QualityOfServiceParams();
+//         ConfigurationData configurationData = new ConfigurationData();
+//
+//         HashMap<String, String> exInputs = new HashMap<String, String>();
+//         exInputs.put("echo_input", "echo_output=hello");
+//
+//         configurationData.setExperimentInputs(exInputs);
+//         configurationData.setAdvanceInputDataHandling(advancedInputDataHandling);
+//         configurationData.setAdvanceOutputDataHandling(advancedOutputDataHandling);
+//         configurationData.setComputationalResourceScheduling(computationalResourceScheduling);
+//         configurationData.setQosParams(qualityOfServiceParams);
+//         configurationData.setApplicationId("SimpleEcho2");
+//
+//         Registry registry = new RegistryImpl();
+//         experimentID = (String) registry.add(ParentDataType.EXPERIMENT, basicMetadata);
+//         registry.add(ChildDataType.EXPERIMENT_CONFIGURATION_DATA, configurationData, experimentID);
      }
 
      @Test

http://git-wip-us.apache.org/repos/asf/airavata/blob/04a8b5ef/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
index 4c4dd20..0bc8fad 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
@@ -86,9 +86,9 @@ public class ResourceUtils {
             GatewayResource gatewayResource = new GatewayResource();
             gatewayResource.setGatewayName(gatewayName);
             return gatewayResource;
+        }else {
+            return getGateway(gatewayName);
         }
-        return null;
-
     }
 
     public static UserResource createUser(String username, String password){
@@ -97,8 +97,9 @@ public class ResourceUtils {
             userResource.setUserName(username);
             userResource.setPassword(password);
             return userResource;
+        }else {
+            return (UserResource)getUser(username);
         }
-        return null;
 
     }
 


Mime
View raw message