Permalink
Browse files

Undo DateTimeException extends IllegalArgumentException

See #89
  • Loading branch information...
1 parent 99435f1 commit 89390eae1f41f22e217c143d742d2240a3eda756 @jodastephen jodastephen committed Dec 2, 2012
Showing with 17 additions and 14 deletions.
  1. +5 −2 src/main/java/javax/time/DateTimeException.java
  2. +12 −12 src/tck/java/javax/time/TCKZoneOffset.java
@@ -32,12 +32,15 @@
package javax.time;
/**
- * The base class for all date-time exceptions.
+ * Exception used to indicate a problem while calculating a date-time.
+ * <p>
+ * This exception is used to indicate problems with creating, querying
+ * and manipulating date-time objects.
*
* <h4>Implementation notes</h4>
* This class is intended for use in a single thread.
*/
-public class DateTimeException extends IllegalArgumentException {
+public class DateTimeException extends RuntimeException {
/**
* Serialization version.
@@ -344,52 +344,52 @@ public void test_factory_int_hours_minutes_seconds() {
doTestOffset(test2, 18, 0, 0);
}
- @Test(expectedExceptions=IllegalArgumentException.class, groups={"tck"})
+ @Test(expectedExceptions=DateTimeException.class, groups={"tck"})
public void test_factory_int_hours_minutes_seconds_plusHoursMinusMinutes() {
ZoneOffset.ofHoursMinutesSeconds(1, -1, 0);
}
- @Test(expectedExceptions=IllegalArgumentException.class, groups={"tck"})
+ @Test(expectedExceptions=DateTimeException.class, groups={"tck"})
public void test_factory_int_hours_minutes_seconds_plusHoursMinusSeconds() {
ZoneOffset.ofHoursMinutesSeconds(1, 0, -1);
}
- @Test(expectedExceptions=IllegalArgumentException.class, groups={"tck"})
+ @Test(expectedExceptions=DateTimeException.class, groups={"tck"})
public void test_factory_int_hours_minutes_seconds_minusHoursPlusMinutes() {
ZoneOffset.ofHoursMinutesSeconds(-1, 1, 0);
}
- @Test(expectedExceptions=IllegalArgumentException.class, groups={"tck"})
+ @Test(expectedExceptions=DateTimeException.class, groups={"tck"})
public void test_factory_int_hours_minutes_seconds_minusHoursPlusSeconds() {
ZoneOffset.ofHoursMinutesSeconds(-1, 0, 1);
}
- @Test(expectedExceptions=IllegalArgumentException.class, groups={"tck"})
+ @Test(expectedExceptions=DateTimeException.class, groups={"tck"})
public void test_factory_int_hours_minutes_seconds_zeroHoursMinusMinutesPlusSeconds() {
ZoneOffset.ofHoursMinutesSeconds(0, -1, 1);
}
- @Test(expectedExceptions=IllegalArgumentException.class, groups={"tck"})
+ @Test(expectedExceptions=DateTimeException.class, groups={"tck"})
public void test_factory_int_hours_minutes_seconds_zeroHoursPlusMinutesMinusSeconds() {
ZoneOffset.ofHoursMinutesSeconds(0, 1, -1);
}
- @Test(expectedExceptions=IllegalArgumentException.class, groups={"tck"})
+ @Test(expectedExceptions=DateTimeException.class, groups={"tck"})
public void test_factory_int_hours_minutes_seconds_minutesTooLarge() {
ZoneOffset.ofHoursMinutesSeconds(0, 60, 0);
}
- @Test(expectedExceptions=IllegalArgumentException.class, groups={"tck"})
+ @Test(expectedExceptions=DateTimeException.class, groups={"tck"})
public void test_factory_int_hours_minutes_seconds_minutesTooSmall() {
ZoneOffset.ofHoursMinutesSeconds(0, -60, 0);
}
- @Test(expectedExceptions=IllegalArgumentException.class, groups={"tck"})
+ @Test(expectedExceptions=DateTimeException.class, groups={"tck"})
public void test_factory_int_hours_minutes_seconds_secondsTooLarge() {
ZoneOffset.ofHoursMinutesSeconds(0, 0, 60);
}
- @Test(expectedExceptions=IllegalArgumentException.class, groups={"tck"})
+ @Test(expectedExceptions=DateTimeException.class, groups={"tck"})
public void test_factory_int_hours_minutes_seconds_secondsTooSmall() {
ZoneOffset.ofHoursMinutesSeconds(0, 0, 60);
}
@@ -412,12 +412,12 @@ public void test_factory_ofTotalSeconds() {
assertEquals(ZoneOffset.ofTotalSeconds(-18 * 60 * 60), ZoneOffset.ofHours(-18));
}
- @Test(expectedExceptions=IllegalArgumentException.class, groups={"tck"})
+ @Test(expectedExceptions=DateTimeException.class, groups={"tck"})
public void test_factory_ofTotalSeconds_tooLarge() {
ZoneOffset.ofTotalSeconds(18 * 60 * 60 + 1);
}
- @Test(expectedExceptions=IllegalArgumentException.class, groups={"tck"})
+ @Test(expectedExceptions=DateTimeException.class, groups={"tck"})
public void test_factory_ofTotalSeconds_tooSmall() {
ZoneOffset.ofTotalSeconds(-18 * 60 * 60 - 1);
}

0 comments on commit 89390ea

Please sign in to comment.