Search in sources :

Example 1 with WorkflowStoreService

use of org.apache.oozie.service.WorkflowStoreService in project oozie by apache.

the class TestLiteWorkflowStoreService method testCreateStore.

public void testCreateStore() throws Exception {
    WorkflowStoreService wls = Services.get().get(WorkflowStoreService.class);
    assertNotNull(wls);
    assertNotNull(wls.create());
}
Also used : WorkflowStoreService(org.apache.oozie.service.WorkflowStoreService)

Example 2 with WorkflowStoreService

use of org.apache.oozie.service.WorkflowStoreService in project oozie by apache.

the class TestSubmitXCommand method testSubmitAppName.

public void testSubmitAppName() throws Exception {
    Configuration conf = new XConfiguration();
    String workflowUri = getTestCaseFileUri("workflow.xml");
    String appXml = "<workflow-app xmlns='uri:oozie:workflow:0.1' name='${appName}-foo'> " + "<start to='end' /> " + "<end name='end' /> " + "</workflow-app>";
    writeToFile(appXml, workflowUri);
    conf.set(OozieClient.APP_PATH, workflowUri);
    conf.set(OozieClient.USER_NAME, getTestUser());
    conf.set("appName", "var-app-name");
    SubmitXCommand sc = new SubmitXCommand(conf);
    String jobId = sc.call();
    WorkflowStoreService wss = Services.get().get(WorkflowStoreService.class);
    WorkflowStore ws = wss.create();
    WorkflowJobBean wfb = ws.getWorkflow(jobId, false);
    assertEquals("var-app-name-foo", wfb.getAppName());
}
Also used : XConfiguration(org.apache.oozie.util.XConfiguration) XConfiguration(org.apache.oozie.util.XConfiguration) Configuration(org.apache.hadoop.conf.Configuration) WorkflowStoreService(org.apache.oozie.service.WorkflowStoreService) WorkflowStore(org.apache.oozie.store.WorkflowStore) WorkflowJobBean(org.apache.oozie.WorkflowJobBean)

Aggregations

WorkflowStoreService (org.apache.oozie.service.WorkflowStoreService)2 Configuration (org.apache.hadoop.conf.Configuration)1 WorkflowJobBean (org.apache.oozie.WorkflowJobBean)1 WorkflowStore (org.apache.oozie.store.WorkflowStore)1 XConfiguration (org.apache.oozie.util.XConfiguration)1