maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r727870 - /maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1830ShowVersionTest.java
Date Fri, 19 Dec 2008 00:46:21 GMT
Author: brett
Date: Thu Dec 18 16:46:21 2008
New Revision: 727870

URL: http://svn.apache.org/viewvc?rev=727870&view=rev
Log:
[MNG-1830] validate date format

Modified:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1830ShowVersionTest.java

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1830ShowVersionTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1830ShowVersionTest.java?rev=727870&r1=727869&r2=727870&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1830ShowVersionTest.java
(original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1830ShowVersionTest.java
Thu Dec 18 16:46:21 2008
@@ -19,13 +19,13 @@
  * under the License.
  */
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
 import java.io.File;
+import java.text.SimpleDateFormat;
 import java.util.Collections;
+import java.util.Date;
 import java.util.List;
-import java.util.Properties;
+
+import org.apache.maven.it.util.ResourceExtractor;
 
 /**
  * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-1830">MNG-1830</a>.
@@ -53,12 +53,18 @@
 
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
         List cliOptions = Collections.singletonList( "-X" );
-        verifier.setCliOptions( cliOptions  );
+        verifier.setCliOptions( cliOptions );
         verifier.executeGoal( "clean" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
-        
+
         String line = (String) verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(),
false ).get( 1 );
         assertTrue( line, line.matches( "^Apache Maven (.*?) \\(r[0-9]+; .*\\)$" ) );
+
+        // check timestamp parses
+        String timestamp = line.substring( line.lastIndexOf( ';' ) + 1, line.length() - 1
).trim();
+        SimpleDateFormat fmt = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ssZ" );
+        Date date = fmt.parse( timestamp );
+        assertEquals( timestamp, fmt.format( date ) );
     }
 }



Mime
View raw message