airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1558148 - in /airavata/trunk/modules/orchestrator/orchestrator-core/src: main/java/org/apache/airavata/orchestrator/core/PullBasedOrchestrator.java test/java/org/apache/airavata/orchestrator/core/PullBasedOrchestratorTest.java
Date Tue, 14 Jan 2014 18:26:24 GMT
Author: lahiru
Date: Tue Jan 14 18:26:24 2014
New Revision: 1558148

URL: http://svn.apache.org/r1558148
Log:
making noUserId test work.

Modified:
    airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/PullBasedOrchestrator.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/PullBasedOrchestrator.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/PullBasedOrchestrator.java?rev=1558148&r1=1558147&r2=1558148&view=diff
==============================================================================
--- airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/PullBasedOrchestrator.java
(original)
+++ airavata/trunk/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/PullBasedOrchestrator.java
Tue Jan 14 18:26:24 2014
@@ -133,6 +133,9 @@ public class PullBasedOrchestrator imple
         //todo use a consistent method to create the experiment ID
         String experimentID = request.getUserExperimentID();
         String orchestratorID = UUID.randomUUID().toString();
+        if(experimentID == null){
+            experimentID = orchestratorID;
+        }
         String username = request.getUserName();
         try {
             airavataRegistry.storeExperiment(username, experimentID, orchestratorID);
@@ -150,13 +153,9 @@ public class PullBasedOrchestrator imple
             logger.error("Invalid Job request sent, Experiment creation failed");
             return false;
         }
-        String experimentID = null;
+        String experimentID = OrchestratorUtils.getUniqueID(request);
         // we give higher priority to userExperimentID
-        if (request.getUserExperimentID() != null) {
-            experimentID = request.getUserExperimentID();
-        } else if (request.getSystemExperimentID() != null) {
-            experimentID = request.getSystemExperimentID();
-        } else {
+        if(experimentID == null) {
             logger.error("Invalid Experiment ID given: " + request.getUserName());
             return false;
         }

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=1558148&r1=1558147&r2=1558148&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 18:26:24 2014
@@ -51,25 +51,25 @@ public class PullBasedOrchestratorTest e
         orchestrator.initialize();
     }
 
-//    @Test
-//    public void noUserIDTest() throws Exception {
-//        ExperimentRequest experimentRequest = new ExperimentRequest();
-//        //experimentRequest.setUserExperimentID("test-" + UUID.randomUUID().toString());
-//        experimentRequest.setUserName("orchestrator");
-//
-//        String systemExpID = orchestrator.createExperiment(experimentRequest);
-//
-//        JobRequest jobRequest = createJobRequest(systemExpID);
-//
-//        boolean b = orchestrator.launchExperiment(jobRequest);
-//
-//        if(b){
-//            // This means orchestrator successfully accepted the job
-//            Assert.assertTrue(true);
-//        }else {
-//            Assert.assertFalse(true);
-//        }
-//    }
+    @Test
+    public void noUserIDTest() throws Exception {
+        ExperimentRequest experimentRequest = new ExperimentRequest();
+        //experimentRequest.setUserExperimentID("test-" + UUID.randomUUID().toString());
+        experimentRequest.setUserName("orchestrator");
+
+        String systemExpID = orchestrator.createExperiment(experimentRequest);
+
+        JobRequest jobRequest = createJobRequest(systemExpID);
+
+        boolean b = orchestrator.launchExperiment(jobRequest);
+
+        if(b){
+            // This means orchestrator successfully accepted the job
+            Assert.assertTrue(true);
+        }else {
+            Assert.assertFalse(true);
+        }
+    }
 
     @Test
     public void userIDTest() throws Exception {



Mime
View raw message