コード例 #1
0
ファイル: DateTimeZone_Test.java プロジェクト: rr-develop/MPS
 public void test_prague() throws Exception {
   DateTimeZone prg = DateTimeZone.forID("Europe/Prague");
   Assert.assertEquals(prg, DateTimeZone.forID(prg.getID()));
   Assert.assertEquals("Europe/Prague", prg.getID());
   Assert.assertEquals(
       "Central European Time",
       prg.getName(DateTimeOperations.convert(new DateTime(2008, 1, 1, 12, 0, 0, 0, prg)), null));
   Assert.assertEquals(
       "CET",
       prg.getShortName(
           DateTimeOperations.convert(new DateTime(2008, 1, 1, 12, 0, 0, 0, prg)), null));
   Assert.assertEquals(
       "Central European Summer Time",
       prg.getName(DateTimeOperations.convert(new DateTime(2008, 7, 1, 12, 0, 0, 0, prg)), null));
   Assert.assertEquals(
       "CEST",
       prg.getShortName(
           DateTimeOperations.convert(new DateTime(2008, 7, 1, 12, 0, 0, 0, prg)), null));
 }
コード例 #2
0
ファイル: DateTimeZone_Test.java プロジェクト: rr-develop/MPS
 public void test_london() throws Exception {
   DateTimeZone london = DateTimeZone.forID("Europe/London");
   Assert.assertEquals(london, DateTimeZone.forID(london.getID()));
   Assert.assertEquals("Europe/London", london.getID());
   Assert.assertEquals(
       "Greenwich Mean Time",
       london.getName(
           DateTimeOperations.convert(new DateTime(2008, 1, 1, 12, 0, 0, 0, london)), null));
   Assert.assertEquals(
       "GMT",
       london.getShortName(
           DateTimeOperations.convert(new DateTime(2008, 1, 1, 12, 0, 0, 0, london)), null));
   Assert.assertEquals(
       "British Summer Time",
       london.getName(
           DateTimeOperations.convert(new DateTime(2008, 7, 1, 12, 0, 0, 0, london)), null));
   Assert.assertEquals(
       "BST",
       london.getShortName(
           DateTimeOperations.convert(new DateTime(2008, 7, 1, 12, 0, 0, 0, london)), null));
 }