You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2014/01/14 20:01:00 UTC

svn commit: r1558168 - in /airavata/trunk/modules/orchestrator/orchestrator-core/src: main/java/org/apache/airavata/orchestrator/core/impl/ test/java/org/apache/airavata/orchestrator/core/

Author: lahiru
Date: Tue Jan 14 19:00:59 2014
New Revision: 1558168

URL: http://svn.apache.org/r1558168
Log:
fixing tets failures.

Modified:
    airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java
    airavata/trunk/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/AbstractOrchestratorTest.java
    airavata/trunk/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/PullBasedOrchestratorTest.java

Modified: airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java?rev=1558168&r1=1558167&r2=1558168&view=diff
==============================================================================
--- airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java (original)
+++ airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/EmbeddedGFACJobSubmitter.java Tue Jan 14 19:00:59 2014
@@ -67,16 +67,16 @@ public class EmbeddedGFACJobSubmitter im
     private OrchestratorContext orchestratorContext;
 
 
-    public void initialize(OrchestratorContext orchestratorContext)  throws OrchestratorException {
+    public void initialize(OrchestratorContext orchestratorContext) throws OrchestratorException {
         this.orchestratorContext = orchestratorContext;
     }
 
-    public GFACInstance selectGFACInstance()  throws OrchestratorException {
+    public GFACInstance selectGFACInstance() throws OrchestratorException {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
 
-    public boolean submitJob(GFACInstance gfac, List<String> experimentIDList)  throws OrchestratorException {
+    public boolean submitJob(GFACInstance gfac, List<String> experimentIDList) throws OrchestratorException {
 
         for (int i = 0; i < experimentIDList.size(); i++) {
             try {
@@ -123,8 +123,7 @@ public class EmbeddedGFACJobSubmitter im
         jobExecutionContext.setInMessageContext(new MessageContext(jobRequest.getInputParameters()));
 
         jobExecutionContext.setProperty(Constants.PROP_TOPIC, experimentID);
-        jobExecutionContext.setProperty(Constants.PROP_BROKER_URL, orchestratorContext.getOrchestratorConfiguration().getBrokerURL().toString());
-
+        jobExecutionContext.setExperimentID(experimentID);
         GFacAPI gfacAPI1 = new GFacAPI();
         gfacAPI1.submitJob(jobExecutionContext);
     }
@@ -133,8 +132,9 @@ public class EmbeddedGFACJobSubmitter im
         try {
             launchGfacWithJobRequest(request);
         } catch (Exception e) {
-            logger.error("Error launching the job : " + OrchestratorUtils.getUniqueID(request));
-
+            String error = "Error launching the job : " + OrchestratorUtils.getUniqueID(request);
+            logger.error(error);
+            throw new OrchestratorException(error);
         }
         return true;
     }

Modified: airavata/trunk/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/AbstractOrchestratorTest.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/AbstractOrchestratorTest.java?rev=1558168&r1=1558167&r2=1558168&view=diff
==============================================================================
--- airavata/trunk/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/AbstractOrchestratorTest.java (original)
+++ airavata/trunk/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/AbstractOrchestratorTest.java Tue Jan 14 19:00:59 2014
@@ -23,12 +23,10 @@ package org.apache.airavata.orchestrator
 import junit.framework.TestCase;
 
 import org.apache.airavata.orchestrator.core.util.Initialize;
+import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
-import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;
-import org.apache.airavata.persistance.registry.jpa.resources.OrchestratorDataResource;
-import org.apache.airavata.persistance.registry.jpa.resources.UserResource;
-import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource;
+import org.apache.airavata.persistance.registry.jpa.resources.*;
 
 public class AbstractOrchestratorTest extends TestCase {
 

Modified: airavata/trunk/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/PullBasedOrchestratorTest.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/PullBasedOrchestratorTest.java?rev=1558168&r1=1558167&r2=1558168&view=diff
==============================================================================
--- airavata/trunk/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/PullBasedOrchestratorTest.java (original)
+++ airavata/trunk/modules/orchestrator/orchestrator-core/src/test/java/org/apache/airavata/orchestrator/core/PullBasedOrchestratorTest.java Tue Jan 14 19:00:59 2014
@@ -23,6 +23,7 @@ package org.apache.airavata.orchestrator
 import junit.framework.Assert;
 import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.ExecutionMode;
+import org.apache.airavata.commons.gfac.type.ActualParameter;
 import org.apache.airavata.commons.gfac.type.ApplicationDescription;
 import org.apache.airavata.commons.gfac.type.HostDescription;
 import org.apache.airavata.commons.gfac.type.ServiceDescription;
@@ -137,7 +138,9 @@ public class PullBasedOrchestratorTest e
         //creating input Map
 
         HashMap<String, Object> inputData = new HashMap<String, Object>();
-        inputData.put("echo_input", "Hello World");
+        ActualParameter echo_input = new ActualParameter();
+        ((StringParameterType) echo_input.getType()).setValue("echo_output=hello");
+        inputData.put("echo_input", echo_input);
 
         HashMap<String, Object> outputData = new HashMap<String, Object>();
 
@@ -147,6 +150,8 @@ public class PullBasedOrchestratorTest e
         jobRequest.setHostDescription(descriptor);
         jobRequest.setServiceDescription(serviceDescription);
         jobRequest.setApplicationDescription(applicationDeploymentDescription);
+        jobRequest.setInputParameters(inputData);
+        jobRequest.setOutputParameters(outputData);
         return jobRequest;
     }