Java Code Examples for org.joda.time.chrono.JulianChronology#getInstance()

The following examples show how to use org.joda.time.chrono.JulianChronology#getInstance() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public void testGetDateTime6() throws Exception {
    DateTime test = new DateTime("2004-06-09T12:24:48.501", JulianChronology.getInstance(PARIS));
    assertEquals(2004, test.getYear());
    assertEquals(6, test.getMonthOfYear());
    assertEquals(9, test.getDayOfMonth());
    assertEquals(12, test.getHourOfDay());
    assertEquals(24, test.getMinuteOfHour());
    assertEquals(48, test.getSecondOfMinute());
    assertEquals(501, test.getMillisOfSecond());
    assertEquals(PARIS, test.getZone());
}
 
Example 2
Source File: TestTimeOfDay_Constructors.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Test constructor (Object, Chronology)
 */
public void testConstructor_Object_Chronology() throws Throwable {
    Date date = new Date(TEST_TIME1);
    TimeOfDay test = new TimeOfDay(date, JulianChronology.getInstance());
    assertEquals(JulianChronology.getInstanceUTC(), test.getChronology());
    assertEquals(1 + OFFSET, test.getHourOfDay());
    assertEquals(2, test.getMinuteOfHour());
    assertEquals(3, test.getSecondOfMinute());
    assertEquals(4, test.getMillisOfSecond());
}
 
Example 3
Source File: TestTimeOfDay_Constructors.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Test constructor (long, Chronology)
 */
public void testConstructor_long2_Chronology() throws Throwable {
    TimeOfDay test = new TimeOfDay(TEST_TIME2, JulianChronology.getInstance());
    assertEquals(JulianChronology.getInstanceUTC(), test.getChronology());
    assertEquals(5 + OFFSET, test.getHourOfDay());
    assertEquals(6, test.getMinuteOfHour());
    assertEquals(7, test.getSecondOfMinute());
    assertEquals(8, test.getMillisOfSecond());
}
 
Example 4
Source File: TestTimeOfDay_Constructors.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Test constructor (long, Chronology)
 */
public void testConstructor_long1_Chronology() throws Throwable {
    TimeOfDay test = new TimeOfDay(TEST_TIME1, JulianChronology.getInstance());
    assertEquals(JulianChronology.getInstanceUTC(), test.getChronology());
    assertEquals(1 + OFFSET, test.getHourOfDay());
    assertEquals(2, test.getMinuteOfHour());
    assertEquals(3, test.getSecondOfMinute());
    assertEquals(4, test.getMillisOfSecond());
}
 
Example 5
Source File: TestNullConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
protected void setUp() throws Exception {
    DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
    originalDateTimeZone = DateTimeZone.getDefault();
    originalTimeZone = TimeZone.getDefault();
    originalLocale = Locale.getDefault();
    DateTimeZone.setDefault(DateTimeZone.forID("Europe/London"));
    TimeZone.setDefault(TimeZone.getTimeZone("Europe/London"));
    Locale.setDefault(Locale.UK);
    
    ISO = ISOChronology.getInstance();
    JULIAN = JulianChronology.getInstance();
}
 
Example 6
Source File: TestTimeOfDay_Constructors.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Test constructor (long, Chronology)
 */
public void testConstructor_long2_Chronology() throws Throwable {
    TimeOfDay test = new TimeOfDay(TEST_TIME2, JulianChronology.getInstance());
    assertEquals(JulianChronology.getInstanceUTC(), test.getChronology());
    assertEquals(5 + OFFSET, test.getHourOfDay());
    assertEquals(6, test.getMinuteOfHour());
    assertEquals(7, test.getSecondOfMinute());
    assertEquals(8, test.getMillisOfSecond());
}
 
Example 7
Source File: TestTimeOfDay_Constructors.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Test constructor (Object=null, Chronology)
 */
public void testConstructor_nullObject_Chronology() throws Throwable {
    TimeOfDay test = new TimeOfDay((Object) null, JulianChronology.getInstance());
    assertEquals(JulianChronology.getInstanceUTC(), test.getChronology());
    assertEquals(10 + OFFSET, test.getHourOfDay());
    assertEquals(20, test.getMinuteOfHour());
    assertEquals(30, test.getSecondOfMinute());
    assertEquals(40, test.getMillisOfSecond());
}
 
Example 8
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public void testGetDateTime5() throws Exception {
    DateTime test = new DateTime("2004-06-09T12:24:48.501+02:00", JulianChronology.getInstance(PARIS));
    assertEquals(2004, test.getYear());
    assertEquals(6, test.getMonthOfYear());
    assertEquals(9, test.getDayOfMonth());
    assertEquals(12, test.getHourOfDay());
    assertEquals(24, test.getMinuteOfHour());
    assertEquals(48, test.getSecondOfMinute());
    assertEquals(501, test.getMillisOfSecond());
    assertEquals(PARIS, test.getZone());
}
 
Example 9
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
protected void setUp() throws Exception {
    zone = DateTimeZone.getDefault();
    locale = Locale.getDefault();
    DateTimeZone.setDefault(LONDON);
    Locale.setDefault(Locale.UK);
    
    JULIAN = JulianChronology.getInstance();
    ISO = ISOChronology.getInstance();
}
 
Example 10
Source File: TestNullConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
protected void setUp() throws Exception {
    DateTimeUtils.setCurrentMillisFixed(TEST_TIME_NOW);
    originalDateTimeZone = DateTimeZone.getDefault();
    originalTimeZone = TimeZone.getDefault();
    originalLocale = Locale.getDefault();
    DateTimeZone.setDefault(DateTimeZone.forID("Europe/London"));
    TimeZone.setDefault(TimeZone.getTimeZone("Europe/London"));
    Locale.setDefault(Locale.UK);
    
    ISO = ISOChronology.getInstance();
    JULIAN = JulianChronology.getInstance();
}
 
Example 11
Source File: TestTimeOfDay_Constructors.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Test constructor (long, Chronology)
 */
public void testConstructor_long1_Chronology() throws Throwable {
    TimeOfDay test = new TimeOfDay(TEST_TIME1, JulianChronology.getInstance());
    assertEquals(JulianChronology.getInstanceUTC(), test.getChronology());
    assertEquals(1 + OFFSET, test.getHourOfDay());
    assertEquals(2, test.getMinuteOfHour());
    assertEquals(3, test.getSecondOfMinute());
    assertEquals(4, test.getMillisOfSecond());
}
 
Example 12
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
public void testGetInstantMillis_Object_Chronology() throws Exception {
    DateTime dt = new DateTime(2004, 6, 9, 12, 24, 48, 501, JulianChronology.getInstance(LONDON));
    assertEquals(dt.getMillis(), StringConverter.INSTANCE.getInstantMillis("2004-06-09T12:24:48.501+01:00", JULIAN));
}
 
Example 13
Source File: TestReadableInstantConverter.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
protected void setUp() throws Exception {
    JULIAN = JulianChronology.getInstance();
    ISO = ISOChronology.getInstance();
}
 
Example 14
Source File: TestReadablePeriodConverter.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
protected void setUp() throws Exception {
    JULIAN = JulianChronology.getInstance();
    ISO = ISOChronology.getInstance();
}
 
Example 15
Source File: TestReadablePeriodConverter.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
protected void setUp() throws Exception {
    JULIAN = JulianChronology.getInstance();
    ISO = ISOChronology.getInstance();
}
 
Example 16
Source File: TestSerialization.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
public void testSerializedJulianChronology() throws Exception {
    JulianChronology test = JulianChronology.getInstance(PARIS);
    loadAndCompare(test, "JulianChronology", true);
    inlineCompare(test, true);
}
 
Example 17
Source File: TestCalendarConverter.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
protected void setUp() throws Exception {
    JULIAN = JulianChronology.getInstance();
    ISO = ISOChronology.getInstance();
}
 
Example 18
Source File: TestLongConverter.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
protected void setUp() throws Exception {
    JULIAN = JulianChronology.getInstance();
    ISO = ISOChronology.getInstance();
}
 
Example 19
Source File: TestDateConverter.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
protected void setUp() throws Exception {
    JULIAN = JulianChronology.getInstance();
    COPTIC = CopticChronology.getInstance();
    ISO = ISOChronology.getInstance();
}
 
Example 20
Source File: TestSerialization.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
public void testSerializedJulianChronology() throws Exception {
    JulianChronology test = JulianChronology.getInstance(PARIS);
    loadAndCompare(test, "JulianChronology", true);
    inlineCompare(test, true);
}