You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by tu...@apache.org on 2012/08/14 01:21:17 UTC
svn commit: r1372663 [2/3] - in /incubator/oozie/trunk: ./
core/src/main/java/org/apache/oozie/
core/src/main/java/org/apache/oozie/command/bundle/
core/src/main/java/org/apache/oozie/command/coord/
core/src/main/java/org/apache/oozie/coord/ core/src/m...
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordChangeXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordChangeXCommand.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordChangeXCommand.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordChangeXCommand.java Mon Aug 13 23:21:15 2012
@@ -41,6 +41,17 @@ import org.apache.oozie.util.DateUtils;
public class TestCoordChangeXCommand extends XDataTestCase {
private Services services;
+ /**
+ * Return the UTC date and time in W3C format down to second
+ * (yyyy-MM-ddTHH:mmZ). i.e.: 1997-07-16T19:20Z The input date is a
+ * long (Unix Time Stamp)
+ *
+ * @return the formatted time string.
+ */
+ public static String convertDateToString(long timeStamp) {
+ return DateUtils.formatDateOozieTZ(new Date(timeStamp));
+ }
+
@Override
protected void setUp() throws Exception {
super.setUp();
@@ -76,12 +87,12 @@ public class TestCoordChangeXCommand ext
fail("Exception thrown " + ex);
}
- String pauseTime = DateUtils.convertDateToString(new Date().getTime() + 10 * 60 * 1000);
- String endTime = DateUtils.convertDateToString(new Date().getTime() + 20 * 60 * 1000);
+ String pauseTime = convertDateToString(new Date().getTime() + 10 * 60 * 1000);
+ String endTime = convertDateToString(new Date().getTime() + 20 * 60 * 1000);
new CoordChangeXCommand(jobId, "endtime=" + endTime + ";concurrency=200").call();
try {
- checkCoordJobs(jobId, DateUtils.parseDateUTC(endTime), 200, null, false);
+ checkCoordJobs(jobId, DateUtils.parseDateOozieTZ(endTime), 200, null, false);
}
catch (Exception ex) {
ex.printStackTrace();
@@ -91,7 +102,7 @@ public class TestCoordChangeXCommand ext
String changeValue = "endtime=" + endTime + ";concurrency=200;pausetime=" + pauseTime;
new CoordChangeXCommand(jobId, changeValue).call();
try {
- checkCoordJobs(jobId, DateUtils.parseDateUTC(endTime), 200, DateUtils.parseDateUTC(pauseTime), true);
+ checkCoordJobs(jobId, DateUtils.parseDateOozieTZ(endTime), 200, DateUtils.parseDateOozieTZ(pauseTime), true);
}
catch (Exception ex) {
ex.printStackTrace();
@@ -100,7 +111,7 @@ public class TestCoordChangeXCommand ext
new CoordChangeXCommand(jobId, "endtime=" + endTime + ";concurrency=200;pausetime=").call();
try {
- checkCoordJobs(jobId, DateUtils.parseDateUTC(endTime), 200, null, true);
+ checkCoordJobs(jobId, DateUtils.parseDateOozieTZ(endTime), 200, null, true);
}
catch (Exception ex) {
ex.printStackTrace();
@@ -109,7 +120,7 @@ public class TestCoordChangeXCommand ext
new CoordChangeXCommand(jobId, "endtime=" + endTime + ";pausetime=;concurrency=200").call();
try {
- checkCoordJobs(jobId, DateUtils.parseDateUTC(endTime), 200, null, true);
+ checkCoordJobs(jobId, DateUtils.parseDateOozieTZ(endTime), 200, null, true);
}
catch (Exception ex) {
ex.printStackTrace();
@@ -118,7 +129,7 @@ public class TestCoordChangeXCommand ext
new CoordChangeXCommand(jobId, "endtime=2012-12-20T05:00Z;concurrency=-200").call();
try {
- checkCoordJobs(jobId, DateUtils.parseDateUTC("2012-12-20T05:00Z"), -200, null, false);
+ checkCoordJobs(jobId, DateUtils.parseDateOozieTZ("2012-12-20T05:00Z"), -200, null, false);
}
catch (Exception ex) {
ex.printStackTrace();
@@ -127,7 +138,7 @@ public class TestCoordChangeXCommand ext
new CoordChangeXCommand(jobId, "endtime=2012-12-20T05:00Z").call();
try {
- checkCoordJobs(jobId, DateUtils.parseDateUTC("2012-12-20T05:00Z"), null, null, false);
+ checkCoordJobs(jobId, DateUtils.parseDateOozieTZ("2012-12-20T05:00Z"), null, null, false);
}
catch (Exception ex) {
ex.printStackTrace();
@@ -239,12 +250,13 @@ public class TestCoordChangeXCommand ext
final CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, startTime, endTime,
true, true, 0);
- String pauseTime = DateUtils.convertDateToString(startTime.getTime() + 10 * 60 * 1000);
- String newEndTime = DateUtils.convertDateToString(startTime.getTime() + 40 * 60 * 1000);
+ String pauseTime = convertDateToString(startTime.getTime() + 10 * 60 * 1000);
+ String newEndTime = convertDateToString(startTime.getTime() + 40 * 60 * 1000);
new CoordChangeXCommand(job.getId(), "endtime=" + newEndTime + ";pausetime=" + pauseTime).call();
try {
- checkCoordJobs(job.getId(), DateUtils.parseDateUTC(newEndTime), null, DateUtils.parseDateUTC(pauseTime),
+ checkCoordJobs(job.getId(), DateUtils.parseDateOozieTZ(newEndTime), null, DateUtils.parseDateOozieTZ(
+ pauseTime),
true);
}
catch (Exception ex) {
@@ -274,8 +286,8 @@ public class TestCoordChangeXCommand ext
final CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.FAILED, startTime, endTime,
true, true, 0);
- String pauseTime = DateUtils.convertDateToString(startTime.getTime() + 10 * 60 * 1000);
- String newEndTime = DateUtils.convertDateToString(startTime.getTime() + 40 * 60 * 1000);
+ String pauseTime = convertDateToString(startTime.getTime() + 10 * 60 * 1000);
+ String newEndTime = convertDateToString(startTime.getTime() + 40 * 60 * 1000);
new CoordChangeXCommand(job.getId(), "endtime=" + newEndTime + ";pausetime=" + pauseTime).call();
@@ -295,7 +307,7 @@ public class TestCoordChangeXCommand ext
Date start = new Date();
Date end = new Date(start.getTime() + (4 * 60 * 60 * 1000)); //4 hrs
Date pauseTime = new Date(start.getTime() + (2 * 60 * 60 * 1000)); //2 hrs
- String pauseTimeChangeStr = "pausetime=" + DateUtils.convertDateToString(pauseTime);
+ String pauseTimeChangeStr = "pausetime=" + DateUtils.formatDateOozieTZ(pauseTime);
final CoordinatorJobBean job = addRecordToCoordJobTableForPauseTimeTest(CoordinatorJob.Status.RUNNING, start,
end, end, true, false, 4);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.SUCCEEDED, "coord-action-get.xml", 0);
@@ -307,7 +319,7 @@ public class TestCoordChangeXCommand ext
JPAService jpaService = Services.get().get(JPAService.class);
CoordJobGetJPAExecutor coordGetCmd = new CoordJobGetJPAExecutor(job.getId());
CoordinatorJobBean coordJob = jpaService.execute(coordGetCmd);
- assertEquals(DateUtils.convertDateToString(coordJob.getPauseTime()), DateUtils.convertDateToString(pauseTime));
+ assertEquals(DateUtils.formatDateOozieTZ(coordJob.getPauseTime()), DateUtils.formatDateOozieTZ(pauseTime));
assertEquals(Job.Status.RUNNING, coordJob.getStatus());
assertEquals(2, coordJob.getLastActionNumber());
try {
@@ -335,7 +347,7 @@ public class TestCoordChangeXCommand ext
Date start = new Date();
Date end = new Date(start.getTime() + (4 * 60 * 60 * 1000)); //4 hrs
Date pauseTime = new Date(start.getTime() + (2 * 60 * 60 * 1000)); //2 hrs
- String pauseTimeChangeStr = "pausetime=" + DateUtils.convertDateToString(pauseTime);
+ String pauseTimeChangeStr = "pausetime=" + DateUtils.formatDateOozieTZ(pauseTime);
final CoordinatorJobBean job = addRecordToCoordJobTableForPauseTimeTest(CoordinatorJob.Status.RUNNING, start,
end, end, true, false, 4);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.SUCCEEDED, "coord-action-get.xml", 0);
@@ -383,7 +395,7 @@ public class TestCoordChangeXCommand ext
coordJob.setAppPath("testAppPath");
coordJob.setStatus(CoordinatorJob.Status.SUCCEEDED);
coordJob.setCreatedTime(new Date());
- coordJob.setLastModifiedTime(DateUtils.parseDateUTC("2009-01-02T23:59Z"));
+ coordJob.setLastModifiedTime(DateUtils.parseDateOozieTZ("2009-01-02T23:59Z"));
coordJob.setTimeZone("UTC");
coordJob.setTimeUnit(Timeunit.MINUTE);
coordJob.setUser("testUser");
@@ -436,9 +448,9 @@ public class TestCoordChangeXCommand ext
coordJob.setExecution(Execution.FIFO);
coordJob.setConcurrency(1);
try {
- coordJob.setStartTime(DateUtils.parseDateUTC("2009-02-01T01:00Z"));
- coordJob.setEndTime(DateUtils.parseDateUTC("2009-02-01T01:09Z"));
- coordJob.setLastActionTime(DateUtils.parseDateUTC("2009-02-01T01:10Z"));
+ coordJob.setStartTime(DateUtils.parseDateOozieTZ("2009-02-01T01:00Z"));
+ coordJob.setEndTime(DateUtils.parseDateOozieTZ("2009-02-01T01:09Z"));
+ coordJob.setLastActionTime(DateUtils.parseDateOozieTZ("2009-02-01T01:10Z"));
}
catch (Exception e) {
e.printStackTrace();
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordMaterializeTransitionXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordMaterializeTransitionXCommand.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordMaterializeTransitionXCommand.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordMaterializeTransitionXCommand.java Mon Aug 13 23:21:15 2012
@@ -58,26 +58,26 @@ public class TestCoordMaterializeTransit
}
public void testActionMater() throws Exception {
- Date startTime = DateUtils.parseDateUTC("2009-03-06T010:00Z");
- Date endTime = DateUtils.parseDateUTC("2009-03-11T10:00Z");
+ Date startTime = DateUtils.parseDateOozieTZ("2009-03-06T010:00Z");
+ Date endTime = DateUtils.parseDateOozieTZ("2009-03-11T10:00Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, startTime, endTime, false, false, 0);
new CoordMaterializeTransitionXCommand(job.getId(), 3600).call();
checkCoordAction(job.getId() + "@1");
}
public void testActionMaterWithPauseTime1() throws Exception {
- Date startTime = DateUtils.parseDateUTC("2009-03-06T10:00Z");
- Date endTime = DateUtils.parseDateUTC("2009-03-06T10:14Z");
- Date pauseTime = DateUtils.parseDateUTC("2009-03-06T10:04Z");
+ Date startTime = DateUtils.parseDateOozieTZ("2009-03-06T10:00Z");
+ Date endTime = DateUtils.parseDateOozieTZ("2009-03-06T10:14Z");
+ Date pauseTime = DateUtils.parseDateOozieTZ("2009-03-06T10:04Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, startTime, endTime, pauseTime);
new CoordMaterializeTransitionXCommand(job.getId(), 3600).call();
checkCoordActions(job.getId(), 1, null);
}
public void testActionMaterWithPauseTime2() throws Exception {
- Date startTime = DateUtils.parseDateUTC("2009-03-06T10:00Z");
- Date endTime = DateUtils.parseDateUTC("2009-03-06T10:14Z");
- Date pauseTime = DateUtils.parseDateUTC("2009-03-06T10:08Z");
+ Date startTime = DateUtils.parseDateOozieTZ("2009-03-06T10:00Z");
+ Date endTime = DateUtils.parseDateOozieTZ("2009-03-06T10:14Z");
+ Date pauseTime = DateUtils.parseDateOozieTZ("2009-03-06T10:08Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, startTime, endTime, pauseTime);
new CoordMaterializeTransitionXCommand(job.getId(), 3600).call();
checkCoordActions(job.getId(), 2, null);
@@ -89,9 +89,9 @@ public class TestCoordMaterializeTransit
* @throws Exception
*/
public void testActionMaterWithPauseTime3() throws Exception {
- Date startTime = DateUtils.parseDateUTC("2009-03-06T10:00Z");
- Date endTime = DateUtils.parseDateUTC("2009-03-06T10:14Z");
- Date pauseTime = DateUtils.parseDateUTC("2009-03-06T09:58Z");
+ Date startTime = DateUtils.parseDateOozieTZ("2009-03-06T10:00Z");
+ Date endTime = DateUtils.parseDateOozieTZ("2009-03-06T10:14Z");
+ Date pauseTime = DateUtils.parseDateOozieTZ("2009-03-06T09:58Z");
final CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, startTime, endTime, pauseTime);
new CoordMaterializeTransitionXCommand(job.getId(), 3600).call();
waitFor(1000*60, new Predicate() {
@@ -103,8 +103,8 @@ public class TestCoordMaterializeTransit
}
public void testTimeout() throws Exception {
- Date startTime = DateUtils.parseDateUTC("2009-03-06T10:00Z");
- Date endTime = DateUtils.parseDateUTC("2009-03-06T10:14Z");
+ Date startTime = DateUtils.parseDateOozieTZ("2009-03-06T10:00Z");
+ Date endTime = DateUtils.parseDateOozieTZ("2009-03-06T10:14Z");
Date pauseTime = null;
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, startTime, endTime,
pauseTime, 300);
@@ -113,16 +113,16 @@ public class TestCoordMaterializeTransit
}
public void testMatLookupCommand1() throws Exception {
- Date startTime = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date endTime = DateUtils.parseDateUTC("2009-02-03T23:59Z");
+ Date startTime = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date endTime = DateUtils.parseDateOozieTZ("2009-02-03T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.PREP, startTime, endTime, false, false, 0);
new CoordMaterializeTransitionXCommand(job.getId(), 3600).call();
checkCoordJobs(job.getId(), CoordinatorJob.Status.RUNNING);
}
public void testMatThrottle() throws Exception {
- Date startTime = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date endTime = DateUtils.parseDateUTC("2009-02-03T23:59Z");
+ Date startTime = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date endTime = DateUtils.parseDateOozieTZ("2009-02-03T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.PREP, startTime, endTime, false, false, 0);
new CoordMaterializeTransitionXCommand(job.getId(), 3600).call();
checkCoordWaiting(job.getId(), job.getMatThrottling());
@@ -134,8 +134,8 @@ public class TestCoordMaterializeTransit
* @throws Exception
*/
public void testMatLookupCommand2() throws Exception {
- Date startTime = DateUtils.parseDateUTC("2099-02-01T01:00Z");
- Date endTime = DateUtils.parseDateUTC("2099-02-03T23:59Z");
+ Date startTime = DateUtils.parseDateOozieTZ("2099-02-01T01:00Z");
+ Date endTime = DateUtils.parseDateOozieTZ("2099-02-03T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.PREP, startTime, endTime, false, false, 0);
new CoordMaterializeTransitionXCommand(job.getId(), 3600).call();
checkCoordJobs(job.getId(), CoordinatorJob.Status.PREP);
@@ -148,7 +148,7 @@ public class TestCoordMaterializeTransit
*/
public void testMatLookupCommand3() throws Exception {
Date startTime = DateUtils.toDate(new Timestamp(System.currentTimeMillis() + 180 * 1000));
- Date endTime = DateUtils.parseDateUTC("2099-02-03T23:59Z");
+ Date endTime = DateUtils.parseDateOozieTZ("2099-02-03T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.PREP, startTime, endTime, false, false, 0);
new CoordMaterializeTransitionXCommand(job.getId(), 3600).call();
checkCoordJobs(job.getId(), CoordinatorJob.Status.RUNNING);
@@ -161,7 +161,7 @@ public class TestCoordMaterializeTransit
*/
public void testMatLookupCommand4() throws Exception {
Date startTime = DateUtils.toDate(new Timestamp(System.currentTimeMillis() + 360 * 1000));
- Date endTime = DateUtils.parseDateUTC("2099-02-03T23:59Z");
+ Date endTime = DateUtils.parseDateOozieTZ("2099-02-03T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.PREP, startTime, endTime, false, false, 0);
new CoordMaterializeTransitionXCommand(job.getId(), 3600).call();
checkCoordJobs(job.getId(), CoordinatorJob.Status.PREP);
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordPurgeXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordPurgeXCommand.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordPurgeXCommand.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordPurgeXCommand.java Mon Aug 13 23:21:15 2012
@@ -208,7 +208,7 @@ public class TestCoordPurgeXCommand exte
@Override
protected CoordinatorJobBean addRecordToCoordJobTable(CoordinatorJob.Status status, boolean pending, boolean doneMatd) throws Exception {
CoordinatorJobBean coordJob = createCoordJob(status, pending, doneMatd);
- coordJob.setLastModifiedTime(DateUtils.parseDateUTC("2009-12-18T01:00Z"));
+ coordJob.setLastModifiedTime(DateUtils.parseDateOozieTZ("2009-12-18T01:00Z"));
try {
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordRerunXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordRerunXCommand.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordRerunXCommand.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordRerunXCommand.java Mon Aug 13 23:21:15 2012
@@ -18,7 +18,6 @@
package org.apache.oozie.command.coord;
import java.io.ByteArrayInputStream;
-import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
@@ -836,8 +835,8 @@ public class TestCoordRerunXCommand exte
setSystemProperty(StatusTransitService.CONF_BACKWARD_SUPPORT_FOR_COORD_STATUS, "true");
new Services().init();
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean coordJob = addRecordToCoordJobTable(CoordinatorJob.Status.SUCCEEDED, start, end, false,
true, 3);
@@ -884,8 +883,8 @@ public class TestCoordRerunXCommand exte
setSystemProperty(StatusTransitService.CONF_BACKWARD_SUPPORT_FOR_COORD_STATUS, "true");
new Services().init();
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean coordJob = addRecordToCoordJobTable(CoordinatorJob.Status.SUSPENDED, start, end, false,
true, 3);
@@ -933,8 +932,8 @@ public class TestCoordRerunXCommand exte
setSystemProperty(StatusTransitService.CONF_BACKWARD_SUPPORT_FOR_COORD_STATUS, "true");
new Services().init();
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean coordJob = addRecordToCoordJobTable(CoordinatorJob.Status.SUCCEEDED, start, end, false,
false, 3);
@@ -1021,8 +1020,8 @@ public class TestCoordRerunXCommand exte
coordJob.setExecution(Execution.FIFO);
coordJob.setConcurrency(1);
try {
- coordJob.setStartTime(DateUtils.parseDateUTC("2009-12-15T01:00Z"));
- coordJob.setEndTime(DateUtils.parseDateUTC("2009-12-17T01:00Z"));
+ coordJob.setStartTime(DateUtils.parseDateOozieTZ("2009-12-15T01:00Z"));
+ coordJob.setEndTime(DateUtils.parseDateOozieTZ("2009-12-17T01:00Z"));
}
catch (Exception e) {
e.printStackTrace();
@@ -1051,7 +1050,7 @@ public class TestCoordRerunXCommand exte
action.setId(actionId);
action.setActionNumber(actionNum);
try {
- action.setNominalTime(DateUtils.parseDateUTC(actionNomialTime));
+ action.setNominalTime(DateUtils.parseDateOozieTZ(actionNomialTime));
}
catch (Exception e) {
e.printStackTrace();
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestPurgeXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestPurgeXCommand.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestPurgeXCommand.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestPurgeXCommand.java Mon Aug 13 23:21:15 2012
@@ -26,7 +26,6 @@ import org.apache.oozie.WorkflowJobBean;
import org.apache.oozie.client.OozieClient;
import org.apache.oozie.client.WorkflowAction;
import org.apache.oozie.client.WorkflowJob;
-import org.apache.oozie.command.CommandException;
import org.apache.oozie.executor.jpa.JPAExecutorException;
import org.apache.oozie.executor.jpa.WorkflowActionGetJPAExecutor;
import org.apache.oozie.executor.jpa.WorkflowJobGetJPAExecutor;
@@ -247,8 +246,8 @@ public class TestPurgeXCommand extends X
conf.set(OozieClient.USER_NAME, getTestUser());
WorkflowJobBean wfBean = createWorkflow(app, conf, "auth", jobStatus, instanceStatus);
- wfBean.setStartTime(DateUtils.parseDateUTC("2015-12-18T01:00Z"));
- wfBean.setEndTime(DateUtils.parseDateUTC("2015-12-18T03:00Z"));
+ wfBean.setStartTime(DateUtils.parseDateOozieTZ("2015-12-18T01:00Z"));
+ wfBean.setEndTime(DateUtils.parseDateOozieTZ("2015-12-18T03:00Z"));
try {
JPAService jpaService = Services.get().get(JPAService.class);
@@ -286,8 +285,8 @@ public class TestPurgeXCommand extends X
workflow.setGroup(conf.get(OozieClient.GROUP_NAME));
workflow.setAuthToken(authToken);
workflow.setWorkflowInstance(wfInstance);
- workflow.setStartTime(DateUtils.parseDateUTC("2009-12-18T01:00Z"));
- workflow.setEndTime(DateUtils.parseDateUTC("2009-12-18T03:00Z"));
+ workflow.setStartTime(DateUtils.parseDateOozieTZ("2009-12-18T01:00Z"));
+ workflow.setEndTime(DateUtils.parseDateOozieTZ("2009-12-18T03:00Z"));
return workflow;
}
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/coord/TestCoordELEvaluator.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/coord/TestCoordELEvaluator.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/coord/TestCoordELEvaluator.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/coord/TestCoordELEvaluator.java Mon Aug 13 23:21:15 2012
@@ -158,8 +158,8 @@ public class TestCoordELEvaluator extend
dataEvntXML += "<uri-template>file:///tmp/coord/US/${YEAR}/${MONTH}/${DAY}</uri-template></dataset></data-in>";
Element event = XmlUtils.parseXml(dataEvntXML);
SyncCoordAction appInst = new SyncCoordAction();
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-09-08T01:00Z"));
- appInst.setActualTime(DateUtils.parseDateUTC("2010-10-01T00:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-09-08T01:00Z"));
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2010-10-01T00:00Z"));
appInst.setTimeUnit(TimeUnit.MINUTE);
// Configuration conf = new
// XConfiguration(IOUtils.getResourceAsReader("org/apache/oozie/coord/conf.xml",
@@ -180,8 +180,8 @@ public class TestCoordELEvaluator extend
String testCaseDir = getTestCaseDir();
Configuration conf = new XConfiguration(new StringReader(getConfString()));
- Date actualTime = DateUtils.parseDateUTC("2009-09-01T01:00Z");
- Date nominalTime = DateUtils.parseDateUTC("2009-09-01T00:00Z");
+ Date actualTime = DateUtils.parseDateOozieTZ("2009-09-01T01:00Z");
+ Date nominalTime = DateUtils.parseDateOozieTZ("2009-09-01T00:00Z");
String dataEvntXML = "<data-in name=\"A\" dataset=\"a\"><uris>file:///"+testCaseDir+"/US/2009/1/30|file:///tmp/coord/US/2009/1/31</uris>";
dataEvntXML += "<dataset name=\"a\" frequency=\"1440\" initial-instance=\"2009-01-01T00:00Z\" freq_timeunit=\"MINUTE\" timezone=\"UTC\" end_of_duration=\"NONE\">";
dataEvntXML += "<uri-template>file:///"+testCaseDir+"/${YEAR}/${MONTH}/${DAY}</uri-template></dataset></data-in>";
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/coord/TestCoordELFunctions.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/coord/TestCoordELFunctions.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/coord/TestCoordELFunctions.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/coord/TestCoordELFunctions.java Mon Aug 13 23:21:15 2012
@@ -188,17 +188,17 @@ public class TestCoordELFunctions extend
;
ds.setFrequency(1);
ds.setTimeUnit(TimeUnit.DAY);
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-02T00:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-02T00:00Z"));
ds.setTimeZone(DateUtils.getTimeZone("UTC"));
ds.setName("test1");
ds.setType("SYNC");
- appInst.setActualTime(DateUtils.parseDateUTC("2009-09-10T23:59Z"));
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2009-09-10T23:59Z"));
appInst.setTimeZone(DateUtils.getTimeZone("UTC"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-01T08:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-01-01T08:00Z"));
- appInst.setActualTime(DateUtils.parseDateUTC("2010-10-01T00:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-01T08:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-01-01T08:00Z"));
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2010-10-01T00:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:hoursInDay(0)}";
assertEquals("24", CoordELFunctions.evalAndWrap(eval, expr));
@@ -210,8 +210,8 @@ public class TestCoordELFunctions extend
expr = "${coord:hoursInDay(-2)}";
assertEquals("24", CoordELFunctions.evalAndWrap(eval, expr));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-03-08T08:00Z"));
- appInst.setActualTime(DateUtils.parseDateUTC("2010-10-01T00:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-03-08T08:00Z"));
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2010-10-01T00:00Z"));
ds.setTimeZone(DateUtils.getTimeZone("UTC"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:hoursInDay(0)}";
@@ -222,8 +222,8 @@ public class TestCoordELFunctions extend
expr = "${coord:hoursInDay(0)}";
assertEquals("24", CoordELFunctions.evalAndWrap(eval, expr));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-03-08T08:00Z"));
- appInst.setActualTime(DateUtils.parseDateUTC("2010-10-01T00:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-03-08T08:00Z"));
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2010-10-01T00:00Z"));
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:hoursInDay(0)}";
@@ -232,14 +232,14 @@ public class TestCoordELFunctions extend
expr = "${coord:hoursInDay(1)}";
assertEquals("24", CoordELFunctions.evalAndWrap(eval, expr));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-11-01T08:00Z"));
- appInst.setActualTime(DateUtils.parseDateUTC("2010-10-01T00:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-11-01T08:00Z"));
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2010-10-01T00:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:hoursInDay(0)}";
assertEquals("25", CoordELFunctions.evalAndWrap(eval, expr));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-03-08T08:00Z"));
- appInst.setActualTime(DateUtils.parseDateUTC("2010-10-01T00:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-03-08T08:00Z"));
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2010-10-01T00:00Z"));
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
ds.setEndOfDuration(TimeUnit.END_OF_DAY);
CoordELFunctions.configureEvaluator(eval, ds, appInst);
@@ -264,17 +264,17 @@ public class TestCoordELFunctions extend
;
ds.setFrequency(1);
ds.setTimeUnit(TimeUnit.MONTH);
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-02T00:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-02T00:00Z"));
ds.setTimeZone(DateUtils.getTimeZone("UTC"));
ds.setName("test1");
ds.setType("SYNC");
- appInst.setActualTime(DateUtils.parseDateUTC("2009-09-10T23:59Z"));
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2009-09-10T23:59Z"));
appInst.setTimeZone(DateUtils.getTimeZone("UTC"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-01T00:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-02-01T11:00Z"));
- appInst.setActualTime(DateUtils.parseDateUTC("2010-10-01T00:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-01T00:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-02-01T11:00Z"));
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2010-10-01T00:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:daysInMonth(0)}";
assertEquals("28", CoordELFunctions.evalAndWrap(eval, expr));
@@ -292,8 +292,8 @@ public class TestCoordELFunctions extend
assertEquals("31", CoordELFunctions.evalAndWrap(eval, expr));
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-02-01T11:00Z")); // Feb
- appInst.setActualTime(DateUtils.parseDateUTC("2010-10-01T00:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-02-01T11:00Z")); // Feb
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2010-10-01T00:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:daysInMonth(0)}";
assertEquals("28", CoordELFunctions.evalAndWrap(eval, expr)); // Jan
@@ -303,17 +303,17 @@ public class TestCoordELFunctions extend
ds.setFrequency(1);
ds.setTimeUnit(TimeUnit.MONTH);
ds.setEndOfDuration(TimeUnit.END_OF_MONTH);
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-02T00:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-02T00:00Z"));
ds.setTimeZone(DateUtils.getTimeZone("UTC"));
ds.setName("test1");
ds.setType("SYNC");
- appInst.setActualTime(DateUtils.parseDateUTC("2009-09-10T23:59Z"));
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2009-09-10T23:59Z"));
appInst.setTimeZone(DateUtils.getTimeZone("UTC"));
// Case 1
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-01T00:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-02-01T11:00Z"));
- appInst.setActualTime(DateUtils.parseDateUTC("2010-10-01T00:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-01T00:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-02-01T11:00Z"));
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2010-10-01T00:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:daysInMonth(0)}";
assertEquals("28", CoordELFunctions.evalAndWrap(eval, expr));
@@ -331,8 +331,8 @@ public class TestCoordELFunctions extend
assertEquals("31", CoordELFunctions.evalAndWrap(eval, expr));
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-02-01T11:00Z")); // Feb
- appInst.setActualTime(DateUtils.parseDateUTC("2010-10-01T00:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-02-01T11:00Z")); // Feb
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2010-10-01T00:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:daysInMonth(0)}";
assertEquals("28", CoordELFunctions.evalAndWrap(eval, expr)); // Jan
@@ -369,19 +369,19 @@ public class TestCoordELFunctions extend
String expr = "${coord:current(-1)}";
assertEquals("2009-09-08T23:59Z", CoordELFunctions.evalAndWrap(eval, expr));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-05-30T00:45Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-05-30T00:45Z"));
ds.setFrequency(1);
ds.setTimeUnit(TimeUnit.DAY);
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-02T00:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-02T00:00Z"));
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
expr = "${coord:current(0)} ${coord:current(1)} ${coord:current(-1)} ${coord:current(-3)}";
assertEquals("2009-05-29T23:00Z 2009-05-30T23:00Z 2009-05-28T23:00Z 2009-05-26T23:00Z", CoordELFunctions
.evalAndWrap(eval, expr));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-05-30T00:45Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-05-30T00:45Z"));
ds.setFrequency(30);
ds.setTimeUnit(TimeUnit.MINUTE);
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-08T00:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-08T00:00Z"));
expr = "${coord:current(0)} ${coord:current(1)} ${coord:current(-1)} ${coord:current(-3)}";
assertEquals("2009-05-30T00:30Z 2009-05-30T01:00Z 2009-05-30T00:00Z 2009-05-29T23:00Z", eval.evaluate(expr,
String.class));
@@ -391,13 +391,13 @@ public class TestCoordELFunctions extend
;
ds.setFrequency(1);
ds.setTimeUnit(TimeUnit.DAY);
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-02T00:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-02T00:00Z"));
ds.setTimeZone(DateUtils.getTimeZone("UTC"));
ds.setName("test1");
ds.setType("SYNC");
- appInst.setActualTime(DateUtils.parseDateUTC("2009-09-10T23:59Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-05-30T00:00Z "));
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2009-09-10T23:59Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-05-30T00:00Z "));
appInst.setTimeZone(DateUtils.getTimeZone("UTC"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
@@ -414,7 +414,7 @@ public class TestCoordELFunctions extend
assertEquals("2009-05-27T00:00Z", CoordELFunctions.evalAndWrap(eval, expr));
ds.setFrequency(7);
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-08T00:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-08T00:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -430,21 +430,21 @@ public class TestCoordELFunctions extend
assertEquals("2009-05-07T00:00Z", CoordELFunctions.evalAndWrap(eval, expr));
// Spring DST transition
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-03-08T10:45Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-03-08T10:45Z"));
ds.setFrequency(1);
ds.setTimeUnit(TimeUnit.DAY);
- ds.setInitInstance(DateUtils.parseDateUTC("2009-03-06T10:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-03-06T10:00Z"));
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
expr = "${coord:current(-2)} ${coord:current(-1)} ${coord:current(0)} ${coord:current(1)} ${coord:current(2)}";
assertEquals("2009-03-06T10:00Z 2009-03-07T10:00Z 2009-03-08T09:00Z 2009-03-09T09:00Z 2009-03-10T09:00Z",
CoordELFunctions.evalAndWrap(eval, expr));
// Winter DST Transition
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-11-01T08:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-11-01T08:00Z"));
ds.setFrequency(1);
ds.setTimeUnit(TimeUnit.DAY);
- ds.setInitInstance(DateUtils.parseDateUTC("2009-10-30T08:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-10-30T08:00Z"));
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
expr = "${coord:current(-2)} ${coord:current(-1)} ${coord:current(0)} ${coord:current(1)} ${coord:current(2)}";
// System.out.println("AAAAA " + CoordELFunctions.evalAndWrap(eval,
@@ -455,11 +455,11 @@ public class TestCoordELFunctions extend
// EndofDay testing
ds.setFrequency(1);
ds.setTimeUnit(TimeUnit.DAY);
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-02T09:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-02T09:00Z"));
ds.setTimeZone(DateUtils.getTimeZone("UTC"));
ds.setName("test1");
ds.setType("SYNC");
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-05-30T12:00Z "));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-05-30T12:00Z "));
ds.setEndOfDuration(TimeUnit.END_OF_DAY);
CoordELFunctions.configureEvaluator(eval, ds, appInst);
@@ -473,8 +473,8 @@ public class TestCoordELFunctions extend
// From Specification
// Case 1
ds.setEndOfDuration(TimeUnit.END_OF_DAY);
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-01T08:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-01-01T08:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-01T08:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-01-01T08:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -486,8 +486,8 @@ public class TestCoordELFunctions extend
// Case 2
ds.setEndOfDuration(TimeUnit.END_OF_DAY);
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-01T08:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-01-01T08:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-01T08:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-01-01T08:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -503,8 +503,8 @@ public class TestCoordELFunctions extend
// Case 3
ds.setEndOfDuration(TimeUnit.END_OF_DAY);
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-01T07:01Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-01-01T08:01Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-01T07:01Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-01-01T08:01Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -516,8 +516,8 @@ public class TestCoordELFunctions extend
// Case 4
ds.setEndOfDuration(TimeUnit.END_OF_DAY);
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-01T7:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-01-01T18:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-01T7:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-01-01T18:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -529,8 +529,8 @@ public class TestCoordELFunctions extend
// Case 5
ds.setEndOfDuration(TimeUnit.END_OF_DAY);
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-03-07T07:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-03-07T09:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-03-07T07:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-03-07T09:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -542,8 +542,8 @@ public class TestCoordELFunctions extend
// Case 6
ds.setEndOfDuration(TimeUnit.END_OF_DAY);
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-03-08T07:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-03-08T08:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-03-08T07:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-03-08T08:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -555,8 +555,8 @@ public class TestCoordELFunctions extend
// Case 7
ds.setEndOfDuration(TimeUnit.END_OF_DAY);
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-03-09T07:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-03-10T08:01Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-03-09T07:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-03-10T08:01Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -569,8 +569,8 @@ public class TestCoordELFunctions extend
ds.setEndOfDuration(TimeUnit.END_OF_DAY);
ds.setFrequency(2); // Changed
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-03-09T07:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-03-10T07:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-03-09T07:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-03-10T07:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -586,8 +586,8 @@ public class TestCoordELFunctions extend
ds.setEndOfDuration(TimeUnit.END_OF_MONTH);
ds.setFrequency(1);
ds.setTimeZone(DateUtils.getTimeZone("UTC"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-01T00:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-02-01T00:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-01T00:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-02-01T00:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -599,8 +599,8 @@ public class TestCoordELFunctions extend
// Case 2
ds.setEndOfDuration(TimeUnit.END_OF_MONTH);
ds.setTimeZone(DateUtils.getTimeZone("UTC"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-01T08:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-02-01T08:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-01T08:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-02-01T08:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -612,8 +612,8 @@ public class TestCoordELFunctions extend
// Case 3
ds.setEndOfDuration(TimeUnit.END_OF_MONTH);
ds.setTimeZone(DateUtils.getTimeZone("UTC"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-31T08:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-02-01T08:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-31T08:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-02-01T08:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -625,8 +625,8 @@ public class TestCoordELFunctions extend
// Case 4
ds.setEndOfDuration(TimeUnit.END_OF_MONTH);
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-01-01T08:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-02-01T08:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-01-01T08:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-02-01T08:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -638,8 +638,8 @@ public class TestCoordELFunctions extend
// Case 5
ds.setEndOfDuration(TimeUnit.END_OF_MONTH);
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-02-02T08:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-03-02T08:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-02-02T08:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-03-02T08:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -651,8 +651,8 @@ public class TestCoordELFunctions extend
// Case 6
ds.setEndOfDuration(TimeUnit.END_OF_MONTH);
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-02-01T08:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-03-01T08:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-02-01T08:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-03-01T08:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -665,8 +665,8 @@ public class TestCoordELFunctions extend
ds.setEndOfDuration(TimeUnit.END_OF_MONTH);
ds.setFrequency(3);
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
- ds.setInitInstance(DateUtils.parseDateUTC("2009-02-01T08:00Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-03-01T08:00Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-02-01T08:00Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-03-01T08:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
expr = "${coord:current(0)}";
@@ -863,15 +863,15 @@ public class TestCoordELFunctions extend
appInst = new SyncCoordAction();
ds = new SyncCoordDataset();
ds.setFrequency(1);
- ds.setInitInstance(DateUtils.parseDateUTC("2009-09-01T23:59Z"));
+ ds.setInitInstance(DateUtils.parseDateOozieTZ("2009-09-01T23:59Z"));
ds.setTimeUnit(TimeUnit.DAY);
ds.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
ds.setName("test");
ds.setUriTemplate("hdfs://localhost:9000/user/" + getTestUser() + "/US/${YEAR}/${MONTH}/${DAY}");
ds.setType("SYNC");
ds.setDoneFlag("");
- appInst.setActualTime(DateUtils.parseDateUTC("2009-09-10T23:59Z"));
- appInst.setNominalTime(DateUtils.parseDateUTC("2009-09-09T23:59Z"));
+ appInst.setActualTime(DateUtils.parseDateOozieTZ("2009-09-10T23:59Z"));
+ appInst.setNominalTime(DateUtils.parseDateOozieTZ("2009-09-09T23:59Z"));
appInst.setTimeZone(DateUtils.getTimeZone("America/Los_Angeles"));
appInst.setActionId("00000-oozie-C@1");
appInst.setName("mycoordinator-app");
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleActionsDeleteForPurgeJPAExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleActionsDeleteForPurgeJPAExecutor.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleActionsDeleteForPurgeJPAExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleActionsDeleteForPurgeJPAExecutor.java Mon Aug 13 23:21:15 2012
@@ -46,7 +46,8 @@ public class TestBundleActionsDeleteForP
}
public void testBundleActionsDeleteForPurgeJPAExecutor() throws Exception {
- BundleJobBean job = this.addRecordToBundleJobTable(Job.Status.SUCCEEDED, DateUtils.parseDateUTC("2011-01-01T01:00Z"));
+ BundleJobBean job = this.addRecordToBundleJobTable(Job.Status.SUCCEEDED, DateUtils.parseDateOozieTZ(
+ "2011-01-01T01:00Z"));
this.addRecordToBundleActionTable(job.getId(), "action1", 0, Job.Status.SUCCEEDED);
this.addRecordToBundleActionTable(job.getId(), "action2", 0, Job.Status.SUCCEEDED);
_testBundleActionsDelete(job.getId());
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleJobDeleteJPAExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleJobDeleteJPAExecutor.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleJobDeleteJPAExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleJobDeleteJPAExecutor.java Mon Aug 13 23:21:15 2012
@@ -43,9 +43,11 @@ public class TestBundleJobDeleteJPAExecu
}
public void testBundleJobDeleteJPAExecutor() throws Exception {
- BundleJobBean job1 = this.addRecordToBundleJobTable(Job.Status.SUCCEEDED, DateUtils.parseDateUTC("2011-01-01T01:00Z"));
+ BundleJobBean job1 = this.addRecordToBundleJobTable(Job.Status.SUCCEEDED, DateUtils.parseDateOozieTZ(
+ "2011-01-01T01:00Z"));
_testBundleJobDelete(job1.getId());
- BundleJobBean job2 = this.addRecordToBundleJobTable(Job.Status.SUCCEEDED, DateUtils.parseDateUTC("2011-01-02T01:00Z"));
+ BundleJobBean job2 = this.addRecordToBundleJobTable(Job.Status.SUCCEEDED, DateUtils.parseDateOozieTZ(
+ "2011-01-02T01:00Z"));
_testBundleJobDelete(job2.getId());
}
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleJobsGetForPurgeJPAExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleJobsGetForPurgeJPAExecutor.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleJobsGetForPurgeJPAExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBundleJobsGetForPurgeJPAExecutor.java Mon Aug 13 23:21:15 2012
@@ -51,11 +51,11 @@ public class TestBundleJobsGetForPurgeJP
}
public void testBundleJobsGetForPurgeJPAExecutor() throws Exception {
- this.addRecordToBundleJobTable(Job.Status.SUCCEEDED, DateUtils.parseDateUTC("2011-01-01T01:00Z"));
+ this.addRecordToBundleJobTable(Job.Status.SUCCEEDED, DateUtils.parseDateOozieTZ("2011-01-01T01:00Z"));
_testBundleJobsForPurge(10, 1);
- this.addRecordToBundleJobTable(Job.Status.SUCCEEDED, DateUtils.parseDateUTC("2011-01-02T01:00Z"));
+ this.addRecordToBundleJobTable(Job.Status.SUCCEEDED, DateUtils.parseDateOozieTZ("2011-01-02T01:00Z"));
_testBundleJobsForPurge(10, 2);
}
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordActionGetForInfoJPAExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordActionGetForInfoJPAExecutor.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordActionGetForInfoJPAExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordActionGetForInfoJPAExecutor.java Mon Aug 13 23:21:15 2012
@@ -19,19 +19,16 @@ package org.apache.oozie.executor.jpa;
import java.util.Date;
-import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.oozie.CoordinatorActionBean;
import org.apache.oozie.CoordinatorJobBean;
import org.apache.oozie.client.CoordinatorAction;
import org.apache.oozie.client.CoordinatorJob;
import org.apache.oozie.local.LocalOozie;
-import org.apache.oozie.service.CallableQueueService;
import org.apache.oozie.service.JPAService;
import org.apache.oozie.service.Services;
import org.apache.oozie.test.XDataTestCase;
import org.apache.oozie.util.DateUtils;
-import org.apache.oozie.util.XmlUtils;
public class TestCoordActionGetForInfoJPAExecutor extends XDataTestCase {
Services services;
@@ -89,7 +86,7 @@ public class TestCoordActionGetForInfoJP
// Pass the expected values
_testGetForInfo(action.getId(), job.getId(), CoordinatorAction.Status.WAITING, action.getId() + "_E",
errorCode, errorMessage, consoleUrl, externalStatus, trackerUri, createdTime, missingDeps,
- DateUtils.parseDateUTC(actionNominalTime), actionNum, lastModifiedTime);
+ DateUtils.parseDateOozieTZ(actionNominalTime), actionNum, lastModifiedTime);
//services.destroy();
}
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordActionGetForInputCheckJPAExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordActionGetForInputCheckJPAExecutor.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordActionGetForInputCheckJPAExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordActionGetForInputCheckJPAExecutor.java Mon Aug 13 23:21:15 2012
@@ -76,7 +76,7 @@ public class TestCoordActionGetForInputC
// Pass the expected values
_testGetForInputCheckX(action.getId(), job.getId(), CoordinatorAction.Status.WAITING, 0, actionXml, XmlUtils
- .prettyPrint(conf).toString(), DateUtils.parseDateUTC(actionNominalTime), dummyCreationTime, missDeps);
+ .prettyPrint(conf).toString(), DateUtils.parseDateOozieTZ(actionNominalTime), dummyCreationTime, missDeps);
}
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionForNominalTimeJPAExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionForNominalTimeJPAExecutor.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionForNominalTimeJPAExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionForNominalTimeJPAExecutor.java Mon Aug 13 23:21:15 2012
@@ -58,7 +58,7 @@ public class TestCoordJobGetActionForNom
String actionXml = getCoordActionXml(appPath, "coord-action-get.xml");
String actionNomialTime = getActionNominalTime(actionXml);
- _testGetActionForNominalTime(job.getId(), action.getId(), DateUtils.parseDateUTC(actionNomialTime));
+ _testGetActionForNominalTime(job.getId(), action.getId(), DateUtils.parseDateOozieTZ(actionNomialTime));
}
private void _testGetActionForNominalTime(String jobId, String actionId, Date d) throws Exception {
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionIdsForDatesJPAExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionIdsForDatesJPAExecutor.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionIdsForDatesJPAExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionIdsForDatesJPAExecutor.java Mon Aug 13 23:21:15 2012
@@ -21,7 +21,6 @@ import java.util.Date;
import java.util.List;
import org.apache.hadoop.fs.Path;
-import org.apache.oozie.CoordinatorActionBean;
import org.apache.oozie.CoordinatorJobBean;
import org.apache.oozie.client.CoordinatorAction;
import org.apache.oozie.client.CoordinatorJob;
@@ -58,7 +57,7 @@ public class TestCoordJobGetActionIdsFor
Path appPath = new Path(getFsTestCaseDir(), "coord");
String actionXml = getCoordActionXml(appPath, "coord-action-get.xml");
String actionNomialTime = getActionNominalTime(actionXml);
- Date nominalTime = DateUtils.parseDateUTC(actionNomialTime);
+ Date nominalTime = DateUtils.parseDateOozieTZ(actionNomialTime);
Date d1 = new Date(nominalTime.getTime() - 1000);
Date d2 = new Date(nominalTime.getTime() + 1000);
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionsForDatesJPAExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionsForDatesJPAExecutor.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionsForDatesJPAExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionsForDatesJPAExecutor.java Mon Aug 13 23:21:15 2012
@@ -58,7 +58,7 @@ public class TestCoordJobGetActionsForDa
Path appPath = new Path(getFsTestCaseDir(), "coord");
String actionXml = getCoordActionXml(appPath, "coord-action-get.xml");
String actionNomialTime = getActionNominalTime(actionXml);
- Date nominalTime = DateUtils.parseDateUTC(actionNomialTime);
+ Date nominalTime = DateUtils.parseDateOozieTZ(actionNomialTime);
Date d1 = new Date(nominalTime.getTime() - 1000);
Date d2 = new Date(nominalTime.getTime() + 1000);
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionsSubsetJPAExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionsSubsetJPAExecutor.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionsSubsetJPAExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobGetActionsSubsetJPAExecutor.java Mon Aug 13 23:21:15 2012
@@ -79,7 +79,7 @@ public class TestCoordJobGetActionsSubse
//Pass expected values
_testGetActionsSubset(job.getId(), action.getId(), 1, 1, "consoleUrl", "errorCode", "errorMessage",
action.getId() + "_E", "externalStatus", "trackerUri", dummyCreationTime,
- DateUtils.parseDateUTC(actionNominalTime), missDeps, 10, CoordinatorAction.Status.WAITING);
+ DateUtils.parseDateOozieTZ(actionNominalTime), missDeps, 10, CoordinatorAction.Status.WAITING);
}
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobsGetForPurgeJPAExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobsGetForPurgeJPAExecutor.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobsGetForPurgeJPAExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobsGetForPurgeJPAExecutor.java Mon Aug 13 23:21:15 2012
@@ -65,7 +65,7 @@ public class TestCoordJobsGetForPurgeJPA
public void testCoordJobsGetForPurgeJPAExecutor() throws Exception {
String jobId = "00000-" + new Date().getTime() + "-TestCoordJobsGetForPurgeJPAExecutor-C";
- insertJob(jobId, CoordinatorJob.Status.SUCCEEDED, DateUtils.parseDateUTC("2011-01-01T01:00Z"));
+ insertJob(jobId, CoordinatorJob.Status.SUCCEEDED, DateUtils.parseDateOozieTZ("2011-01-01T01:00Z"));
_testCoordJobsForPurge(10, 1);
}
@@ -103,8 +103,8 @@ public class TestCoordJobsGetForPurgeJPA
coordJob.setExecution(Execution.FIFO);
coordJob.setConcurrency(1);
try {
- coordJob.setStartTime(DateUtils.parseDateUTC("2009-12-15T01:00Z"));
- coordJob.setEndTime(DateUtils.parseDateUTC("2009-12-17T01:00Z"));
+ coordJob.setStartTime(DateUtils.parseDateOozieTZ("2009-12-15T01:00Z"));
+ coordJob.setEndTime(DateUtils.parseDateOozieTZ("2009-12-17T01:00Z"));
}
catch (Exception e) {
e.printStackTrace();
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobsToBeMaterializedJPAExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobsToBeMaterializedJPAExecutor.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobsToBeMaterializedJPAExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobsToBeMaterializedJPAExecutor.java Mon Aug 13 23:21:15 2012
@@ -124,8 +124,8 @@ public class TestCoordJobsToBeMaterializ
coordJob.setExecution(Execution.FIFO);
coordJob.setConcurrency(1);
try {
- coordJob.setStartTime(DateUtils.parseDateUTC("2009-12-15T01:00Z"));
- coordJob.setEndTime(DateUtils.parseDateUTC("2009-12-17T01:00Z"));
+ coordJob.setStartTime(DateUtils.parseDateOozieTZ("2009-12-15T01:00Z"));
+ coordJob.setEndTime(DateUtils.parseDateOozieTZ("2009-12-17T01:00Z"));
}
catch (Exception e) {
e.printStackTrace();
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestCoordMaterializeTriggerService.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestCoordMaterializeTriggerService.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestCoordMaterializeTriggerService.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestCoordMaterializeTriggerService.java Mon Aug 13 23:21:15 2012
@@ -63,8 +63,8 @@ public class TestCoordMaterializeTrigger
*/
public void testCoordMaterializeTriggerService1() throws Exception {
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-20T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-20T23:59Z");
final CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.PREP, start, end, false, false, 0);
Thread.sleep(3000);
@@ -109,8 +109,8 @@ public class TestCoordMaterializeTrigger
String startDateStr = null, endDateStr = null;
try {
- startDateStr = DateUtils.formatDateUTC(start);
- endDateStr = DateUtils.formatDateUTC(end);
+ startDateStr = DateUtils.formatDateOozieTZ(start);
+ endDateStr = DateUtils.formatDateOozieTZ(end);
appXml = appXml.replaceAll("#start", startDateStr);
appXml = appXml.replaceAll("#end", endDateStr);
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestPurgeService.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestPurgeService.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestPurgeService.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestPurgeService.java Mon Aug 13 23:21:15 2012
@@ -51,8 +51,6 @@ import org.apache.oozie.executor.jpa.JPA
import org.apache.oozie.executor.jpa.WorkflowJobGetJPAExecutor;
import org.apache.oozie.executor.jpa.WorkflowJobUpdateJPAExecutor;
import org.apache.oozie.service.PurgeService.PurgeRunnable;
-import org.apache.oozie.service.Services;
-import org.apache.oozie.service.ActionService;
import org.apache.oozie.test.XDataTestCase;
import org.apache.oozie.util.DateUtils;
import org.apache.oozie.util.IOUtils;
@@ -217,7 +215,8 @@ public class TestPurgeService extends XD
* Calls the purge service, and ensure the job does not exist in the system.
*/
public void testPurgeServiceForBundle() throws Exception {
- BundleJobBean job = this.addRecordToBundleJobTable(Job.Status.SUCCEEDED, DateUtils.parseDateUTC("2011-01-01T01:00Z"));
+ BundleJobBean job = this.addRecordToBundleJobTable(Job.Status.SUCCEEDED, DateUtils.parseDateOozieTZ(
+ "2011-01-01T01:00Z"));
final String jobId = job.getId();
this.addRecordToBundleActionTable(job.getId(), "action1", 0, Job.Status.SUCCEEDED);
this.addRecordToBundleActionTable(job.getId(), "action2", 0, Job.Status.SUCCEEDED);
@@ -297,7 +296,7 @@ public class TestPurgeService extends XD
@Override
protected CoordinatorJobBean addRecordToCoordJobTable(CoordinatorJob.Status status, boolean pending, boolean doneMatd) throws Exception {
CoordinatorJobBean coordJob = createCoordJob(status, pending, doneMatd);
- coordJob.setLastModifiedTime(DateUtils.parseDateUTC("2009-12-18T01:00Z"));
+ coordJob.setLastModifiedTime(DateUtils.parseDateOozieTZ("2009-12-18T01:00Z"));
try {
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestRecoveryService.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestRecoveryService.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestRecoveryService.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestRecoveryService.java Mon Aug 13 23:21:15 2012
@@ -294,8 +294,8 @@ public class TestRecoveryService extends
*/
public void testCoordActionRecoveryServiceForWaiting() throws Exception {
- Date startTime = DateUtils.parseDateUTC("2009-02-01T23:59Z");
- Date endTime = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date startTime = DateUtils.parseDateOozieTZ("2009-02-01T23:59Z");
+ Date endTime = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTableForWaiting("coord-job-for-action-input-check.xml",
CoordinatorJob.Status.RUNNING, startTime, endTime, false, true, 0);
@@ -339,8 +339,8 @@ public class TestRecoveryService extends
*/
public void testCoordActionRecoveryServiceForSuspended() throws Exception {
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean coordJob = addRecordToCoordJobTable(CoordinatorJob.Status.SUSPENDED, start, end, false, false, 1);
WorkflowJobBean wfJob = addRecordToWfJobTable(WorkflowJob.Status.RUNNING, WorkflowInstance.Status.RUNNING);
final String wfJobId = wfJob.getId();
@@ -376,8 +376,8 @@ public class TestRecoveryService extends
*/
public void testCoordActionRecoveryServiceForKilled() throws Exception {
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean coordJob = addRecordToCoordJobTable(CoordinatorJob.Status.KILLED, start, end, false, false, 1);
WorkflowJobBean wfJob = addRecordToWfJobTable(WorkflowJob.Status.RUNNING, WorkflowInstance.Status.RUNNING);
final String wfJobId = wfJob.getId();
@@ -413,8 +413,8 @@ public class TestRecoveryService extends
*/
public void testCoordActionRecoveryServiceForResume() throws Exception {
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean coordJob = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, start, end, false, false, 1);
WorkflowJobBean wfJob = addRecordToWfJobTable(WorkflowJob.Status.SUSPENDED, WorkflowInstance.Status.SUSPENDED);
final String wfJobId = wfJob.getId();
@@ -682,8 +682,8 @@ public class TestRecoveryService extends
coordJob.setExecution(Execution.FIFO);
coordJob.setConcurrency(1);
try {
- coordJob.setEndTime(DateUtils.parseDateUTC("2009-02-03T23:59Z"));
- coordJob.setStartTime(DateUtils.parseDateUTC("2009-02-01T23:59Z"));
+ coordJob.setEndTime(DateUtils.parseDateOozieTZ("2009-02-03T23:59Z"));
+ coordJob.setStartTime(DateUtils.parseDateOozieTZ("2009-02-01T23:59Z"));
}
catch (Exception e) {
e.printStackTrace();
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestStatusTransitService.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestStatusTransitService.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestStatusTransitService.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestStatusTransitService.java Mon Aug 13 23:21:15 2012
@@ -80,8 +80,8 @@ public class TestStatusTransitService ex
*/
public void testCoordStatusTransitServiceSucceeded() throws Exception {
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, start, end, true, true, 3);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.SUCCEEDED, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 2, CoordinatorAction.Status.SUCCEEDED, "coord-action-get.xml", 0);
@@ -106,8 +106,8 @@ public class TestStatusTransitService ex
*/
public void testCoordStatusTransitServiceDoneWithError() throws Exception {
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, start, end, true, true, 3);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.KILLED, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 2, CoordinatorAction.Status.SUCCEEDED, "coord-action-get.xml", 0);
@@ -137,8 +137,8 @@ public class TestStatusTransitService ex
setSystemProperty(StatusTransitService.CONF_BACKWARD_SUPPORT_FOR_COORD_STATUS, "true");
new Services().init();
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean coordJob = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, start, end, true, true, 3);
final JPAService jpaService = Services.get().get(JPAService.class);
@@ -168,8 +168,8 @@ public class TestStatusTransitService ex
*/
public void testCoordStatusTransitServiceKilledByUser1() throws Exception {
final JPAService jpaService = Services.get().get(JPAService.class);
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean coordJob = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, start, end, false, false,
1);
WorkflowJobBean wfJob = addRecordToWfJobTable(WorkflowJob.Status.RUNNING, WorkflowInstance.Status.RUNNING);
@@ -224,8 +224,8 @@ public class TestStatusTransitService ex
* @throws Exception
*/
public void testCoordStatusTransitServiceKilledByUser2() throws Exception {
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.KILLED, start, end, true, false, 3);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.SUCCEEDED, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 2, CoordinatorAction.Status.KILLED, "coord-action-get.xml", 0);
@@ -255,8 +255,8 @@ public class TestStatusTransitService ex
* @throws Exception
*/
public void testCoordStatusTransitServiceSuspendedByUser() throws Exception {
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.SUSPENDED, start, end, true, true, 3);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.SUCCEEDED, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 2, CoordinatorAction.Status.SUCCEEDED, "coord-action-get.xml", 0);
@@ -287,8 +287,8 @@ public class TestStatusTransitService ex
* @throws Exception
*/
public void testCoordStatusTransitServiceSuspendedBottomUp() throws Exception {
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, start, end, true, true, 4);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.SUSPENDED, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 2, CoordinatorAction.Status.SUSPENDED, "coord-action-get.xml", 0);
@@ -325,8 +325,8 @@ public class TestStatusTransitService ex
Services.get().destroy();
setSystemProperty(StatusTransitService.CONF_BACKWARD_SUPPORT_FOR_STATES_WITHOUT_ERROR, "false");
new Services().init();
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, start, end, true, true, 4);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.SUSPENDED, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 2, CoordinatorAction.Status.SUSPENDED, "coord-action-get.xml", 0);
@@ -413,8 +413,8 @@ public class TestStatusTransitService ex
* @throws Exception
*/
public void testCoordStatusTransitServiceRunning1() throws Exception {
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, start, end, true, false, 3);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.RUNNING, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 2, CoordinatorAction.Status.RUNNING, "coord-action-get.xml", 0);
@@ -447,8 +447,8 @@ public class TestStatusTransitService ex
* @throws Exception
*/
public void testCoordStatusTransitServiceRunning2() throws Exception {
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNINGWITHERROR, start, end, true, false, 4);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.SUCCEEDED, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 2, CoordinatorAction.Status.RUNNING, "coord-action-get.xml", 0);
@@ -484,8 +484,8 @@ public class TestStatusTransitService ex
Services.get().destroy();
setSystemProperty(StatusTransitService.CONF_BACKWARD_SUPPORT_FOR_STATES_WITHOUT_ERROR, "true");
new Services().init();
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, start, end, true, false, 3);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.KILLED, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 2, CoordinatorAction.Status.RUNNING, "coord-action-get.xml", 0);
@@ -521,8 +521,8 @@ public class TestStatusTransitService ex
Services.get().destroy();
setSystemProperty(StatusTransitService.CONF_BACKWARD_SUPPORT_FOR_STATES_WITHOUT_ERROR, "false");
new Services().init();
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, start, end, true, false, 3);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.KILLED, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 2, CoordinatorAction.Status.RUNNING, "coord-action-get.xml", 0);
@@ -558,8 +558,8 @@ public class TestStatusTransitService ex
Services.get().destroy();
setSystemProperty(StatusTransitService.CONF_BACKWARD_SUPPORT_FOR_STATES_WITHOUT_ERROR, "false");
new Services().init();
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.PAUSED, start, end, true, false, 3);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.KILLED, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 2, CoordinatorAction.Status.RUNNING, "coord-action-get.xml", 0);
@@ -593,8 +593,8 @@ public class TestStatusTransitService ex
Services.get().destroy();
setSystemProperty(StatusTransitService.CONF_BACKWARD_SUPPORT_FOR_STATES_WITHOUT_ERROR, "false");
new Services().init();
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.PAUSEDWITHERROR, start, end, true, false, 3);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.SUCCEEDED, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 2, CoordinatorAction.Status.RUNNING, "coord-action-get.xml", 0);
@@ -626,8 +626,8 @@ public class TestStatusTransitService ex
* @throws Exception
*/
public void testCoordStatusTransitServiceForTimeout() throws Exception {
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, start, end, true, true, 3);
addRecordToCoordActionTable(job.getId(), 1, CoordinatorAction.Status.TIMEDOUT, "coord-action-get.xml", 0);
addRecordToCoordActionTable(job.getId(), 2, CoordinatorAction.Status.TIMEDOUT, "coord-action-get.xml", 0);
@@ -1162,8 +1162,8 @@ public class TestStatusTransitService ex
Runnable runnable = new StatusTransitRunnable();
runnable.run();
- Date start = DateUtils.parseDateUTC("2009-02-01T01:00Z");
- Date end = DateUtils.parseDateUTC("2009-02-02T23:59Z");
+ Date start = DateUtils.parseDateOozieTZ("2009-02-01T01:00Z");
+ Date end = DateUtils.parseDateOozieTZ("2009-02-02T23:59Z");
CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, start, end, true, true, 3);
// add a record with stale reference to coord job id
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/servlet/MockCoordinatorEngineService.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/servlet/MockCoordinatorEngineService.java?rev=1372663&r1=1372662&r2=1372663&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/servlet/MockCoordinatorEngineService.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/servlet/MockCoordinatorEngineService.java Mon Aug 13 23:21:15 2012
@@ -223,8 +223,8 @@ public class MockCoordinatorEngineServic
coordJob.setExecution(Execution.FIFO);
coordJob.setConcurrency(1);
try {
- coordJob.setEndTime(DateUtils.parseDateUTC("2009-02-03T23:59Z"));
- coordJob.setStartTime(DateUtils.parseDateUTC("2009-02-01T23:59Z"));
+ coordJob.setEndTime(DateUtils.parseDateOozieTZ("2009-02-03T23:59Z"));
+ coordJob.setStartTime(DateUtils.parseDateOozieTZ("2009-02-01T23:59Z"));
}
catch (Exception e) {
e.printStackTrace();
@@ -256,8 +256,8 @@ public class MockCoordinatorEngineServic
coordJob.setExecution(Execution.FIFO);
coordJob.setConcurrency(1);
try {
- coordJob.setEndTime(DateUtils.parseDateUTC("2009-02-03T23:59Z"));
- coordJob.setStartTime(DateUtils.parseDateUTC("2009-02-01T23:59Z"));
+ coordJob.setEndTime(DateUtils.parseDateOozieTZ("2009-02-03T23:59Z"));
+ coordJob.setStartTime(DateUtils.parseDateOozieTZ("2009-02-01T23:59Z"));
}
catch (Exception e) {
e.printStackTrace();