Author: jtolentino
Date: Fri Dec  8 10:18:24 2006
New Revision: 484683

URL: http://svn.apache.org/viewvc?view=rev&rev=484683
Log:
Additional configuration test and refactoring.

Added:
    
maven/sandbox/plugins/maven-swizzle-plugin/src/test/resources/unit/resolved-issues-configuration-test.xml
      - copied unchanged from r484675, 
maven/sandbox/plugins/maven-swizzle-plugin/src/test/resources/unit/report-configuration-test.xml
    
maven/sandbox/plugins/maven-swizzle-plugin/src/test/resources/unit/votes-configuration-test.xml
Removed:
    
maven/sandbox/plugins/maven-swizzle-plugin/src/test/resources/unit/report-configuration-test.xml
Modified:
    
maven/sandbox/plugins/maven-swizzle-plugin/src/test/java/org/apache/maven/plugin/swizzle/ReportMojoTest.java

Modified: 
maven/sandbox/plugins/maven-swizzle-plugin/src/test/java/org/apache/maven/plugin/swizzle/ReportMojoTest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-swizzle-plugin/src/test/java/org/apache/maven/plugin/swizzle/ReportMojoTest.java?view=diff&rev=484683&r1=484682&r2=484683
==============================================================================
--- 
maven/sandbox/plugins/maven-swizzle-plugin/src/test/java/org/apache/maven/plugin/swizzle/ReportMojoTest.java
 (original)
+++ 
maven/sandbox/plugins/maven-swizzle-plugin/src/test/java/org/apache/maven/plugin/swizzle/ReportMojoTest.java
 Fri Dec  8 10:18:24 2006
@@ -41,16 +41,26 @@
         assertNotNull( mojo );
     }
 
-    public void testConfiguration()
+    public void testResolvedIssuesConfiguration()
         throws Exception
     {
-        File pom = new File( getBasedir(), 
"target/test-classes/unit/report-configuration-test.xml" );
+        testConfiguration( "resolved-issues-configuration-test.xml", 
"ResolvedIssuesExpectedResult.txt",
+                           "ResolvedIssuesActualResult.txt" );
+    }
 
-        String expected = getBasedir() + 
"/target/test-classes/unit/ResolvedIssuesExpectedResult.txt";
-        String actual = getBasedir() + 
"/target/test-classes/unit/ResolvedIssuesActualResult.txt";
+    public void testVotesConfiguration()
+        throws Exception
+    {
+        testConfiguration( "votes-configuration-test.xml", 
"VotesExpectedResult.txt", "VotesActualResult.txt" );
+    }
+
+    private void testConfiguration( String configurationFile, String 
expectedResult, String actualResult )
+        throws Exception
+    {
+        File pom = new File( getBasedir(), "target/test-classes/unit/" + 
configurationFile );
 
-        File expectedFile = new File( expected );
-        File actualFile = new File( actual );
+        File expectedFile = new File( getBasedir() + 
"/target/test-classes/unit/" + expectedResult );
+        File actualFile = new File( getBasedir() + 
"/target/test-classes/unit/" + actualResult );
 
         if ( actualFile.exists() )
         {
@@ -63,8 +73,8 @@
 
         mojo.execute();
 
-        assertNotNull( expected );
-        assertNotNull( actual );
+        assertNotNull( expectedFile );
+        assertNotNull( actualFile );
 
         assertTrue( actualFile.exists() );
         assertTrue( expectedFile.exists() );
@@ -73,7 +83,6 @@
         String actualString = fileToString( actualFile.getAbsolutePath() );
 
         assertEquals( expectedString, actualString );
-
     }
 
     private static String fileToString( String inputFilename )

Added: 
maven/sandbox/plugins/maven-swizzle-plugin/src/test/resources/unit/votes-configuration-test.xml
URL: 
http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-swizzle-plugin/src/test/resources/unit/votes-configuration-test.xml?view=auto&rev=484683
==============================================================================
--- 
maven/sandbox/plugins/maven-swizzle-plugin/src/test/resources/unit/votes-configuration-test.xml
 (added)
+++ 
maven/sandbox/plugins/maven-swizzle-plugin/src/test/resources/unit/votes-configuration-test.xml
 Fri Dec  8 10:18:24 2006
@@ -0,0 +1,41 @@
+<!--
+
+Copyright 2006
+
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <name>swizzle-plugin-test</name>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-swizzle-plugin</artifactId>
+        <configuration>
+          <reportConfiguration>
+            <jiraServerUrl>http://jira.codehaus.org</jiraServerUrl>
+            <projectKey>SWIZZLE</projectKey>
+            <projectVersion>*</projectVersion>
+            <template>org/codehaus/plexus/swizzle/Votes.vm</template>
+          </reportConfiguration>
+          <result>target/test-classes/unit/VotesActualResult.txt</result>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>


Reply via email to