This is an automated email from the ASF dual-hosted git repository.
imesha pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/oodt.git
The following commit(s) were added to refs/heads/master by this push:
new efff498 [OODT-1029] Fixed
TestAvroRpcWorkflowManager.testGetWorkflowInstances() test failure
efff498 is described below
commit efff498d3145ae598d8a5190cb29015256c47788
Author: imesha <[email protected]>
AuthorDate: Mon Sep 30 13:10:46 2019 +0530
[OODT-1029] Fixed TestAvroRpcWorkflowManager.testGetWorkflowInstances()
test failure
---
.../cas/workflow/system/TestAvroRpcWorkflowManager.java | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git
a/workflow/src/test/java/org/apache/oodt/cas/workflow/system/TestAvroRpcWorkflowManager.java
b/workflow/src/test/java/org/apache/oodt/cas/workflow/system/TestAvroRpcWorkflowManager.java
index 543c9a7..b09c50e 100644
---
a/workflow/src/test/java/org/apache/oodt/cas/workflow/system/TestAvroRpcWorkflowManager.java
+++
b/workflow/src/test/java/org/apache/oodt/cas/workflow/system/TestAvroRpcWorkflowManager.java
@@ -25,9 +25,6 @@ import org.junit.Before;
import org.junit.Test;
import junit.framework.TestCase;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
import java.io.File;
import java.io.FileInputStream;
@@ -48,7 +45,11 @@ public class TestAvroRpcWorkflowManager extends TestCase{
private static final Logger LOG = Logger
.getLogger(TestXmlRpcWorkflowManager.class.getName());
-
+
+ /**
+ * {@link #startWorkflow()} fires an event of type "long". This event is
associated with 2 instances of "LongWorkflow". Therefore, we should check if the
+ * number of workflow instances are 2 when asserting.
+ */
@Test
public void testGetWorkflowInstances() {
@@ -67,7 +68,7 @@ public class TestAvroRpcWorkflowManager extends TestCase{
assertNotNull(workflowInsts);
- assertEquals(1, workflowInsts.size());
+ assertEquals(2, workflowInsts.size());
}
@Before
@@ -84,7 +85,10 @@ public class TestAvroRpcWorkflowManager extends TestCase{
private void startWorkflow() {
try (WorkflowManagerClient client =
new AvroRpcWorkflowManagerClient(new
URL("http://localhost:" + WM_PORT))) {
- client.sendEvent("long", new Metadata());
+ Metadata metadata = new Metadata();
+ // Hold the task for 20 seconds at least
+ metadata.addMetadata("numSeconds", String.valueOf(20));
+ client.sendEvent("long", metadata);
} catch (Exception e) {
fail(e.getMessage());
}