Package java.util

Examples of java.util.SimpleTimeZone.useDaylightTime()


    SimpleTimeZone z = new SimpleTimeZone(1234, "Z1",
      Calendar.APRIL, 15, 0, 2*60*60*1000,
      Calendar.NOVEMBER, 22, 0, 2*60*60*1000);
    harness.check(z.getRawOffset(), 1234);
    harness.check(z.getID(), "Z1");
    harness.check(z.useDaylightTime());
    harness.check(z.getDSTSavings(), 60*60*1000);

    // null id should throw exception
    try
    {
View Full Code Here


    SimpleTimeZone z = new SimpleTimeZone(1234, "Z1",
      Calendar.APRIL, 15, 0, 2*60*60*1000,
      Calendar.NOVEMBER, 22, 0, 2*60*60*1000, 123456);
    harness.check(z.getRawOffset(), 1234);
    harness.check(z.getID(), "Z1");
    harness.check(z.useDaylightTime());
    harness.check(z.getDSTSavings(), 123456);
   
    // null id should throw exception
    try
    {
View Full Code Here

      Calendar.APRIL, 15, 0, 2*60*60*1000, SimpleTimeZone.UTC_TIME,
      Calendar.NOVEMBER, 22, 0, 2*60*60*1000, SimpleTimeZone.UTC_TIME,
      123456);
    harness.check(z.getRawOffset(), 1234);
    harness.check(z.getID(), "Z1");
    harness.check(z.useDaylightTime());
    harness.check(z.getDSTSavings(), 123456);

    // null id should throw exception
    try
    {
View Full Code Here

    SimpleTimeZone st = new SimpleTimeZone(1000, "TEST");
    assertEquals("Incorrect TZ constructed", "TEST", st.getID());
    assertTrue("Incorrect TZ constructed: " + "returned wrong offset", st
        .getRawOffset() == 1000);
    assertTrue("Incorrect TZ constructed" + "using daylight savings", !st
        .useDaylightTime());
  }

  /**
   * @tests java.util.SimpleTimeZone#SimpleTimeZone(int, java.lang.String,
View Full Code Here

    assertTrue("Incorrect TZ constructed", !(st
        .inDaylightTime(new GregorianCalendar(1998, Calendar.OCTOBER,
            13).getTime())));
    assertEquals("Incorrect TZ constructed", "TEST", st.getID());
    assertEquals("Incorrect TZ constructed", 1000, st.getRawOffset());
    assertTrue("Incorrect TZ constructed", st.useDaylightTime());
  }

  /**
   * @tests java.util.SimpleTimeZone#SimpleTimeZone(int, java.lang.String,
   *        int, int, int, int, int, int, int, int, int)
View Full Code Here

    assertTrue("Incorrect TZ constructed", !(st
        .inDaylightTime(new GregorianCalendar(1998, Calendar.OCTOBER,
            13).getTime())));
    assertEquals("Incorrect TZ constructed", "TEST", st.getID());
    assertEquals("Incorrect TZ constructed", 1000, st.getRawOffset());
    assertTrue("Incorrect TZ constructed", st.useDaylightTime());
    assertTrue("Incorrect TZ constructed",
        st.getDSTSavings() == 1000 * 60 * 60);
  }

  /**
 
View Full Code Here

    SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
    // Spec indicates that both end and start must be set or result is
    // undefined
    st.setStartRule(Calendar.NOVEMBER, 1, Calendar.SUNDAY, 0);
    st.setEndRule(Calendar.NOVEMBER, -1, Calendar.SUNDAY, 0);
    assertTrue("StartRule improperly set1", st.useDaylightTime());
    assertTrue("StartRule improperly set2", st
        .inDaylightTime(new GregorianCalendar(1998, Calendar.NOVEMBER,
            13).getTime()));
    assertTrue("StartRule improperly set3", !(st
        .inDaylightTime(new GregorianCalendar(1998, Calendar.OCTOBER,
View Full Code Here

    SimpleTimeZone st = (SimpleTimeZone) TimeZone.getDefault().clone();
    // Spec indicates that both end and start must be set or result is
    // undefined
    st.setStartRule(Calendar.NOVEMBER, 8, Calendar.SUNDAY, 1, false);
    st.setEndRule(Calendar.NOVEMBER, 15, Calendar.SUNDAY, 1, true);
    assertTrue("StartRule improperly set1", st.useDaylightTime());
    assertTrue("StartRule improperly set2", st
        .inDaylightTime((new GregorianCalendar(1999, Calendar.NOVEMBER,
            7, 12, 0).getTime())));
    assertTrue("StartRule improperly set3", st
        .inDaylightTime((new GregorianCalendar(1999, Calendar.NOVEMBER,
View Full Code Here

    SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
    // Spec indicates that both end and start must be set or result is
    // undefined
    st.setStartRule(Calendar.NOVEMBER, 1, 1);
    st.setEndRule(Calendar.DECEMBER, 1, 1);
    assertTrue("StartRule improperly set", st.useDaylightTime());
    assertTrue("StartRule improperly set", st
        .inDaylightTime((new GregorianCalendar(1998, Calendar.NOVEMBER,
            13).getTime())));
    assertTrue("StartRule improperly set", !(st
        .inDaylightTime(new GregorianCalendar(1998, Calendar.OCTOBER,
View Full Code Here

    SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
    // Spec indicates that both end and start must be set or result is
    // undefined
    st.setStartRule(Calendar.NOVEMBER, 1, Calendar.SUNDAY, 0);
    st.setEndRule(Calendar.NOVEMBER, -1, Calendar.SUNDAY, 0);
    assertTrue("StartRule improperly set1", st.useDaylightTime());
    assertTrue("StartRule improperly set2", st
        .inDaylightTime((new GregorianCalendar(1998, Calendar.NOVEMBER,
            13).getTime())));
    assertTrue("StartRule improperly set3", !(st
        .inDaylightTime(new GregorianCalendar(1998, Calendar.OCTOBER,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.