stevel 2002/06/17 00:12:06
Modified: src/testcases/org/apache/tools/ant/taskdefs Tag:
ANT_15_BRANCH TStampTest.java
Log:
bug 9890; regression on <tstamp>. fixed by swapping order of eval
Revision Changes Path
No revision
No revision
1.1.2.1 +33 -0
jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/TStampTest.java
Index: TStampTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/TStampTest.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- TStampTest.java 25 Nov 2001 16:01:57 -0000 1.1
+++ TStampTest.java 17 Jun 2002 07:12:06 -0000 1.1.2.1
@@ -100,4 +100,37 @@
assertEquals(expected, today);
}
+ /**
+ * verifies that custom props have priority over the
+ * originals
+ * @throws Exception
+ */
+ public void testWriteOrder() throws Exception {
+ 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);
+
+ }
+ /**
+ * verifies that custom props have priority over the
+ * originals
+ * @throws Exception
+ */
+ public void testPrefix() throws Exception {
+ tstamp.setPrefix("prefix");
+ tstamp.execute();
+ String prop= project.getProperty("prefix.DSTAMP");
+ assertNotNull(prop);
+ }
+
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>