You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2007/05/27 15:23:57 UTC
svn commit: r541986 [1/2] - in
/maven/plugins/trunk/maven-project-info-reports-plugin: ./
src/main/java/org/apache/maven/report/projectinfo/ src/main/resources/
src/test/java/org/apache/maven/report/projectinfo/
src/test/java/org/apache/maven/report/pr...
Author: vsiveton
Date: Sun May 27 06:23:55 2007
New Revision: 541986
URL: http://svn.apache.org/viewvc?view=rev&rev=541986
Log:
MPIR-43: Use the plugin testing harness and add tests for the project-info-report mojos
o Finished Edwin's work to go ahead
o Bumped to maven-plugin-testing-harness:1.0
o FYI using httpunit to test the generated reports
Added:
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/CimStub.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DefaultArtifactHandlerStub.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DependenciesStub.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DependencyConvergenceStub.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IndexStub.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IssueTrackingStub.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/LicenseStub.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/MailingListStub.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoPluginArtifactStub.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectTeamStub.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ScmStub.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/SubProject1Stub.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/SubProject2Stub.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/SummaryStub.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/plugin-configs/subproject1/
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/plugin-configs/subproject1/pom.xml (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/plugin-configs/subproject2/
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/plugin-configs/subproject2/pom.xml (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/resources/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.xml (with props)
Removed:
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/AbstractHttpUnitReportTestCase.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/AbstractMavenReportTestCase.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/DependenciesReportHttpUnitTest.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ScmReportHttpUnitTest.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/resources/org/apache/maven/report/projectinfo/AbstractMavenReportTestCase.xml
Modified:
maven/plugins/trunk/maven-project-info-reports-plugin/pom.xml
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ProjectSummaryReport.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report.properties
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/CimReportTest.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/DependenciesReportTest.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/DependencyConvergenceReportTest.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/IssueTrackingReportTest.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/LicenseReportTest.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/MailingListsReportTest.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ProjectIndexPageReportTest.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ProjectSummaryReportTest.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ScmReportTest.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/TeamListReportTest.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoProjectStub.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/plugin-configs/cim-plugin-config.xml
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/plugin-configs/dependencies-plugin-config.xml
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/plugin-configs/dependency-convergence-plugin-config.xml
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/plugin-configs/index-plugin-config.xml
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/plugin-configs/issue-tracking-plugin-config.xml
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/plugin-configs/license-plugin-config.xml
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/plugin-configs/mailing-list-plugin-config.xml
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/plugin-configs/project-team-plugin-config.xml
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/plugin-configs/scm-plugin-config.xml
maven/plugins/trunk/maven-project-info-reports-plugin/src/test/plugin-configs/summary-plugin-config.xml
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/pom.xml?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/pom.xml Sun May 27 06:23:55 2007
@@ -17,7 +17,9 @@
specific language governing permissions and limitations
under the License.
-->
-<project xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd' xmlns='http://maven.apache.org/POM/4.0.0'>
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0">
<parent>
<artifactId>maven-plugins</artifactId>
<groupId>org.apache.maven.plugins</groupId>
@@ -55,10 +57,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
- <exclude>**/Abstract*Test.java</exclude>
<exclude>**/Abstract*TestCase.java</exclude>
- <exclude>**/*HttpUnitTest.java</exclude>
- <exclude>**/*ReportTest.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -186,7 +185,7 @@
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
- <version>1.0-beta-1</version>
+ <version>1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ProjectSummaryReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ProjectSummaryReport.java?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ProjectSummaryReport.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ProjectSummaryReport.java Sun May 27 06:23:55 2007
@@ -119,7 +119,7 @@
Organization organization = project.getOrganization();
if ( organization == null )
{
- paragraph( "This project does not belong to an organization." );
+ paragraph( getReportString( "report.summary.noorganization" ) );
}
else
{
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report.properties?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report.properties (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report.properties Sun May 27 06:23:55 2007
@@ -187,6 +187,7 @@
report.summary.organization.name = Name
report.summary.organization.title = Project Organization
report.summary.organization.url = URL
+report.summary.noorganization = This project does not belong to an organization.
report.summary.title = Project Summary
report.summary.value = Value
report.team-list.contributors.actualtime = Actual Time (GMT)
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_fr.properties Sun May 27 06:23:55 2007
@@ -166,6 +166,7 @@
report.summary.organization.name = Nom
report.summary.organization.title = Organisation
report.summary.organization.url = URL
+report.summary.noorganization = Ce projet n\u0092appartient pas \u00E0 une organisation.
report.summary.title = R\u00E9sum\u00E9 du projet
report.summary.value = Valeur
report.team-list.contributors.actualtime = Heure actuelle (GMT)
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java Sun May 27 06:23:55 2007
@@ -19,39 +19,168 @@
* under the License.
*/
+import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.plugin.Mojo;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+import org.apache.maven.profiles.DefaultProfileManager;
+import org.apache.maven.profiles.ProfileManager;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectBuilder;
import org.apache.maven.reporting.MavenReport;
+import org.codehaus.plexus.i18n.I18N;
+import org.codehaus.plexus.util.StringUtils;
import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Locale;
/**
+ * Abstract class to test reports generation with <a href="http://www.httpunit.org/">HTTPUnit</a> framework.
+ *
* @author Edwin Punzalan
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
*/
-public class AbstractProjectInfoTestCase
+public abstract class AbstractProjectInfoTestCase
extends AbstractMojoTestCase
{
+ /**
+ * The default locale is English.
+ */
+ protected static final Locale DEFAULT_LOCALE = Locale.ENGLISH;
+
+ /**
+ * The current project to be test.
+ */
+ private MavenProject testMavenProject;
+
+ /**
+ * The I18N plexus component.
+ */
+ private I18N i18n;
+
+ /**
+ * @see org.apache.maven.plugin.testing.AbstractMojoTestCase#setUp()
+ */
+ protected void setUp()
+ throws Exception
+ {
+ // required for mojo lookups to work
+ super.setUp();
+
+ i18n = (I18N) getContainer().lookup( I18N.ROLE );
+
+ File f = new File( getBasedir(), "target/local-repo/" );
+ f.mkdirs();
+
+ // Set the default Locale
+ Locale.setDefault( DEFAULT_LOCALE );
+ }
+
+ /**
+ * @see org.codehaus.plexus.PlexusTestCase#getCustomConfiguration()
+ */
+ protected InputStream getCustomConfiguration()
+ throws Exception
+ {
+ // Allow sub classes to have their own configuration...
+ if ( super.getConfiguration() == null )
+ {
+ String className = AbstractProjectInfoTestCase.class.getName();
+
+ String config = className.substring( className.lastIndexOf( "." ) + 1 ) + ".xml";
+
+ return AbstractProjectInfoTestCase.class.getResourceAsStream( config );
+ }
+
+ return null;
+ }
+
+ /**
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown()
+ throws Exception
+ {
+ // nop
+ }
+
+ /**
+ * Gets a trimmed String for the given key from the resource bundle defined by Plexus.
+ *
+ * @param key the key for the desired string
+ * @return the string for the given key
+ * @throws IllegalArgumentException if the parameter is empty.
+ */
+ protected String getString( String key )
+ {
+ if ( StringUtils.isEmpty( key ) )
+ {
+ throw new IllegalArgumentException( "The key cannot be empty" );
+ }
+
+ return i18n.getString( key, Locale.getDefault() ).trim();
+ }
+
+ /**
+ * Get the current Maven project
+ *
+ * @return the maven project
+ */
+ protected MavenProject getTestMavenProject()
+ {
+ return testMavenProject;
+ }
+
+ /**
+ * Get the generated report as file in the test maven project.
+ *
+ * @return the generated report as file
+ * @throws IOException if the return file doesnt exist
+ */
+ protected File getGeneratedReport(String name )
+ throws IOException
+ {
+ String outputDirectory = getBasedir() + "/target/test-harness/" + getTestMavenProject().getArtifactId();
+
+ File report = new File( outputDirectory, name );
+ if ( !report.exists() )
+ {
+ throw new IOException( "File not found. Attempted :" + report );
+ }
+
+ return report;
+ }
+
+ /**
+ * Generate the report and return the generated file
+ *
+ * @param goal
+ * @param pluginXml
+ * @return the generated HTML file
+ * @throws Exception if any
+ */
protected File generateReport( String goal, String pluginXml )
throws Exception
{
File pluginXmlFile = new File( getBasedir(), "src/test/plugin-configs/" + pluginXml );
-
Mojo mojo = lookupMojo( goal, pluginXmlFile );
-
assertNotNull( "Mojo found.", mojo );
mojo.execute();
- MavenReport reportMojo = (MavenReport) mojo;
-
- File outputDir = reportMojo.getReportOutputDirectory();
+ MavenProjectBuilder builder = (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE );
+ ProfileManager profileManager = new DefaultProfileManager( getContainer() );
- String filename = reportMojo.getOutputName() + ".html";
+ ArtifactRepository localRepository = ( ArtifactRepository ) getVariableValueFromObject( mojo, "localRepository" );
- File outputHtml = new File( outputDir, filename );
+ testMavenProject = builder.buildWithDependencies( pluginXmlFile, localRepository, profileManager );
-// assertTrue( "Test html generated", outputHtml.exists() );
+ MavenReport reportMojo = (MavenReport) mojo;
+ File outputDir = reportMojo.getReportOutputDirectory();
+ String filename = reportMojo.getOutputName() + ".html";
- return outputHtml;
+ return new File( outputDir, filename );
}
}
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/CimReportTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/CimReportTest.java?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/CimReportTest.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/CimReportTest.java Sun May 27 06:23:55 2007
@@ -19,15 +19,56 @@
* under the License.
*/
+import java.net.URL;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.TextBlock;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
/**
* @author Edwin Punzalan
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
*/
public class CimReportTest
extends AbstractProjectInfoTestCase
{
+ /**
+ * WebConversation object
+ */
+ private static final WebConversation webConversation = new WebConversation();
+
+ /**
+ * Test report
+ *
+ * @throws Exception if any
+ */
public void testReport()
throws Exception
{
generateReport( "cim", "cim-plugin-config.xml" );
+ assertTrue( "Test html generated", getGeneratedReport( "integration.html" ).exists() );
+
+ URL reportURL = getGeneratedReport( "integration.html" ).toURL();
+ assertNotNull( reportURL );
+
+ // HTTPUnit
+ WebRequest request = new GetMethodWebRequest( reportURL.toString() );
+ WebResponse response = webConversation.getResponse( request );
+
+ // Basic HTML tests
+ assertTrue( response.isHTML() );
+ assertTrue( response.getContentLength() > 0 );
+
+ // Test the Page title
+ assertEquals( getString( "report.cim.name" ) + " - " + getString( "report.cim.title" ),
+ response.getTitle() );
+
+ // Test the texts
+ TextBlock[] textBlocks = response.getTextBlocks();
+ assertEquals( textBlocks[0].getText(), getString( "report.cim.name" ) );
+ assertEquals( textBlocks[1].getText(), getString( "report.cim.nocim" ) );
}
}
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/DependenciesReportTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/DependenciesReportTest.java?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/DependenciesReportTest.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/DependenciesReportTest.java Sun May 27 06:23:55 2007
@@ -19,15 +19,74 @@
* under the License.
*/
+import java.net.URL;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.TextBlock;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+import com.meterware.httpunit.WebTable;
+
/**
* @author Edwin Punzalan
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
*/
public class DependenciesReportTest
extends AbstractProjectInfoTestCase
{
+ /**
+ * WebConversation object
+ */
+ private static final WebConversation webConversation = new WebConversation();
+
+ /**
+ * Test report
+ *
+ * @throws Exception if any
+ */
public void testReport()
throws Exception
{
generateReport( "dependencies", "dependencies-plugin-config.xml" );
+ assertTrue( "Test html generated", getGeneratedReport( "dependencies.html" ).exists() );
+
+ URL reportURL = getGeneratedReport( "dependencies.html" ).toURL();
+ assertNotNull( reportURL );
+
+ // HTTPUnit
+ WebRequest request = new GetMethodWebRequest( reportURL.toString() );
+ WebResponse response = webConversation.getResponse( request );
+
+ // Basic HTML tests
+ assertTrue( response.isHTML() );
+ assertTrue( response.getContentLength() > 0 );
+
+ // Test the Page title
+ assertEquals( getString( "report.dependencies.name" ) + " - " + getString( "report.dependencies.title" ),
+ response.getTitle() );
+
+ // Test the tables
+ WebTable[] webTables = response.getTables();
+ assertEquals( webTables.length, 2 );
+
+ assertEquals( webTables[0].getColumnCount(), 6 );
+ assertEquals( webTables[0].getRowCount(), 1 + getTestMavenProject().getDependencies().size() );
+
+ assertEquals( webTables[1].getColumnCount(), 6 );
+
+ // Test the texts
+ TextBlock[] textBlocks = response.getTextBlocks();
+ assertEquals( textBlocks[0].getText(), getString( "report.dependencies.title" ) );
+ assertEquals( textBlocks[1].getText(), "test" );
+ assertEquals( textBlocks[2].getText(), getString( "report.dependencies.intro.test" ) );
+ assertEquals( textBlocks[3].getText(), getString( "report.transitivedependencies.title" ) );
+ assertEquals( textBlocks[4].getText(), getString( "report.transitivedependencies.intro" ) );
+ assertEquals( textBlocks[5].getText(), "test" );
+ assertEquals( textBlocks[6].getText(), getString( "report.dependencies.intro.test" ) );
+ assertEquals( textBlocks[7].getText(), getString( "report.dependencies.graph.title" ) );
+ assertEquals( textBlocks[8].getText(), getString( "report.dependencies.graph.tree.title" ) );
+ assertEquals( textBlocks[10].getText(), getString( "report.dependencies.graph.tables.title" ) );
}
}
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/DependencyConvergenceReportTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/DependencyConvergenceReportTest.java?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/DependencyConvergenceReportTest.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/DependencyConvergenceReportTest.java Sun May 27 06:23:55 2007
@@ -19,15 +19,55 @@
* under the License.
*/
+import java.net.URL;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.TextBlock;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
/**
* @author Edwin Punzalan
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
*/
public class DependencyConvergenceReportTest
extends AbstractProjectInfoTestCase
{
+ /**
+ * WebConversation object
+ */
+ private static final WebConversation webConversation = new WebConversation();
+
+ /**
+ * Test report
+ *
+ * @throws Exception if any
+ */
public void testReport()
throws Exception
{
generateReport( "dependency-convergence", "dependency-convergence-plugin-config.xml" );
+ assertTrue( "Test html generated", getGeneratedReport( "dependency-convergence.html" ).exists() );
+
+ URL reportURL = getGeneratedReport( "dependency-convergence.html" ).toURL();
+ assertNotNull( reportURL );
+
+ // HTTPUnit
+ WebRequest request = new GetMethodWebRequest( reportURL.toString() );
+ WebResponse response = webConversation.getResponse( request );
+
+ // Basic HTML tests
+ assertTrue( response.isHTML() );
+ assertTrue( response.getContentLength() > 0 );
+
+ // Test the Page title
+ assertEquals( getString( "report.dependency-convergence.name" ) + " - " + getString( "report.dependency-convergence.title" ),
+ response.getTitle() );
+
+ // Test the texts
+ TextBlock[] textBlocks = response.getTextBlocks();
+ assertEquals( textBlocks[0].getText(), getString( "report.dependency-convergence.title" ) );
}
}
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/IssueTrackingReportTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/IssueTrackingReportTest.java?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/IssueTrackingReportTest.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/IssueTrackingReportTest.java Sun May 27 06:23:55 2007
@@ -19,15 +19,65 @@
* under the License.
*/
+import java.net.URL;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.TextBlock;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebLink;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
/**
* @author Edwin Punzalan
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
*/
public class IssueTrackingReportTest
extends AbstractProjectInfoTestCase
{
+ /**
+ * WebConversation object
+ */
+ private static final WebConversation webConversation = new WebConversation();
+
+ /**
+ * Test report
+ *
+ * @throws Exception if any
+ */
public void testReport()
throws Exception
{
generateReport( "issue-tracking", "issue-tracking-plugin-config.xml" );
+ assertTrue( "Test html generated", getGeneratedReport( "issue-tracking.html" ).exists() );
+
+ URL reportURL = getGeneratedReport( "issue-tracking.html" ).toURL();
+ assertNotNull( reportURL );
+
+ // HTTPUnit
+ WebRequest request = new GetMethodWebRequest( reportURL.toString() );
+ WebResponse response = webConversation.getResponse( request );
+
+ // Basic HTML tests
+ assertTrue( response.isHTML() );
+ assertTrue( response.getContentLength() > 0 );
+
+ // Test the Page title
+ assertEquals( getString( "report.issuetracking.name" ) + " - " + getString( "report.issuetracking.title" ),
+ response.getTitle() );
+
+ // Test the links
+ WebLink[] weblinks = response.getLinks();
+ assertEquals( weblinks.length, 3 );
+
+ assertEquals( weblinks[1].getText(), "Jira" );
+
+ assertEquals( weblinks[2].getText(), "http://localhost/jira" );
+
+ // Test the texts
+ TextBlock[] textBlocks = response.getTextBlocks();
+ assertEquals( textBlocks[0].getText(), getString( "report.issuetracking.overview.title" ) );
+ assertEquals( textBlocks[1].getText(), getString( "report.issuetracking.name" ) );
}
}
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/LicenseReportTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/LicenseReportTest.java?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/LicenseReportTest.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/LicenseReportTest.java Sun May 27 06:23:55 2007
@@ -19,15 +19,58 @@
* under the License.
*/
+import java.net.URL;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.TextBlock;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
/**
* @author Edwin Punzalan
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
*/
public class LicenseReportTest
extends AbstractProjectInfoTestCase
{
+ /**
+ * WebConversation object
+ */
+ private static final WebConversation webConversation = new WebConversation();
+
+ /**
+ * Test report
+ *
+ * @throws Exception if any
+ */
public void testReport()
throws Exception
{
generateReport( "license", "license-plugin-config.xml" );
+ assertTrue( "Test html generated", getGeneratedReport( "license.html" ).exists() );
+
+ URL reportURL = getGeneratedReport( "license.html" ).toURL();
+ assertNotNull( reportURL );
+
+ // HTTPUnit
+ WebRequest request = new GetMethodWebRequest( reportURL.toString() );
+ WebResponse response = webConversation.getResponse( request );
+
+ // Basic HTML tests
+ assertTrue( response.isHTML() );
+ assertTrue( response.getContentLength() > 0 );
+
+ // Test the Page title
+ assertEquals( getString( "report.license.name" ) + " - " + getString( "report.license.title" ), response
+ .getTitle() );
+
+ // Test the texts
+ TextBlock[] textBlocks = response.getTextBlocks();
+ assertEquals( textBlocks[0].getText(), getString( "report.license.overview.title" ) );
+ assertEquals( textBlocks[1].getText(), getString( "report.license.overview.intro" ) );
+ assertEquals( textBlocks[2].getText(), getString( "report.license.name" ) );
+ assertEquals( textBlocks[3].getText(), "The Apache Software License, Version 2.0" );
}
}
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/MailingListsReportTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/MailingListsReportTest.java?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/MailingListsReportTest.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/MailingListsReportTest.java Sun May 27 06:23:55 2007
@@ -19,15 +19,71 @@
* under the License.
*/
+import java.net.URL;
+import java.util.Locale;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.TextBlock;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
/**
* @author Edwin Punzalan
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
*/
public class MailingListsReportTest
extends AbstractProjectInfoTestCase
{
+ /**
+ * WebConversation object
+ */
+ private static final WebConversation webConversation = new WebConversation();
+
+ /**
+ * Test report
+ *
+ * @throws Exception if any
+ */
public void testReport()
throws Exception
{
generateReport( "mailing-list", "mailing-list-plugin-config.xml" );
+ assertTrue( "Test html generated", getGeneratedReport( "mail-lists.html" ).exists() );
+
+ URL reportURL = getGeneratedReport( "mail-lists.html" ).toURL();
+ assertNotNull( reportURL );
+
+ // HTTPUnit
+ WebRequest request = new GetMethodWebRequest( reportURL.toString() );
+ WebResponse response = webConversation.getResponse( request );
+
+ // Basic HTML tests
+ assertTrue( response.isHTML() );
+ assertTrue( response.getContentLength() > 0 );
+
+ // Test the Page title
+ assertEquals( getString( "report.mailing-lists.name" ) + " - " + getString( "report.mailing-lists.title" ),
+ response.getTitle() );
+
+ // Test the texts
+ TextBlock[] textBlocks = response.getTextBlocks();
+ assertEquals( textBlocks[0].getText(), getString( "report.mailing-lists.title" ) );
+ assertEquals( textBlocks[1].getText(), getString( "report.mailing-lists.intro" ) );
+ }
+
+ /**
+ * Test report in French (MPIR-59)
+ *
+ * @throws Exception if any
+ */
+ public void testFrenchReport()
+ throws Exception
+ {
+ Locale.setDefault( Locale.FRENCH );
+
+ generateReport( "mailing-list", "mailing-list-plugin-config.xml" );
+ assertTrue( "Test html generated", getGeneratedReport( "mail-lists.html" ).exists() );
}
}
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ProjectIndexPageReportTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ProjectIndexPageReportTest.java?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ProjectIndexPageReportTest.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ProjectIndexPageReportTest.java Sun May 27 06:23:55 2007
@@ -19,15 +19,56 @@
* under the License.
*/
+import java.net.URL;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.TextBlock;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
/**
* @author Edwin Punzalan
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
*/
public class ProjectIndexPageReportTest
extends AbstractProjectInfoTestCase
{
+ /**
+ * WebConversation object
+ */
+ private static final WebConversation webConversation = new WebConversation();
+
+ /**
+ * Test report
+ *
+ * @throws Exception if any
+ */
public void testReport()
throws Exception
{
generateReport( "index", "index-plugin-config.xml" );
+ assertTrue( "Test html generated", getGeneratedReport( "index.html" ).exists() );
+
+ URL reportURL = getGeneratedReport( "index.html" ).toURL();
+ assertNotNull( reportURL );
+
+ // HTTPUnit
+ WebRequest request = new GetMethodWebRequest( reportURL.toString() );
+ WebResponse response = webConversation.getResponse( request );
+
+ // Basic HTML tests
+ assertTrue( response.isHTML() );
+ assertTrue( response.getContentLength() > 0 );
+
+ // Test the Page title
+ assertEquals( getString( "report.index.title" ) + " - " + getString( "report.index.title" ),
+ response.getTitle() );
+
+ // Test the texts
+ TextBlock[] textBlocks = response.getTextBlocks();
+ assertEquals( textBlocks[0].getText(), getString( "report.index.title" ) + " " + getTestMavenProject().getName() );
+ assertEquals( textBlocks[1].getText(), getString( "report.index.nodescription" ) );
}
}
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ProjectSummaryReportTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ProjectSummaryReportTest.java?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ProjectSummaryReportTest.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ProjectSummaryReportTest.java Sun May 27 06:23:55 2007
@@ -19,15 +19,60 @@
* under the License.
*/
+import java.net.URL;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.TextBlock;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
/**
* @author Edwin Punzalan
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
*/
public class ProjectSummaryReportTest
extends AbstractProjectInfoTestCase
{
+ /**
+ * WebConversation object
+ */
+ private static final WebConversation webConversation = new WebConversation();
+
+ /**
+ * Test report
+ *
+ * @throws Exception if any
+ */
public void testReport()
throws Exception
{
generateReport( "summary", "summary-plugin-config.xml" );
+ assertTrue( "Test html generated", getGeneratedReport( "project-summary.html" ).exists() );
+
+ URL reportURL = getGeneratedReport( "project-summary.html" ).toURL();
+ assertNotNull( reportURL );
+
+ // HTTPUnit
+ WebRequest request = new GetMethodWebRequest( reportURL.toString() );
+ WebResponse response = webConversation.getResponse( request );
+
+ // Basic HTML tests
+ assertTrue( response.isHTML() );
+ assertTrue( response.getContentLength() > 0 );
+
+ // Test the Page title
+ assertEquals( getString( "report.summary.name" ) + " - " + getString( "report.summary.title" ),
+ response.getTitle() );
+
+ // Test the texts
+ TextBlock[] textBlocks = response.getTextBlocks();
+
+ assertEquals( getString( "report.summary.title" ), textBlocks[0].getText() );
+ assertEquals( getString( "report.summary.general.title" ), textBlocks[1].getText() );
+ assertEquals( getString( "report.summary.organization.title" ), textBlocks[2].getText() );
+ assertEquals( getString( "report.summary.noorganization" ), textBlocks[3].getText() );
+ assertEquals( getString( "report.summary.build.title" ), textBlocks[4].getText() );
}
}
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ScmReportTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ScmReportTest.java?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ScmReportTest.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/ScmReportTest.java Sun May 27 06:23:55 2007
@@ -19,15 +19,63 @@
* under the License.
*/
+import java.net.URL;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.TextBlock;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
/**
* @author Edwin Punzalan
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
*/
public class ScmReportTest
extends AbstractProjectInfoTestCase
{
+ /**
+ * WebConversation object
+ */
+ private static final WebConversation webConversation = new WebConversation();
+
+ /**
+ * Test report
+ *
+ * @throws Exception if any
+ */
public void testReport()
throws Exception
{
generateReport( "scm", "scm-plugin-config.xml" );
+ assertTrue( "Test html generated", getGeneratedReport( "source-repository.html" ).exists() );
+
+ URL reportURL = getGeneratedReport( "source-repository.html" ).toURL();
+ assertNotNull( reportURL );
+
+ // HTTPUnit
+ WebRequest request = new GetMethodWebRequest( reportURL.toString() );
+ WebResponse response = webConversation.getResponse( request );
+
+ // Basic HTML tests
+ assertTrue( response.isHTML() );
+ assertTrue( response.getContentLength() > 0 );
+
+ // Test the Page title
+ assertEquals( getString( "report.scm.name" ) + " - " + getString( "report.scm.title" ),
+ response.getTitle() );
+
+ // Test the texts
+ TextBlock[] textBlocks = response.getTextBlocks();
+
+ assertEquals( textBlocks.length, 6 );
+
+ assertEquals( getString( "report.scm.overview.title" ), textBlocks[0].getText() );
+ assertEquals( getString( "report.scm.general.intro" ), textBlocks[1].getText() );
+ assertEquals( getString( "report.scm.webaccess.title" ), textBlocks[2].getText() );
+ assertEquals( getString( "report.scm.webaccess.nourl" ), textBlocks[3].getText() );
+ assertEquals( getString( "report.scm.accessbehindfirewall.title" ), textBlocks[4].getText() );
+ assertEquals( getString( "report.scm.accessbehindfirewall.general.intro" ), textBlocks[5].getText() );
}
}
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/TeamListReportTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/TeamListReportTest.java?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/TeamListReportTest.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/TeamListReportTest.java Sun May 27 06:23:55 2007
@@ -19,15 +19,64 @@
* under the License.
*/
+import java.net.URL;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.TextBlock;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
/**
* @author Edwin Punzalan
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
*/
public class TeamListReportTest
extends AbstractProjectInfoTestCase
{
+ /**
+ * WebConversation object
+ */
+ private static final WebConversation webConversation = new WebConversation();
+
+ /**
+ * Test report
+ *
+ * @throws Exception if any
+ */
public void testReport()
throws Exception
{
generateReport( "project-team", "project-team-plugin-config.xml" );
+ assertTrue( "Test html generated", getGeneratedReport( "team-list.html" ).exists() );
+
+ URL reportURL = getGeneratedReport( "team-list.html" ).toURL();
+ assertNotNull( reportURL );
+
+ // HTTPUnit
+ WebRequest request = new GetMethodWebRequest( reportURL.toString() );
+ WebResponse response = webConversation.getResponse( request );
+
+ // Basic HTML tests
+ assertTrue( response.isHTML() );
+ assertTrue( response.getContentLength() > 0 );
+
+ // Test the Page title
+ assertEquals( getString( "report.team-list.name" ) + " - " + getString( "report.team-list.title" ),
+ response.getTitle() );
+
+ // Test the texts
+ TextBlock[] textBlocks = response.getTextBlocks();
+
+ assertEquals( textBlocks.length, 7 );
+
+ assertEquals( getString( "report.team-list.intro.title" ), textBlocks[0].getText() );
+ assertEquals( getString( "report.team-list.intro.description1" ), textBlocks[1].getText() );
+ assertEquals( getString( "report.team-list.intro.description2" ), textBlocks[2].getText() );
+ assertEquals( getString( "report.team-list.developers.title" ), textBlocks[3].getText() );
+ assertEquals( getString( "report.team-list.developers.intro" ), textBlocks[4].getText() );
+ assertEquals( getString( "report.team-list.contributors.title" ), textBlocks[5].getText() );
+ assertEquals( getString( "report.team-list.nocontributor" ), textBlocks[6].getText() );
}
}
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/CimStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/CimStub.java?view=auto&rev=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/CimStub.java (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/CimStub.java Sun May 27 06:23:55 2007
@@ -0,0 +1,37 @@
+package org.apache.maven.report.projectinfo.stubs;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
+ */
+public class CimStub
+ extends ProjectInfoProjectStub
+{
+ /**
+ * @see org.apache.maven.report.projectinfo.stubs.ProjectInfoProjectStub#getPOM()
+ */
+ protected String getPOM()
+ {
+ return "cim-plugin-config.xml";
+ }
+}
+
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/CimStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/CimStub.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DefaultArtifactHandlerStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DefaultArtifactHandlerStub.java?view=auto&rev=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DefaultArtifactHandlerStub.java (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DefaultArtifactHandlerStub.java Sun May 27 06:23:55 2007
@@ -0,0 +1,51 @@
+package org.apache.maven.report.projectinfo.stubs;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
+ */
+public class DefaultArtifactHandlerStub
+ extends DefaultArtifactHandler
+{
+ private String language;
+
+ public String getLanguage()
+ {
+ if ( language == null )
+ {
+ language = "java";
+ }
+
+ return language;
+ }
+
+ /**
+ * @param language
+ */
+ public void setLanguage( String language )
+ {
+ this.language = language;
+ }
+
+}
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DefaultArtifactHandlerStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DefaultArtifactHandlerStub.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DependenciesStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DependenciesStub.java?view=auto&rev=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DependenciesStub.java (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DependenciesStub.java Sun May 27 06:23:55 2007
@@ -0,0 +1,36 @@
+package org.apache.maven.report.projectinfo.stubs;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
+ */
+public class DependenciesStub
+ extends ProjectInfoProjectStub
+{
+ /**
+ * @see org.apache.maven.report.projectinfo.stubs.ProjectInfoProjectStub#getPOM()
+ */
+ protected String getPOM()
+ {
+ return "dependencies-plugin-config.xml";
+ }
+}
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DependenciesStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DependenciesStub.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DependencyConvergenceStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DependencyConvergenceStub.java?view=auto&rev=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DependencyConvergenceStub.java (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DependencyConvergenceStub.java Sun May 27 06:23:55 2007
@@ -0,0 +1,58 @@
+package org.apache.maven.report.projectinfo.stubs;
+
+import java.util.Collections;
+import java.util.List;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
+ */
+public class DependencyConvergenceStub
+ extends ProjectInfoProjectStub
+{
+ /**
+ *
+ */
+ public DependencyConvergenceStub()
+ {
+ super();
+
+ setExecutionRoot( true );
+ }
+
+ /**
+ * @see org.apache.maven.report.projectinfo.stubs.ProjectInfoProjectStub#getPOM()
+ */
+ protected String getPOM()
+ {
+ return "dependency-convergence-plugin-config.xml";
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.MavenProjectStub#getDependencies()
+ */
+ public List getDependencies()
+ {
+ return Collections.EMPTY_LIST;
+ }
+}
+
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DependencyConvergenceStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/DependencyConvergenceStub.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IndexStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IndexStub.java?view=auto&rev=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IndexStub.java (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IndexStub.java Sun May 27 06:23:55 2007
@@ -0,0 +1,37 @@
+package org.apache.maven.report.projectinfo.stubs;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
+ */
+public class IndexStub
+ extends ProjectInfoProjectStub
+{
+ /**
+ * @see org.apache.maven.report.projectinfo.stubs.ProjectInfoProjectStub#getPOM()
+ */
+ protected String getPOM()
+ {
+ return "index-plugin-config.xml";
+ }
+}
+
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IndexStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IndexStub.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IssueTrackingStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IssueTrackingStub.java?view=auto&rev=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IssueTrackingStub.java (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IssueTrackingStub.java Sun May 27 06:23:55 2007
@@ -0,0 +1,36 @@
+package org.apache.maven.report.projectinfo.stubs;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
+ */
+public class IssueTrackingStub
+ extends ProjectInfoProjectStub
+{
+ /**
+ * @see org.apache.maven.report.projectinfo.stubs.ProjectInfoProjectStub#getPOM()
+ */
+ protected String getPOM()
+ {
+ return "issue-tracking-plugin-config.xml";
+ }
+}
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IssueTrackingStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IssueTrackingStub.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/LicenseStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/LicenseStub.java?view=auto&rev=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/LicenseStub.java (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/LicenseStub.java Sun May 27 06:23:55 2007
@@ -0,0 +1,37 @@
+package org.apache.maven.report.projectinfo.stubs;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
+ */
+public class LicenseStub
+ extends ProjectInfoProjectStub
+{
+ /**
+ * @see org.apache.maven.report.projectinfo.stubs.ProjectInfoProjectStub#getPOM()
+ */
+ protected String getPOM()
+ {
+ return "license-plugin-config.xml";
+ }
+}
+
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/LicenseStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/LicenseStub.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/MailingListStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/MailingListStub.java?view=auto&rev=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/MailingListStub.java (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/MailingListStub.java Sun May 27 06:23:55 2007
@@ -0,0 +1,37 @@
+package org.apache.maven.report.projectinfo.stubs;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
+ */
+public class MailingListStub
+ extends ProjectInfoProjectStub
+{
+ /**
+ * @see org.apache.maven.report.projectinfo.stubs.ProjectInfoProjectStub#getPOM()
+ */
+ protected String getPOM()
+ {
+ return "mailing-list-plugin-config.xml";
+ }
+}
+
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/MailingListStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/MailingListStub.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoPluginArtifactStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoPluginArtifactStub.java?view=auto&rev=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoPluginArtifactStub.java (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoPluginArtifactStub.java Sun May 27 06:23:55 2007
@@ -0,0 +1,155 @@
+package org.apache.maven.report.projectinfo.stubs;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.plugin.testing.stubs.ArtifactStub;
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
+ */
+public class ProjectInfoPluginArtifactStub
+ extends ArtifactStub
+{
+ private String groupId;
+
+ private String artifactId;
+
+ private String version;
+
+ private String packaging;
+
+ private VersionRange versionRange;
+
+ private ArtifactHandler handler;
+
+ /**
+ * @param groupId
+ * @param artifactId
+ * @param version
+ * @param packaging
+ */
+ public ProjectInfoPluginArtifactStub( String groupId, String artifactId, String version, String packaging )
+ {
+ this.groupId = groupId;
+ this.artifactId = artifactId;
+ this.version = version;
+ this.packaging = packaging;
+ versionRange = VersionRange.createFromVersion( version );
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.ArtifactStub#setGroupId(java.lang.String)
+ */
+ public void setGroupId( String groupId )
+ {
+ this.groupId = groupId;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.ArtifactStub#getGroupId()
+ */
+ public String getGroupId()
+ {
+ return groupId;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.ArtifactStub#setArtifactId(java.lang.String)
+ */
+ public void setArtifactId( String artifactId )
+ {
+ this.artifactId = artifactId;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.ArtifactStub#getArtifactId()
+ */
+ public String getArtifactId()
+ {
+ return artifactId;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.ArtifactStub#setVersion(java.lang.String)
+ */
+ public void setVersion( String version )
+ {
+ this.version = version;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.ArtifactStub#getVersion()
+ */
+ public String getVersion()
+ {
+ return version;
+ }
+
+ /**
+ * @param packaging
+ */
+ public void setPackaging( String packaging )
+ {
+ this.packaging = packaging;
+ }
+
+ /**
+ * @return the packaging
+ */
+ public String getPackaging()
+ {
+ return packaging;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.ArtifactStub#getVersionRange()
+ */
+ public VersionRange getVersionRange()
+ {
+ return versionRange;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.ArtifactStub#setVersionRange(org.apache.maven.artifact.versioning.VersionRange)
+ */
+ public void setVersionRange( VersionRange versionRange )
+ {
+ this.versionRange = versionRange;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.ArtifactStub#getArtifactHandler()
+ */
+ public ArtifactHandler getArtifactHandler()
+ {
+ return handler;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.ArtifactStub#setArtifactHandler(org.apache.maven.artifact.handler.ArtifactHandler)
+ */
+ public void setArtifactHandler( ArtifactHandler handler )
+ {
+ this.handler = handler;
+ }
+}
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoPluginArtifactStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoPluginArtifactStub.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoProjectStub.java?view=diff&rev=541986&r1=541985&r2=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoProjectStub.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectInfoProjectStub.java Sun May 27 06:23:55 2007
@@ -19,33 +19,148 @@
* under the License.
*/
-import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.CiManagement;
-import org.apache.maven.model.Notifier;
-
+import java.io.File;
+import java.io.FileReader;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.DefaultArtifact;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.DefaultArtifactRepository;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.model.Build;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
/**
* @author Edwin Punzalan
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
*/
-public class ProjectInfoProjectStub
+public abstract class ProjectInfoProjectStub
extends MavenProjectStub
{
- public Model getModel()
+ private Model model;
+
+ private Build build;
+
+ /**
+ * Default constructor
+ */
+ public ProjectInfoProjectStub()
{
- Model model = new Model();
+ MavenXpp3Reader pomReader = new MavenXpp3Reader();
+ try
+ {
+ model = pomReader.read( new FileReader( new File( getBasedir(), getPOM() ) ) );
+ setModel( model );
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException( e );
+ }
+
+ setGroupId( model.getGroupId() );
+ setArtifactId( model.getArtifactId() );
+ setVersion( model.getVersion() );
+ setName( model.getName() );
+ setUrl( model.getUrl() );
+ setPackaging( model.getPackaging() );
+
+ Artifact artifact = new ProjectInfoPluginArtifactStub( getGroupId(), getArtifactId(), getVersion(),
+ getPackaging() );
+ artifact.setArtifactHandler( new DefaultArtifactHandlerStub() );
+ setArtifact( artifact );
+
+ Build build = new Build();
+ build.setFinalName( model.getArtifactId() );
+ build.setDirectory( super.getBasedir() + "/target/test/unit/" + model.getArtifactId() + "/target" );
+ build.setSourceDirectory( getBasedir() + "/src/main/java" );
+ build
+ .setOutputDirectory( super.getBasedir() + "/target/test/unit/" + model.getArtifactId() + "/target/classes" );
+ build.setTestSourceDirectory( getBasedir() + "/src/test/java" );
+ build.setTestOutputDirectory( super.getBasedir() + "/target/test/unit/" + model.getArtifactId()
+ + "/target/test-classes" );
+ setBuild( build );
- CiManagement ciMngt = new CiManagement();
- ciMngt.setSystem( "continuum" );
- ciMngt.setUrl( "http://continumm" );
- Notifier notifier = new Notifier();
- notifier.setType( "notifier-type" );
- notifier.setAddress( "notifier@email.com");
- notifier.setConfiguration( System.getProperties() );
- ciMngt.setNotifiers( Collections.singletonList( notifier ) );
- model.setCiManagement( ciMngt );
+ List compileSourceRoots = new ArrayList();
+ compileSourceRoots.add( getBasedir() + "/src/main/java" );
+ setCompileSourceRoots( compileSourceRoots );
+ List testCompileSourceRoots = new ArrayList();
+ testCompileSourceRoots.add( getBasedir() + "/src/test/java" );
+ setTestCompileSourceRoots( testCompileSourceRoots );
+ }
+
+ /**
+ * @return the POM file name
+ */
+ protected abstract String getPOM();
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.MavenProjectStub#getModel()
+ */
+ public Model getModel()
+ {
return model;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.MavenProjectStub#getBuild()
+ */
+ public Build getBuild()
+ {
+ return build;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.MavenProjectStub#setBuild(org.apache.maven.model.Build)
+ */
+ public void setBuild( Build build )
+ {
+ this.build = build;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.MavenProjectStub#getBasedir()
+ */
+ public File getBasedir()
+ {
+ return new File( super.getBasedir() + "/src/test/plugin-configs/" );
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.MavenProjectStub#getArtifacts()
+ */
+ public Set getArtifacts()
+ {
+ return Collections.EMPTY_SET;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.MavenProjectStub#getRemoteArtifactRepositories()
+ */
+ public List getRemoteArtifactRepositories()
+ {
+ ArtifactRepository repository = new DefaultArtifactRepository( "central", "http://repo1.maven.org/maven2",
+ new DefaultRepositoryLayout() );
+
+ return Collections.singletonList( repository );
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.MavenProjectStub#getDependencyArtifacts()
+ */
+ public Set getDependencyArtifacts()
+ {
+ return Collections.singleton( new DefaultArtifact( "junit", "junit", VersionRange.createFromVersion( "3.8.1" ),
+ Artifact.SCOPE_TEST, "jar", null,
+ new DefaultArtifactHandler( "jar" ), false ) );
}
}
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectTeamStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectTeamStub.java?view=auto&rev=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectTeamStub.java (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectTeamStub.java Sun May 27 06:23:55 2007
@@ -0,0 +1,37 @@
+package org.apache.maven.report.projectinfo.stubs;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
+ */
+public class ProjectTeamStub
+ extends ProjectInfoProjectStub
+{
+ /**
+ * @see org.apache.maven.report.projectinfo.stubs.ProjectInfoProjectStub#getPOM()
+ */
+ protected String getPOM()
+ {
+ return "project-team-plugin-config.xml";
+ }
+}
+
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectTeamStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ProjectTeamStub.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ScmStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ScmStub.java?view=auto&rev=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ScmStub.java (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ScmStub.java Sun May 27 06:23:55 2007
@@ -0,0 +1,37 @@
+package org.apache.maven.report.projectinfo.stubs;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
+ */
+public class ScmStub
+ extends ProjectInfoProjectStub
+{
+ /**
+ * @see org.apache.maven.report.projectinfo.stubs.ProjectInfoProjectStub#getPOM()
+ */
+ protected String getPOM()
+ {
+ return "scm-plugin-config.xml";
+ }
+}
+
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ScmStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/ScmStub.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/SubProject1Stub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/SubProject1Stub.java?view=auto&rev=541986
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/SubProject1Stub.java (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/SubProject1Stub.java Sun May 27 06:23:55 2007
@@ -0,0 +1,47 @@
+package org.apache.maven.report.projectinfo.stubs;
+
+import java.util.Collections;
+import java.util.List;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id $
+ */
+public class SubProject1Stub
+ extends ProjectInfoProjectStub
+{
+ /**
+ * @see org.apache.maven.report.projectinfo.stubs.ProjectInfoProjectStub#getPOM()
+ */
+ protected String getPOM()
+ {
+ return "subproject1/pom.xml";
+ }
+
+ /**
+ * @see org.apache.maven.plugin.testing.stubs.MavenProjectStub#getDependencies()
+ */
+ public List getDependencies()
+ {
+ return Collections.EMPTY_LIST;
+ }
+}
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/SubProject1Stub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/SubProject1Stub.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"