You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by ma...@apache.org on 2011/08/12 03:17:21 UTC

svn commit: r1156930 - in /oodt/trunk/workflow/src: main/java/org/apache/oodt/cas/workflow/repository/ test/org/apache/oodt/cas/workflow/repository/

Author: mattmann
Date: Fri Aug 12 01:17:21 2011
New Revision: 1156930

URL: http://svn.apache.org/viewvc?rev=1156930&view=rev
Log:
- fix for OODT-208 WorkflowConditions should be identifiable as optional or required: improve unit test coverage

Modified:
    oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepository.java
    oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/repository/TestPackagedWorkflowRepository.java
    oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/repository/TestWorkflowRepository.java

Modified: oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepository.java
URL: http://svn.apache.org/viewvc/oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepository.java?rev=1156930&r1=1156929&r2=1156930&view=diff
==============================================================================
--- oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepository.java (original)
+++ oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/repository/PackagedWorkflowRepository.java Fri Aug 12 01:17:21 2011
@@ -724,6 +724,7 @@ public class PackagedWorkflowRepository 
       this.timeout = Long.valueOf(graphElem.getAttribute("timeout") != null
           && !graphElem.getAttribute("timeout").equals("") ? graphElem
           .getAttribute("timeout") : "-1");
+      this.optional = Boolean.valueOf(graphElem.getAttribute("optional")); 
 
       NamedNodeMap attrMap = graphElem.getAttributes();
       for (int i = 0; i < attrMap.getLength(); i++) {

Modified: oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/repository/TestPackagedWorkflowRepository.java
URL: http://svn.apache.org/viewvc/oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/repository/TestPackagedWorkflowRepository.java?rev=1156930&r1=1156929&r2=1156930&view=diff
==============================================================================
--- oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/repository/TestPackagedWorkflowRepository.java (original)
+++ oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/repository/TestPackagedWorkflowRepository.java Fri Aug 12 01:17:21 2011
@@ -112,6 +112,23 @@ public class TestPackagedWorkflowReposit
     assertNotNull(cond);
     assertEquals(30L, cond.getTimeoutSeconds());
   }
+  
+  /**
+   * @since OODT-208
+   */
+  public void testGetOptional(){
+    WorkflowCondition cond = null;
+    try{
+      cond = this.repo.getWorkflowConditionById("urn:npp:MOA_ORBITS_FileBased");
+    }
+    catch(Exception e){
+      e.printStackTrace();
+      fail(e.getMessage());
+    }
+    
+    assertNotNull(cond);
+    assertEquals(true, cond.isOptional());   
+  }
 
   /*
    * (non-Javadoc)

Modified: oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/repository/TestWorkflowRepository.java
URL: http://svn.apache.org/viewvc/oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/repository/TestWorkflowRepository.java?rev=1156930&r1=1156929&r2=1156930&view=diff
==============================================================================
--- oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/repository/TestWorkflowRepository.java (original)
+++ oodt/trunk/workflow/src/test/org/apache/oodt/cas/workflow/repository/TestWorkflowRepository.java Fri Aug 12 01:17:21 2011
@@ -208,6 +208,22 @@ public class TestWorkflowRepository exte
       
       assertEquals(30L, cond.getTimeoutSeconds());
     }
+    
+    /**
+     * @since OODT-208
+     */
+    public void testGetConditionOptional(){
+      WorkflowCondition cond = null;
+      try{
+        cond = workflowRepository.getWorkflowConditionById("urn:oodt:OptionalCondition");
+      }
+      catch(Exception e){
+        e.printStackTrace();
+        fail(e.getMessage());
+      }
+      
+      assertEquals(true, cond.isOptional());
+    }    
 
     public void testGetConfigurationByTaskId() {
         WorkflowTaskConfiguration config = null;
@@ -345,6 +361,7 @@ public class TestWorkflowRepository exte
         assertEquals("True Condition", c.getConditionName());
         assertEquals(1, c.getOrder());
         assertEquals(-1L, c.getTimeoutSeconds());
+        assertEquals(false, c.isOptional());
     }
 
     private void validateTaskConfiguration(WorkflowTaskConfiguration config) {