response = new DefaultCalendarDate(this, null, null, calendarDate); return response;
/** Test of setCalendarDate method, of class DefaultCalendarDate. */ @Test public void testSetCalendarDate() { int[] result = calendarDate1.getCalendarDate(); int[] caldate = {1995, 5, 5}; ((DefaultCalendarDate) calendarDate1).setCalendarDate(caldate); assertThat(calendarDate1.getCalendarDate(), not(equalTo((result)))); }
/** Test of setCalendarEraName method, of class DefaultCalendarDate. */ @Test public void testSetCalendarEraName() { InternationalString result = calendarDate1.getCalendarEraName(); ((DefaultCalendarDate) calendarDate1) .setCalendarEraName(new SimpleInternationalString("new Era")); assertFalse(calendarDate1.getCalendarEraName().equals(result)); }
@Before public void setUp() { NamedIdentifier name = new NamedIdentifier(Citations.CRS, "Gregorian calendar"); TemporalReferenceSystem frame = new DefaultTemporalReferenceSystem(name, null); int[] cal1 = {1981, 6, 25}; int[] cal2 = {2000, 1, 1}; InternationalString cal_era = new SimpleInternationalString("Cenozoic"); calendarDate1 = new DefaultCalendarDate(frame, null, cal_era, cal1); calendarDate2 = new DefaultCalendarDate(frame, null, cal_era, cal2); }
/** Test of setReferenceDate method, of class DefaultCalendarEra. */ @Test public void testSetReferenceDate() { CalendarDate result = calendarEra1.getReferenceDate(); int[] date = {1950, 6, 10}; ((DefaultCalendarEra) calendarEra1) .setReferenceDate(new DefaultCalendarDate(null, null, null, date)); assertFalse(calendarEra1.getReferenceDate().equals(result)); }
/** Test of dateTrans method, of class DefaultCalendar. */ @Test public void testDateTrans_CalendarDate_ClockTime() { int[] cal = {2012, 9, 10}; CalendarDate calendarDate = new DefaultCalendarDate( calendar1, IndeterminateValue.NOW, new SimpleInternationalString("new Era"), cal); Number[] clock = {12, 10, 5.488}; ClockTime clockTime = new DefaultClockTime(calendar1, IndeterminateValue.NOW, clock); JulianDate result = calendar1.dateTrans(calendarDate, clockTime); assertTrue(calendar2.dateTrans(calendarDate, clockTime).equals(result)); }
int[] calendarDate2 = {400, 1, 1}; CalendarDate referenceDate1 = new DefaultCalendarDate( frame1, IndeterminateValue.BEFORE, calendarDate1); CalendarDate referenceDate2 = new DefaultCalendarDate( frame2, IndeterminateValue.NOW,
response = new DefaultCalendarDate(this, null, null, calendarDate); return response;
response = new DefaultCalendarDate(this, null, null, calendarDate); return response;
/** Test of setBasis method, of class DefaultCalendar. */ @Test public void testSetBasis() throws ParseException { Collection<CalendarEra> result = calendar1.getBasis(); int[] calendarDate = {1, 1, 1}; CalendarEra calendarEra = new DefaultCalendarEra( new SimpleInternationalString("Babylonian calendar"), new SimpleInternationalString( "Ascension of Nebuchadnezzar II to the throne of Babylon"), new DefaultCalendarDate(calendar1, null, null, calendarDate), new DefaultJulianDate(calendar1, null, 1721423.25), new DefaultPeriod( new DefaultInstant( new DefaultPosition( new DefaultJulianDate(calendar1, null, 2087769))), new DefaultInstant( new DefaultPosition( new DefaultJulianDate(calendar1, null, 2299160))))); Collection<CalendarEra> collection = new ArrayList<CalendarEra>(); collection.add(calendarEra); ((DefaultCalendar) calendar1).setBasis(collection); assertFalse(calendar1.getBasis().equals(result)); }