Skip to content
This repository has been archived by the owner on Mar 20, 2018. It is now read-only.

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
jodastephen committed Jul 26, 2012
1 parent 75beb97 commit e5d1577
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 82 deletions.
57 changes: 27 additions & 30 deletions src/test/java/javax/time/TestOffsetDateTime_instants.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,7 @@ public void factory_ofInstant_allDaysInCycle() {
}

public void factory_ofInstant_history() {
// long start = System.currentTimeMillis();
doTest_factory_ofInstant_all(-2820, 2820);
// long end = System.currentTimeMillis();
// System.err.println(end - start);
}

//-----------------------------------------------------------------------
Expand Down Expand Up @@ -247,33 +244,33 @@ private void doTest_factory_ofInstant_all(long minYear, long maxYear) {
}

// for performance testing
// private void doTest_factory_ofInstant_all(int minYear, int maxYear) {
// long days_0000_to_1970 = (146097 * 5) - (30 * 365 + 7);
// int minOffset = (minYear <= 0 ? 0 : 3);
// int maxOffset = (maxYear <= 0 ? 0 : 3);
// long minDays = (long) (minYear * 365L + ((minYear + minOffset) / 4L - (minYear + minOffset) / 100L + (minYear + minOffset) / 400L)) - days_0000_to_1970;
// long maxDays = (long) (maxYear * 365L + ((maxYear + maxOffset) / 4L - (maxYear + maxOffset) / 100L + (maxYear + maxOffset) / 400L)) + 365L - days_0000_to_1970;
//
// OffsetDateTime expected = OffsetDateTime.dateTime(minYear, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC);
// Date cutover = new Date(Long.MIN_VALUE);
// GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
// cal.setGregorianChange(cutover);
// for (long i = minDays; i < maxDays; i++) {
// Instant instant = Instant.instant(i * 24L * 60L * 60L);
// try {
// cal.setTimeInMillis(instant.getEpochSecond() * 1000L);
// assertEquals(cal.get(GregorianCalendar.MONTH), expected.getMonth().getValue() - 1);
// assertEquals(cal.get(GregorianCalendar.DAY_OF_MONTH), expected.getDayOfMonth().getValue());
// expected = expected.plusDays(1);
// } catch (RuntimeException ex) {
// System.out.println("Error: " + i + " " + expected);
// throw ex;
// } catch (Error ex) {
// System.out.println("Error: " + i + " " + expected);
// throw ex;
// }
// }
// }
// private void doTest_factory_ofInstant_all(int minYear, int maxYear) {
// long days_0000_to_1970 = (146097 * 5) - (30 * 365 + 7);
// int minOffset = (minYear <= 0 ? 0 : 3);
// int maxOffset = (maxYear <= 0 ? 0 : 3);
// long minDays = (long) (minYear * 365L + ((minYear + minOffset) / 4L - (minYear + minOffset) / 100L + (minYear + minOffset) / 400L)) - days_0000_to_1970;
// long maxDays = (long) (maxYear * 365L + ((maxYear + maxOffset) / 4L - (maxYear + maxOffset) / 100L + (maxYear + maxOffset) / 400L)) + 365L - days_0000_to_1970;
//
// OffsetDateTime expected = OffsetDateTime.dateTime(minYear, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC);
// Date cutover = new Date(Long.MIN_VALUE);
// GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
// cal.setGregorianChange(cutover);
// for (long i = minDays; i < maxDays; i++) {
// Instant instant = Instant.instant(i * 24L * 60L * 60L);
// try {
// cal.setTimeInMillis(instant.getEpochSecond() * 1000L);
// assertEquals(cal.get(GregorianCalendar.MONTH), expected.getMonth().getValue() - 1);
// assertEquals(cal.get(GregorianCalendar.DAY_OF_MONTH), expected.getDayOfMonth().getValue());
// expected = expected.plusDays(1);
// } catch (RuntimeException ex) {
// System.out.println("Error: " + i + " " + expected);
// throw ex;
// } catch (Error ex) {
// System.out.println("Error: " + i + " " + expected);
// throw ex;
// }
// }
// }

//-----------------------------------------------------------------------
public void test_toInstant_19700101() {
Expand Down
52 changes: 0 additions & 52 deletions src/test/java/javax/time/calendrical/TestYear.java
Original file line number Diff line number Diff line change
Expand Up @@ -686,58 +686,6 @@ public void test_isValidMonthDay_null() {
assertEquals(test.isValidMonthDay(null), false);
}

// //-----------------------------------------------------------------------
// // getEstimatedEra()
// //-----------------------------------------------------------------------
// public void test_getEstimatedEra() {
// assertEquals(Year.isoYear(2).getEstimatedEra(), Era.AD);
// assertEquals(Year.isoYear(1).getEstimatedEra(), Era.AD);
// assertEquals(Year.isoYear(0).getEstimatedEra(), Era.BC);
// assertEquals(Year.isoYear(-1).getEstimatedEra(), Era.BC);
// }
//
// //-----------------------------------------------------------------------
// // getYearOfEstimatedEra()
// //-----------------------------------------------------------------------
// public void test_getYearOfEstimatedEra() {
// assertEquals(Year.isoYear(2).getYearOfEstimatedEra(), 2);
// assertEquals(Year.isoYear(1).getYearOfEstimatedEra(), 1);
// assertEquals(Year.isoYear(0).getYearOfEstimatedEra(), 1);
// assertEquals(Year.isoYear(-1).getYearOfEstimatedEra(), 2);
// }
//
// //-----------------------------------------------------------------------
// // getISOCentury()
// //-----------------------------------------------------------------------
// public void test_getISOCentury() {
// assertEquals(Year.isoYear(2008).getISOCentury(), 20);
// assertEquals(Year.isoYear(101).getISOCentury(), 1);
// assertEquals(Year.isoYear(100).getISOCentury(), 1);
// assertEquals(Year.isoYear(99).getISOCentury(), 0);
// assertEquals(Year.isoYear(1).getISOCentury(), 0);
// assertEquals(Year.isoYear(0).getISOCentury(), 0);
// assertEquals(Year.isoYear(-1).getISOCentury(), 0);
// assertEquals(Year.isoYear(-99).getISOCentury(), 0);
// assertEquals(Year.isoYear(-100).getISOCentury(), -1);
// assertEquals(Year.isoYear(-101).getISOCentury(), -1);
// }
//
// //-----------------------------------------------------------------------
// // getYearOfISOCentury()
// //-----------------------------------------------------------------------
// public void test_getYearOfISOCentury() {
// assertEquals(Year.isoYear(2008).getYearOfISOCentury(), 8);
// assertEquals(Year.isoYear(101).getYearOfISOCentury(), 1);
// assertEquals(Year.isoYear(100).getYearOfISOCentury(), 0);
// assertEquals(Year.isoYear(99).getYearOfISOCentury(), 99);
// assertEquals(Year.isoYear(1).getYearOfISOCentury(), 1);
// assertEquals(Year.isoYear(0).getYearOfISOCentury(), 0);
// assertEquals(Year.isoYear(-1).getYearOfISOCentury(), 1);
// assertEquals(Year.isoYear(-99).getYearOfISOCentury(), 99);
// assertEquals(Year.isoYear(-100).getYearOfISOCentury(), 0);
// assertEquals(Year.isoYear(-101).getYearOfISOCentury(), 1);
// }

//-----------------------------------------------------------------------
// atMonth(Month)
//-----------------------------------------------------------------------
Expand Down

0 comments on commit e5d1577

Please sign in to comment.