Search in sources :

Example 41 with WorkflowException

use of org.apache.oozie.workflow.WorkflowException in project oozie by apache.

the class TestLiteWorkflowLib method testLoopFork.

public void testLoopFork() throws WorkflowException {
    LiteWorkflowApp def = new LiteWorkflowApp("wf", "<worklfow-app/>", new StartNodeDef(TestControlNodeHandler.class, "one")).addNode(new NodeDef("one", null, SynchNodeHandler.class, Arrays.asList(new String[] { "f" }))).addNode(new ForkNodeDef("f", TestControlNodeHandler.class, Arrays.asList(new String[] { "two", "three" }))).addNode(new NodeDef("two", null, SynchNodeHandler.class, Arrays.asList(new String[] { "j" }))).addNode(new NodeDef("three", null, SynchNodeHandler.class, Arrays.asList(new String[] { "j" }))).addNode(new JoinNodeDef("j", TestControlNodeHandler.class, "four")).addNode(new NodeDef("four", null, SynchNodeHandler.class, Arrays.asList(new String[] { "f" }))).addNode(new EndNodeDef("end", TestControlNodeHandler.class));
    LiteWorkflowInstance job = new LiteWorkflowInstance(def, new XConfiguration(), "1");
    try {
        job.start();
        fail();
    } catch (WorkflowException ex) {
        assertEquals(ErrorCode.E0709, ex.getErrorCode());
    }
    assertEquals(WorkflowInstance.Status.FAILED, job.getStatus());
}
Also used : XConfiguration(org.apache.oozie.util.XConfiguration) WorkflowException(org.apache.oozie.workflow.WorkflowException)

Aggregations

WorkflowException (org.apache.oozie.workflow.WorkflowException)41 XConfiguration (org.apache.oozie.util.XConfiguration)23 IOException (java.io.IOException)15 Configuration (org.apache.hadoop.conf.Configuration)15 CommandException (org.apache.oozie.command.CommandException)8 Date (java.util.Date)7 WorkflowInstance (org.apache.oozie.workflow.WorkflowInstance)7 Element (org.jdom.Element)7 ArrayList (java.util.ArrayList)6 JPAExecutorException (org.apache.oozie.executor.jpa.JPAExecutorException)6 JDOMException (org.jdom.JDOMException)6 WorkflowActionBean (org.apache.oozie.WorkflowActionBean)5 WorkflowJobQuery (org.apache.oozie.executor.jpa.WorkflowJobQueryExecutor.WorkflowJobQuery)5 File (java.io.File)4 Reader (java.io.Reader)4 URI (java.net.URI)4 FileSystem (org.apache.hadoop.fs.FileSystem)4 Path (org.apache.hadoop.fs.Path)4 WorkflowJobBean (org.apache.oozie.WorkflowJobBean)4 WorkflowApp (org.apache.oozie.workflow.WorkflowApp)4