Remove java.sql.Timestamp from domain objects.

This commit is contained in:
dsyer
2007-12-22 09:43:04 +00:00
parent c022df6ce0
commit 19164926b6
12 changed files with 89 additions and 116 deletions

View File

@@ -16,8 +16,8 @@
package org.springframework.batch.core.domain;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import org.springframework.batch.repeat.ExitStatus;
@@ -41,9 +41,9 @@ public class JobExecution extends Entity {
private BatchStatus status = BatchStatus.STARTING;
private Timestamp startTime = new Timestamp(System.currentTimeMillis());
private Date startTime = new Date(System.currentTimeMillis());
private Timestamp endTime = null;
private Date endTime = null;
private ExitStatus exitStatus = ExitStatus.UNKNOWN;
@@ -72,19 +72,19 @@ public class JobExecution extends Entity {
this(job, null);
}
public Timestamp getEndTime() {
public Date getEndTime() {
return endTime;
}
public void setEndTime(Timestamp endTime) {
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Timestamp getStartTime() {
public Date getStartTime() {
return startTime;
}
public void setStartTime(Timestamp startTime) {
public void setStartTime(Date startTime) {
this.startTime = startTime;
}

View File

@@ -16,7 +16,7 @@
package org.springframework.batch.core.domain;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Properties;
import org.springframework.batch.repeat.ExitStatus;
@@ -47,9 +47,9 @@ public class StepExecution extends Entity {
private int rollbackCount = 0;
private Timestamp startTime = new Timestamp(System.currentTimeMillis());
private Date startTime = new Date(System.currentTimeMillis());
private Timestamp endTime = null;
private Date endTime = null;
private Properties statistics = new Properties();
@@ -103,11 +103,11 @@ public class StepExecution extends Entity {
this.commitCount = commitCount;
}
public Timestamp getEndTime() {
public Date getEndTime() {
return endTime;
}
public void setEndTime(Timestamp endTime) {
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
@@ -127,11 +127,11 @@ public class StepExecution extends Entity {
return new Integer(rollbackCount);
}
public Timestamp getStartTime() {
public Date getStartTime() {
return startTime;
}
public void setStartTime(Timestamp startTime) {
public void setStartTime(Date startTime) {
this.startTime = startTime;
}

View File

@@ -15,7 +15,7 @@
*/
package org.springframework.batch.core.domain;
import java.sql.Timestamp;
import java.util.Date;
import junit.framework.TestCase;
@@ -44,7 +44,7 @@ public class JobExecutionTests extends TestCase {
*/
public void testGetEndTime() {
assertNull(execution.getEndTime());
execution.setEndTime(new Timestamp(100L));
execution.setEndTime(new Date(100L));
assertEquals(100L, execution.getEndTime().getTime());
}
@@ -53,7 +53,7 @@ public class JobExecutionTests extends TestCase {
*/
public void testIsRunning() {
assertTrue(execution.isRunning());
execution.setEndTime(new Timestamp(100L));
execution.setEndTime(new Date(100L));
assertFalse(execution.isRunning());
}
@@ -62,7 +62,7 @@ public class JobExecutionTests extends TestCase {
*/
public void testGetStartTime() {
assertNotNull(execution.getStartTime());
execution.setStartTime(new Timestamp(0L));
execution.setStartTime(new Date(0L));
assertEquals(0L, execution.getStartTime().getTime());
}

View File

@@ -15,13 +15,13 @@
*/
package org.springframework.batch.core.domain;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Properties;
import org.springframework.batch.repeat.ExitStatus;
import junit.framework.TestCase;
import org.springframework.batch.repeat.ExitStatus;
/**
* @author Dave Syer
*
@@ -45,7 +45,7 @@ public class StepExecutionTests extends TestCase {
*/
public void testGetEndTime() {
assertNull(execution.getEndTime());
execution.setEndTime(new Timestamp(0L));
execution.setEndTime(new Date(0L));
assertEquals(0L, execution.getEndTime().getTime());
}
@@ -55,7 +55,7 @@ public class StepExecutionTests extends TestCase {
*/
public void testGetStartTime() {
assertNotNull(execution.getStartTime());
execution.setStartTime(new Timestamp(10L));
execution.setStartTime(new Date(10L));
assertEquals(10L, execution.getStartTime().getTime());
}