test/java/time/test/java/util/TestFormatter.java

Print this page




  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 package test.java.util;
  24 
  25 import java.time.Instant;
  26 import java.time.OffsetDateTime;
  27 import java.time.ZonedDateTime;
  28 import java.time.temporal.ChronoField;
  29 
  30 import java.util.*;
  31 
  32 import org.testng.annotations.Test;
  33 import static org.testng.Assert.assertEquals;
  34 
  35 /* @test
  36  * @summary Unit test for j.u.Formatter threeten date/time support
  37  */
  38 @Test(groups={"implementation"})
  39 public class TestFormatter {
  40 
  41     // time
  42     private static String[] fmtStrTime = new String[] {
  43          "H:[%tH] I:[%1$tI] k:[%1$tk] l:[%1$tl] M:[%1$tM] S:[%1$tS] L:[%1$tL] N:[%1$tN] p:[%1$tp]",
  44          "H:[%TH] I:[%1$TI] k:[%1$Tk] l:[%1$Tl] M:[%1$TM] S:[%1$TS] L:[%1$TL] N:[%1$TN] p:[%1$Tp]",
  45          "R:[%tR] T:[%1$tT] r:[%1$tr]",
  46          "R:[%TR] T:[%1$TT] r:[%1$Tr]"
  47     };
  48     // date
  49     private static String[] fmtStrDate = new String[] {
  50         "B:[%tB] b:[%1$tb] h:[%1$th] A:[%1$tA] a:[%1$ta] C:[%1$tC] Y:[%1$tY] y:[%1$ty] j:[%1$tj] m:[%1$tm] d:[%1$td] e:[%1$te]",
  51         "B:[%TB] b:[%1$Tb] h:[%1$Th] A:[%1$TA] a:[%1$Ta] C:[%1$TC] Y:[%1$TY] y:[%1$Ty] j:[%1$Tj] m:[%1$Tm] d:[%1$Td] e:[%1$Te]",
  52         "D:[%tD] F:[%1$tF]",
  53         "D:[%TD] F:[%1$TF]"
  54     };
  55 
  56     private int total = 0;
  57     private int failure = 0;
  58     private boolean verbose = true;




  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 package test.java.util;
  24 
  25 import java.time.Instant;
  26 import java.time.OffsetDateTime;
  27 import java.time.ZonedDateTime;
  28 import java.time.temporal.ChronoField;
  29 
  30 import java.util.*;
  31 
  32 import org.testng.annotations.Test;
  33 import static org.testng.Assert.assertEquals;
  34 
  35 /* @test
  36  * @summary Unit test for j.u.Formatter threeten date/time support
  37  */
  38 @Test
  39 public class TestFormatter {
  40 
  41     // time
  42     private static String[] fmtStrTime = new String[] {
  43          "H:[%tH] I:[%1$tI] k:[%1$tk] l:[%1$tl] M:[%1$tM] S:[%1$tS] L:[%1$tL] N:[%1$tN] p:[%1$tp]",
  44          "H:[%TH] I:[%1$TI] k:[%1$Tk] l:[%1$Tl] M:[%1$TM] S:[%1$TS] L:[%1$TL] N:[%1$TN] p:[%1$Tp]",
  45          "R:[%tR] T:[%1$tT] r:[%1$tr]",
  46          "R:[%TR] T:[%1$TT] r:[%1$Tr]"
  47     };
  48     // date
  49     private static String[] fmtStrDate = new String[] {
  50         "B:[%tB] b:[%1$tb] h:[%1$th] A:[%1$tA] a:[%1$ta] C:[%1$tC] Y:[%1$tY] y:[%1$ty] j:[%1$tj] m:[%1$tm] d:[%1$td] e:[%1$te]",
  51         "B:[%TB] b:[%1$Tb] h:[%1$Th] A:[%1$TA] a:[%1$Ta] C:[%1$TC] Y:[%1$TY] y:[%1$Ty] j:[%1$Tj] m:[%1$Tm] d:[%1$Td] e:[%1$Te]",
  52         "D:[%tD] F:[%1$tF]",
  53         "D:[%TD] F:[%1$TF]"
  54     };
  55 
  56     private int total = 0;
  57     private int failure = 0;
  58     private boolean verbose = true;