Search in sources :

Example 26 with Services

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

the class TestCoordELExtensions method setUp.

@Override
protected void setUp() throws Exception {
    setSystemProperty("oozie.test.config.file", new File(OOZIE_SRC_DIR, "core/src/test/resources/oozie-site-coordel.xml").getAbsolutePath());
    super.setUp();
    services = new Services();
    setClassesToBeExcluded(services.getConf(), excludedServices);
    services.init();
}
Also used : Services(org.apache.oozie.service.Services) File(java.io.File)

Example 27 with Services

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

the class TestCoordJobsXCommand method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    services = new Services();
    services.init();
    LocalOozie.start();
}
Also used : Services(org.apache.oozie.service.Services)

Example 28 with Services

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

the class TestCoordKillXCommand method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    services = new Services();
    setClassesToBeExcluded(services.getConf(), excludedServices);
    services.init();
}
Also used : Services(org.apache.oozie.service.Services)

Example 29 with Services

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

the class TestCoordMaterializeTransitionXCommand method testActionMaterForHcatalogIncorrectURI.

public void testActionMaterForHcatalogIncorrectURI() throws Exception {
    Services.get().destroy();
    Services services = super.setupServicesForHCatalog();
    services.init();
    Date startTime = DateUtils.parseDateOozieTZ("2009-03-06T010:00Z");
    Date endTime = DateUtils.parseDateOozieTZ("2009-03-11T10:00Z");
    CoordinatorJobBean job = addRecordToCoordJobTableForWaiting("coord-job-for-matd-neg-hcat.xml", CoordinatorJob.Status.RUNNING, startTime, endTime, false, false, 0);
    try {
        new CoordMaterializeTransitionXCommand(job.getId(), hoursToSeconds(1)).call();
        fail("Expected Command exception but didn't catch any");
    } catch (CommandException e) {
        e.printStackTrace();
        job = services.get(JPAService.class).execute(new CoordJobGetJPAExecutor(job.getId()));
        assertEquals(CoordinatorJob.Status.FAILED, job.getStatus());
        assertEquals(ErrorCode.E1012, e.getErrorCode());
    } catch (Exception e) {
        fail("Unexpected exception " + e.getMessage());
    }
}
Also used : Services(org.apache.oozie.service.Services) CoordinatorJobBean(org.apache.oozie.CoordinatorJobBean) CoordJobGetJPAExecutor(org.apache.oozie.executor.jpa.CoordJobGetJPAExecutor) CommandException(org.apache.oozie.command.CommandException) JPAService(org.apache.oozie.service.JPAService) Date(java.util.Date) JPAExecutorException(org.apache.oozie.executor.jpa.JPAExecutorException) ParseException(java.text.ParseException) CommandException(org.apache.oozie.command.CommandException)

Example 30 with Services

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

the class TestCoordMaterializeTransitionXCommand method testActionMaterForHcatalog.

public void testActionMaterForHcatalog() throws Exception {
    Services.get().destroy();
    Services services = super.setupServicesForHCatalog();
    services.init();
    Date startTime = DateUtils.parseDateOozieTZ("2009-03-06T010:00Z");
    Date endTime = DateUtils.parseDateOozieTZ("2009-03-11T10:00Z");
    CoordinatorJobBean job = addRecordToCoordJobTableForWaiting("coord-job-for-matd-hcat.xml", CoordinatorJob.Status.RUNNING, startTime, endTime, false, false, 0);
    new CoordMaterializeTransitionXCommand(job.getId(), hoursToSeconds(1)).call();
    CoordinatorActionBean actionBean = getCoordAction(job.getId() + "@1");
    assertEquals("file://dummyhdfs/2009/05/_SUCCESS" + CoordCommandUtils.RESOLVED_UNRESOLVED_SEPARATOR + "${coord:latestRange(-1,0)}", actionBean.getMissingDependencies());
    assertEquals("hcat://dummyhcat:1000/db1/table1/ds=2009-12" + CoordELFunctions.INSTANCE_SEPARATOR + "hcat://dummyhcat:1000/db3/table3/ds=2009-05" + CoordELFunctions.INSTANCE_SEPARATOR + "hcat://dummyhcat:1000/db3/table3/ds=2009-26", actionBean.getPushMissingDependencies());
}
Also used : Services(org.apache.oozie.service.Services) CoordinatorJobBean(org.apache.oozie.CoordinatorJobBean) CoordinatorActionBean(org.apache.oozie.CoordinatorActionBean) Date(java.util.Date)

Aggregations

Services (org.apache.oozie.service.Services)247 JPAService (org.apache.oozie.service.JPAService)32 Configuration (org.apache.hadoop.conf.Configuration)21 Date (java.util.Date)17 CoordinatorJobBean (org.apache.oozie.CoordinatorJobBean)16 File (java.io.File)14 Before (org.junit.Before)14 XConfiguration (org.apache.oozie.util.XConfiguration)11 Path (org.apache.hadoop.fs.Path)10 ActionExecutorException (org.apache.oozie.action.ActionExecutorException)10 CoordinatorActionBean (org.apache.oozie.CoordinatorActionBean)8 EmbeddedServletContainer (org.apache.oozie.test.EmbeddedServletContainer)8 FileOutputStream (java.io.FileOutputStream)7 InputStream (java.io.InputStream)7 HashMap (java.util.HashMap)7 IOException (java.io.IOException)6 Properties (java.util.Properties)6 ActionService (org.apache.oozie.service.ActionService)6 StringWriter (java.io.StringWriter)5 WorkflowActionBean (org.apache.oozie.WorkflowActionBean)5