public void testFormattingYear(){
  FormatTester test=new FormatTester();
  Calendar cal=new GregorianCalendar(1999,Calendar.JUNE,2,15,3,6);
  test.test(" y",cal," 1999",DateFormat.YEAR_FIELD);
  test.test(" yy",cal," 99",DateFormat.YEAR_FIELD);
  test.test(" yy",new GregorianCalendar(2001,Calendar.JUNE,2)," 01",DateFormat.YEAR_FIELD);
  test.test(" yy",new GregorianCalendar(2000,Calendar.JUNE,2)," 00",DateFormat.YEAR_FIELD);
  test.test(" yyy",new GregorianCalendar(2000,Calendar.JUNE,2)," 2000",DateFormat.YEAR_FIELD);
  test.test(" yyy",cal," 1999",DateFormat.YEAR_FIELD);
  test.test(" yyyy",cal," 1999",DateFormat.YEAR_FIELD);
  test.test(" yyyyy",cal," 01999",DateFormat.YEAR_FIELD);
  assertFalse(test.testsFailed);
}

public void testFormattingYear ( ) { FormatTester test = new FormatTester ( ) ; Calendar cal = new GregorianCalendar ( 1999 , Calendar . JUNE , 2 , 15 , 3 , 6 ) ; test . test ( " y" , cal , " 1999" , DateFormat . YEAR_FIELD ) ; test . test ( " yy" , cal , " 99" , DateFormat . YEAR_FIELD ) ; test . test ( " yy" , new GregorianCalendar ( 2001 , Calendar . JUNE , 2 ) , " 01" , DateFormat . YEAR_FIELD ) ; test . test ( " yy" , new GregorianCalendar ( 2000 , Calendar . JUNE , 2 ) , " 00" , DateFormat . YEAR_FIELD ) ; test . test ( " yyy" , new GregorianCalendar ( 2000 , Calendar . JUNE , 2 ) , " 2000" , DateFormat . YEAR_FIELD ) ; test . test ( " yyy" , cal , " 1999" , DateFormat . YEAR_FIELD ) ; test . test ( " yyyy" , cal , " 1999" , DateFormat . YEAR_FIELD ) ; test . test ( " yyyyy" , cal , " 01999" , DateFormat . YEAR_FIELD ) ; assertFalse ( test . testsFailed ) ; }
this test assumes unicode behavior where ' y ' and ' yyy ' don ' t truncate , which means that it will fail on the ri .
