BATCH-1316: adjust default values for long and double

This commit is contained in:
Dave Syer
2011-04-05 08:59:28 +01:00
parent 70eb73f8c7
commit 9bbf1f5c72
2 changed files with 24 additions and 1 deletions

View File

@@ -85,6 +85,22 @@ public class JobParametersTests {
assertEquals(null, parameters.getDate("date.key1"));
}
@Test
public void testGetEmptyLong() {
parameters = new JobParameters(Collections.singletonMap("long1", new JobParameter((Long)null)));
assertEquals(0L, parameters.getLong("long1"));
}
@Test
public void testGetMissingLong() {
assertEquals(0L, parameters.getLong("missing.long1"));
}
@Test
public void testGetMissingDouble() {
assertEquals(0.0, parameters.getDouble("missing.double1"), 0.0001);
}
@Test
public void testIsEmptyWhenEmpty() throws Exception {
assertTrue(new JobParameters().isEmpty());