{
// too short year
String gt = "200";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// non-digits in year
gt = "2XX8";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// too short month
gt = "20081";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// non-digits in month
gt = "20081X";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// too short day
gt = "2008122";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// non-digits in day
gt = "2008122X";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// too short hour
gt = "200812211";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// non-digits in hour
gt = "20081221X1";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// too short minute
gt = "20081221121";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// non-digits in minute
gt = "20081221121X";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// too short second
gt = "2008122112131";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// non-digits in minute
gt = "2008122112131X";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// missing time zone
gt = "2008010212";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// missing time zone
gt = "200801021213";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// missing time zone
gt = "20080102121314";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// no digit
gt = "2008010212X";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// no digit
gt = "200801021213X";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// no digit
gt = "20080102121314X";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// missing time zone
gt = "20080102121314,1";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// time zone is not last char
gt = "20080102121314ZX";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// time zone is not last char
gt = "20080102121314+0430X";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected
}
// no fraction digit
gt = "20080102121314,Z";
try
{
new GeneralizedTime( gt );
fail( "Expected ParseException" );
}
catch ( ParseException pe )
{
// expected