Methods Summary |
---|
protected void | setUp()
location = new Location("test.xml");
project = new Project();
tstamp = new Tstamp();
tstamp.setLocation(location);
tstamp.setProject(project);
|
public void | testFormatPrefix()
Tstamp.CustomFormat format = tstamp.createFormat();
format.setProperty("format");
format.setPattern("HH:mm:ss z");
format.setTimezone("GMT");
tstamp.setPrefix("prefix");
tstamp.execute();
String prop= project.getProperty("prefix.format");
assertNotNull(prop);
|
public void | testPrefix()verifies that custom props have priority over the
originals
tstamp.setPrefix("prefix");
tstamp.execute();
String prop= project.getProperty("prefix.DSTAMP");
assertNotNull(prop);
|
public void | testTimeZone()
Tstamp.CustomFormat format = tstamp.createFormat();
format.setProperty("today");
format.setPattern("HH:mm:ss z");
format.setTimezone("GMT");
Date date = Calendar.getInstance().getTime();
format.execute(project, date, location);
String today = project.getProperty("today");
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss z");
sdf.setTimeZone( TimeZone.getTimeZone("GMT") );
String expected = sdf.format(date);
assertEquals(expected, today);
|
public void | testWriteOrder()verifies that custom props have priority over the
originals
Tstamp.CustomFormat format = tstamp.createFormat();
format.setProperty("TODAY");
format.setPattern("HH:mm:ss z");
format.setTimezone("GMT");
Date date = Calendar.getInstance().getTime();
format.execute(project, date, location);
String today = project.getProperty("TODAY");
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss z");
sdf.setTimeZone( TimeZone.getTimeZone("GMT") );
String expected = sdf.format(date);
assertEquals(expected, today);
|