コード例 #1
0
  @Test
  public void testGetWorkflowInstanceMetadata2() throws Exception {
    WorkflowInstance wf = (WorkflowInstance) fmc.getFirstPage().getPageWorkflows().get(0);

    assertThat(wf, is(not(Matchers.nullValue())));

    Metadata meta = fmc.getWorkflowInstanceMetadata(wf.getId());

    assertNotNull(meta);
  }
コード例 #2
0
  @Test
  public void testGetWorkflowById() throws RepositoryException, XmlRpcException, IOException {
    List<Workflow> workflowlist = fmc.getWorkflows();

    assertThat(workflowlist, is(not(nullValue())));

    assertThat(workflowlist.size(), is(not(0)));

    Workflow work = fmc.getWorkflowById(workflowlist.get(0).getId());

    assertThat(work, is(not(nullValue())));
  }
コード例 #3
0
  @Test
  public void testGetWorkflowCurrentTaskWallClockMinutes() throws Exception {
    XmlRpcWorkflowManagerClient fmc =
        new XmlRpcWorkflowManagerClient(new URL("http://localhost:" + WM_PORT));

    List<WorkflowInstance> wfinstances = fmc.getWorkflowInstances();

    assertNotNull(wfinstances);

    double clock = fmc.getWorkflowCurrentTaskWallClockMinutes(wfinstances.get(0).getId());

    assertThat(clock, is(not(Matchers.nullValue())));
  }
コード例 #4
0
  @Test
  public void testGetWorkflowInstanceById()
      throws XmlRpcException, IOException, RepositoryException {

    List<WorkflowInstance> workflowlist = fmc.getWorkflowInstances();

    assertThat(workflowlist, is(not(nullValue())));

    assertThat(workflowlist.size(), is(not(0)));

    WorkflowInstance instance = fmc.getWorkflowInstanceById(workflowlist.get(0).getId());

    assertThat(instance, is(not(nullValue())));
  }
コード例 #5
0
  private static void startWorkflow() {
    XmlRpcWorkflowManagerClient client = null;
    try {
      client = new XmlRpcWorkflowManagerClient(new URL("http://localhost:" + WM_PORT));
    } catch (Exception e) {
      fail(e.getMessage());
    }

    try {
      client.sendEvent("long", new Metadata());
    } catch (Exception e) {
      LOG.log(Level.SEVERE, e.getMessage());
      throw new RuntimeException(e);
    }
  }
コード例 #6
0
  @Test
  public void testGetNumWorkflowInstancesByStatus() throws Exception {

    int inst = fmc.getNumWorkflowInstancesByStatus("QUEUED");

    assertThat(inst, equalTo(0));
  }
コード例 #7
0
  @Test
  public void testGetWorkflowInstances() throws IOException, XmlRpcException {

    List<WorkflowInstance> wfinstances = fmc.getWorkflowInstances();

    assertNotNull(wfinstances);
  }
コード例 #8
0
  @Test
  public void testGetWorkflowInstancesByStatus() throws Exception {

    List<WorkflowInstance> wflows = fmc.getWorkflowInstancesByStatus("QUEUED");

    assertNotNull(wflows);
  }
コード例 #9
0
  @Test
  public void testPaginateWorkflowInstancesByStatus() throws XmlRpcException, IOException {

    WorkflowInstancePage paginate = fmc.paginateWorkflowInstances(2, "QUEUED");

    assertThat(paginate, is(not(nullValue())));
  }
コード例 #10
0
  @Test
  public void testGetNumWorkflowInstances() throws Exception {

    int num = fmc.getNumWorkflowInstances();

    assertThat(num, is(not(0)));
  }
コード例 #11
0
  @Ignore
  @Test
  public void testRefreshRepository() throws XmlRpcException, IOException {

    boolean refresh = fmc.refreshRepository();

    assertThat(refresh, equalTo(true));
  }
コード例 #12
0
  @Test
  public void testGetConditionById() throws Exception {

    WorkflowCondition cond = fmc.getConditionById("urn:oodt:TrueCondition");

    assertNotNull(cond);

    assertThat(cond.getConditionName(), equalTo("True Condition"));
  }
コード例 #13
0
  @Test
  public void testUpdateWorkflowInstanceStatus()
      throws XmlRpcException, IOException, RepositoryException {

    List<WorkflowInstance> workflowlist = fmc.getWorkflowInstances();

    assertThat(workflowlist, is(not(nullValue())));

    assertThat(workflowlist.size(), is(not(0)));

    WorkflowInstance instance = fmc.getWorkflowInstanceById(workflowlist.get(0).getId());

    assertThat(instance, is(not(nullValue())));

    boolean upd = fmc.updateWorkflowInstanceStatus(instance.getId(), "RUNNING");

    assertThat(upd, equalTo(true));
  }
コード例 #14
0
  @Test
  public void testGetTaskById() throws Exception {

    WorkflowTask task = fmc.getTaskById("urn:oodt:HelloWorld");

    assertThat(task, is(not(nullValue())));

    assertThat(task.getTaskName(), equalTo("Hello World"));
  }
コード例 #15
0
  @Test
  public void testGetWFMUrl() {

    URL url = fmc.getWorkflowManagerUrl();

    assertThat(url, is(not(nullValue())));

    assertThat(url.toString(), equalTo("http://localhost:" + WM_PORT));
  }
コード例 #16
0
  @Test
  public void testGetWorkflowInstanceMetadataActuallyUsingTheXmlRpcWorkflowManagerClient()
      throws IOException, RepositoryException, XmlRpcException {

    List<Workflow> workflows = fmc.getWorkflows();
    assertThat(workflows, is(not(empty())));

    assertNotNull(workflows.get(0).getName());
  }
コード例 #17
0
  @Ignore
  @Test
  public void testGetNullWorkflowInstances()
      throws RepositoryException, XmlRpcException, IOException, InterruptedException {

    Thread.sleep(3000);
    WorkflowInstance instance = fmc.getWorkflowInstanceById("1234");

    assertThat(instance, is(nullValue()));
  }
コード例 #18
0
  @Test
  public void testGetPages() throws Exception {

    Thread.sleep(3000);
    WorkflowInstancePage page = fmc.getFirstPage();

    assertNotNull(page);

    WorkflowInstancePage lastpage = fmc.getLastPage();

    assertNotNull(lastpage);

    WorkflowInstancePage nextpage = fmc.getNextPage(page);

    assertNotNull(nextpage);

    WorkflowInstancePage prevpage = fmc.getPrevPage(nextpage);

    assertNotNull(prevpage);
  }
コード例 #19
0
  @Test
  public void testGetWorkflowsByEvent() throws Exception {

    List<Workflow> wflows = fmc.getWorkflowsByEvent("long");

    assertNotNull(wflows);

    assertThat(wflows, hasSize(2));

    assertThat(wflows.get(0).getName(), equalTo("Long Workflow"));
  }
コード例 #20
0
  @Test
  public void testGetRegisteredEvents() throws Exception {

    List<String> events = fmc.getRegisteredEvents();

    assertThat(events, is(not(nullValue())));

    assertThat(events, hasSize(12));

    assertThat(events, hasItem("stuck"));
  }
コード例 #21
0
  @Test
  public void testGetNullWorkflowInstancesByStatus() throws XmlRpcException, IOException {
    List<WorkflowInstance> instances = fmc.getWorkflowInstancesByStatus("NULL");

    assertThat(instances, is(empty()));
  }