maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r797895 - /maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/
Date Sun, 26 Jul 2009 10:03:40 GMT
Author: vsiveton
Date: Sun Jul 26 10:03:39 2009
New Revision: 797895

URL: http://svn.apache.org/viewvc?rev=797895&view=rev
Log:
o using readModel() in stubs

Modified:
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesProject1TestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesProject2TestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesTestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateTestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/CustomConfigurationMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DefaultConfigurationMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocfilesTestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocletPathTestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocletTestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/HeaderFooterTestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/JavadocJarDefaultMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/JavadocJarInvalidDestdirMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/Jdk5TestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/Jdk6TestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/NewlineTestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/PomMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ProxyTestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/QuotedPathMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesTestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesWithExcludesTestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/StandardDocletConflictOptionsTestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/SubpackagesTestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagTestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagletArtifactsMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagletTestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TestJavadocMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/WrongEncodingOptionsTestMavenProjectStub.java

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesProject1TestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesProject1TestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesProject1TestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesProject1TestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,7 +20,6 @@
  */
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -30,8 +29,6 @@
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 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;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.artifact.InvalidDependencyVersionException;
@@ -47,25 +44,14 @@
 
     public AggregateResourcesProject1TestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "pom.xml" ) );
 
-        try
-        {
-            model = pomReader.read( new FileReader( new File( getBasedir(), "pom.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         setExecutionRoot( true );
 
@@ -74,13 +60,13 @@
         setArtifact( artifact );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setSourceDirectory( getBasedir() + "/src/main/java" );
         build.setDirectory( super.getBasedir() + "/target/test/unit/aggregate-resources-test/project1/target" );
         setBuild( build );
 
         List compileSourceRoots = new ArrayList();
-        compileSourceRoots.add( getBasedir() + "/src/main/java" );
+        compileSourceRoots.add( getBasedir().getAbsolutePath() + "/src/main/java" );
         setCompileSourceRoots( compileSourceRoots );
     }
 

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesProject2TestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesProject2TestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesProject2TestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesProject2TestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,7 +20,6 @@
  */
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -30,8 +29,6 @@
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 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;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.artifact.InvalidDependencyVersionException;
@@ -47,25 +44,14 @@
 
     public AggregateResourcesProject2TestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "pom.xml" ) );
 
-        try
-        {
-            model = pomReader.read( new FileReader( new File( getBasedir(), "pom.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         setExecutionRoot( true );
 
@@ -74,7 +60,7 @@
         setArtifact( artifact );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setSourceDirectory( getBasedir() + "/src/main/java" );
         build.setDirectory( super.getBasedir() + "/target/test/unit/aggregate-resources-test/project2/target" );
         setBuild( build );

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateResourcesTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,7 +20,6 @@
  */
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -29,8 +28,6 @@
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 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;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.artifact.InvalidDependencyVersionException;
@@ -46,31 +43,19 @@
 
     public AggregateResourcesTestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "aggregate-resources-test-plugin-config.xml" ) );
 
-        try
-        {
-            model = pomReader.read( new FileReader( new File( getBasedir()
-                + "/aggregate-resources-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         setExecutionRoot( true );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setSourceDirectory( getBasedir() + "/src/main/java" );
         build.setDirectory( super.getBasedir() + "/target/test/unit/aggregate-resources-test/target" );
         setBuild( build );

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,13 +20,10 @@
  */
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
 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;
 import org.apache.maven.project.MavenProject;
 
@@ -41,29 +38,18 @@
 
     public AggregateTestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "aggregate-test-plugin-config.xml" ) );
 
-        try
-        {
-            model = pomReader.read( new FileReader( new File( getBasedir(), "aggregate-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
         setExecutionRoot( true );
 
         build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setDirectory( super.getBasedir() + "/target/test/unit/aggregate-test/target" );
 
         List compileSourceRoots = new ArrayList();

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/CustomConfigurationMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/CustomConfigurationMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/CustomConfigurationMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/CustomConfigurationMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,13 +20,10 @@
  */
 
 import org.apache.maven.model.Build;
-import org.apache.maven.model.Model;
 import org.apache.maven.model.Scm;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -44,6 +41,8 @@
 
     public CustomConfigurationMavenProjectStub()
     {
+        readModel( new File( getBasedir(), "custom-configuration-plugin-config.xml" ) );
+
         setGroupId( "org.apache.maven.plugins.maven-javadoc-plugin.unit" );
         setArtifactId( "custom-configuration" );
         setVersion( "1.0-SNAPSHOT" );
@@ -59,32 +58,17 @@
 
         Build build = new Build();
         build.setFinalName( "default-configuration" );
-        build.setDirectory( getBasedir() + "/target/test/unit/custom-configuration/target" );
+        build.setDirectory( super.getBasedir() + "/target/test/unit/custom-configuration/target" );
         setBuild( build );
 
-        String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
-        String temp =  basedir + "/src/test/resources/unit/custom-configuration";
+        String temp =  getBasedir().getAbsolutePath();
         if( !temp.startsWith( "/" ) )
         {
             temp = temp.replace( '/', '\\' );
         }
-
         compileSourceRoots.add( temp );
         setCompileSourceRoots( compileSourceRoots );
-
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-
-        try
-        {
-            Model model = pomReader.read( new FileReader( new File( getBasedir() +
-                "/src/test/resources/unit/custom-configuration/custom-configuration-plugin-config.xml" ) ) );
-            setModel( model );
-        }
-        catch ( Exception e )
-        {
-            throw new RuntimeException( e );
-        }
     }
 
     /** {@inheritDoc} */
@@ -110,4 +94,10 @@
     {
         this.build = build;
     }
+
+    /** {@inheritDoc} */
+    public File getBasedir()
+    {
+        return new File( super.getBasedir() + "/src/test/resources/unit/custom-configuration/" );
+    }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DefaultConfigurationMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DefaultConfigurationMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DefaultConfigurationMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DefaultConfigurationMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,13 +20,10 @@
  */
 
 import org.apache.maven.model.Build;
-import org.apache.maven.model.Model;
 import org.apache.maven.model.Scm;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -43,6 +40,8 @@
 
     public DefaultConfigurationMavenProjectStub()
     {
+        readModel( new File( getBasedir(), "default-configuration-plugin-config.xml" ) );
+
         setGroupId( "org.apache.maven.plugins.maven-javadoc-plugin.unit" );
         setArtifactId( "default-configuration" );
         setVersion( "1.0-SNAPSHOT" );
@@ -56,26 +55,12 @@
 
         Build build = new Build();
         build.setFinalName( "default-configuration" );
-        build.setDirectory( getBasedir() + "/target/test/unit/default-configuration/target" );
+        build.setDirectory( super.getBasedir() + "/target/test/unit/default-configuration/target" );
         setBuild( build );
 
-        String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
-        compileSourceRoots.add( basedir + "/src/test/resources/unit/default-configuration/def/configuration" );
+        compileSourceRoots.add( getBasedir() + "/def/configuration" );
         setCompileSourceRoots( compileSourceRoots );
-
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-
-        try
-        {
-            Model model = pomReader.read( new FileReader( new File( getBasedir() +
-                "/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml" ) ) );
-            setModel( model );
-        }
-        catch ( Exception e )
-        {
-            throw new RuntimeException( e );
-        }
     }
 
     /** {@inheritDoc} */
@@ -101,4 +86,10 @@
     {
         this.build = build;
     }
+
+    /** {@inheritDoc} */
+    public File getBasedir()
+    {
+        return new File( super.getBasedir() + "/src/test/resources/unit/default-configuration/" );
+    }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocfilesTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocfilesTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocfilesTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocfilesTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,13 +20,10 @@
  */
 
 import org.apache.maven.model.Build;
-import org.apache.maven.model.Model;
 import org.apache.maven.model.Scm;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -43,6 +40,8 @@
 
     public DocfilesTestMavenProjectStub()
     {
+        readModel( new File( getBasedir(), "docfiles-test-plugin-config.xml" ) );
+
         setGroupId( "org.apache.maven.plugins.maven-javadoc-plugin.unit" );
         setArtifactId( "docfiles-test" );
         setVersion( "1.0-SNAPSHOT" );
@@ -57,26 +56,12 @@
 
         Build build = new Build();
         build.setFinalName( "docfiles-test" );
-        build.setDirectory( getBasedir() + "/target/test/unit/docfiles-test/target" );
+        build.setDirectory( super.getBasedir() + "/target/test/unit/docfiles-test/target" );
         setBuild( build );
 
-        String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
-        compileSourceRoots.add( basedir + "/src/test/resources/unit/docfiles-test/docfiles/test" );
+        compileSourceRoots.add( getBasedir() + "/docfiles/test" );
         setCompileSourceRoots( compileSourceRoots );
-
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-
-        try
-        {
-            Model model = pomReader.read( new FileReader(
-                new File( getBasedir() + "/src/test/resources/unit/docfiles-test/docfiles-test-plugin-config.xml" ) ) );
-            setModel( model );
-        }
-        catch ( Exception e )
-        {
-            throw new RuntimeException( e );
-        }
     }
 
     /** {@inheritDoc} */
@@ -102,4 +87,10 @@
     {
         this.build = build;
     }
+
+    /** {@inheritDoc} */
+    public File getBasedir()
+    {
+        return new File( super.getBasedir() + "/src/test/resources/unit/docfiles-test/" );
+    }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocletPathTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocletPathTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocletPathTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocletPathTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,13 +20,10 @@
  */
 
 import org.apache.maven.model.Build;
-import org.apache.maven.model.Model;
 import org.apache.maven.model.Scm;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -43,39 +40,26 @@
 
     public DocletPathTestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "doclet-path-test-plugin-config.xml" ) );
 
-        try
-        {
-            model = pomReader.read( new FileReader( new File( getBasedir()
-                + "/src/test/resources/unit/doclet-path-test/doclet-path-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Scm scm = new Scm();
         scm.setConnection( "scm:svn:http://svn.apache.org/maven/sample/trunk" );
         setScm( scm );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
-        build.setDirectory( getBasedir() + "/target/test/unit/doclet-path-test/target" );
+        build.setFinalName( getModel().getArtifactId() );
+        build.setDirectory( super.getBasedir() + "/target/test/unit/doclet-path-test/target" );
         setBuild( build );
 
-        String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
-        compileSourceRoots.add( basedir + "/src/test/resources/unit/doclet-path-test/doclet/test" );
+        compileSourceRoots.add( getBasedir() + "/doclet/test" );
         setCompileSourceRoots( compileSourceRoots );
     }
 
@@ -102,4 +86,10 @@
     {
         this.build = build;
     }
+
+    /** {@inheritDoc} */
+    public File getBasedir()
+    {
+        return new File( super.getBasedir() + "/src/test/resources/unit/doclet-path-test" );
+    }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocletTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocletTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocletTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/DocletTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,13 +20,10 @@
  */
 
 import org.apache.maven.model.Build;
-import org.apache.maven.model.Model;
 import org.apache.maven.model.Scm;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -43,26 +40,14 @@
 
     public DocletTestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "doclet-test-plugin-config.xml" ) );
 
-        try
-        {
-            model = pomReader.read( new FileReader(
-                new File( getBasedir() + "/src/test/resources/unit/doclet-test/doclet-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
         //setDescription( "Sample Maven Project" );
 
         Scm scm = new Scm();
@@ -70,13 +55,12 @@
         setScm( scm );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
-        build.setDirectory( getBasedir() + "/target/test/unit/doclet-test/target" );
+        build.setFinalName( getModel().getArtifactId() );
+        build.setDirectory( super.getBasedir() + "/target/test/unit/doclet-test/target" );
         setBuild( build );
 
-        String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
-        compileSourceRoots.add( basedir + "/src/test/resources/unit/doclet-test/doclet/test" );
+        compileSourceRoots.add( getBasedir() + "/doclet/test" );
         setCompileSourceRoots( compileSourceRoots );
     }
 
@@ -103,4 +87,10 @@
     {
         this.build = build;
     }
+
+    /** {@inheritDoc} */
+    public File getBasedir()
+    {
+        return new File( super.getBasedir() + "/src/test/resources/unit/doclet-test" );
+    }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/HeaderFooterTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/HeaderFooterTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/HeaderFooterTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/HeaderFooterTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,12 +20,9 @@
  */
 
 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;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -39,29 +36,17 @@
 
     public HeaderFooterTestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "header-footer-test-plugin-config.xml" ) );
 
-        try
-        {
-            model =
-                pomReader.read( new FileReader( new File( getBasedir(), "header-footer-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setSourceDirectory( getBasedir() + "/src/main/java" );
         build.setDirectory( super.getBasedir() + "/target/test/unit/header-footer-test/target" );
         setBuild( build );

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/JavadocJarDefaultMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/JavadocJarDefaultMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/JavadocJarDefaultMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/JavadocJarDefaultMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,13 +20,10 @@
  */
 
 import org.apache.maven.model.Build;
-import org.apache.maven.model.Model;
 import org.apache.maven.model.Scm;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -43,26 +40,14 @@
 
     public JavadocJarDefaultMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "javadocjar-default-plugin-config.xml" ) );
 
-        try
-        {
-            model = pomReader.read( new FileReader( new File( getBasedir() +
-                "/src/test/resources/unit/javadocjar-default/javadocjar-default-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Scm scm = new Scm();
         scm.setConnection( "scm:svn:http://svn.apache.org/maven/sample/trunk" );
@@ -77,12 +62,11 @@
 
         Build build = new Build();
         build.setFinalName( "javadocjar-default" );
-        build.setDirectory( getBasedir() + "/target/test/unit/javadocjar-default/target" );
+        build.setDirectory( super.getBasedir() + "/target/test/unit/javadocjar-default/target" );
         setBuild( build );
 
-        String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
-        compileSourceRoots.add( basedir + "/src/test/resources/unit/javadocjar-default/javadocjar/def" );
+        compileSourceRoots.add( getBasedir() + "/javadocjar/def" );
         setCompileSourceRoots( compileSourceRoots );
     }
 
@@ -109,4 +93,10 @@
     {
         this.build = build;
     }
+
+    /** {@inheritDoc} */
+    public File getBasedir()
+    {
+        return new File( super.getBasedir() + "/src/test/resources/unit/javadocjar-default" );
+    }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/JavadocJarInvalidDestdirMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/JavadocJarInvalidDestdirMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/JavadocJarInvalidDestdirMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/JavadocJarInvalidDestdirMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -21,13 +21,10 @@
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.model.Build;
-import org.apache.maven.model.Model;
 import org.apache.maven.model.Scm;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -44,26 +41,14 @@
 
     public JavadocJarInvalidDestdirMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "javadocjar-invalid-destdir-plugin-config.xml" ) );
 
-        try
-        {
-            model = pomReader.read( new FileReader( new File( getBasedir() +
-                "/src/test/resources/unit/javadocjar-invalid-destdir/javadocjar-invalid-destdir-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Scm scm = new Scm();
         scm.setConnection( "scm:svn:http://svn.apache.org/maven/sample/trunk" );
@@ -76,13 +61,12 @@
 
         Build build = new Build();
         build.setFinalName( "javadocjar-invalid-destdir" );
-        build.setDirectory( getBasedir() + "/target/test/unit/javadocjar-invalid-destdir/target" );
+        build.setDirectory( super.getBasedir() + "/target/test/unit/javadocjar-invalid-destdir/target" );
         setBuild( build );
 
-        String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
         compileSourceRoots.add(
-            basedir + "/src/test/resources/unit/javadocjar-invalid-destdir/javadocjar/invalid/destdir" );
+            getBasedir() + "/javadocjar/invalid/destdir" );
         setCompileSourceRoots( compileSourceRoots );
     }
 
@@ -109,4 +93,10 @@
     {
         this.build = build;
     }
+
+    /** {@inheritDoc} */
+    public File getBasedir()
+    {
+        return new File( super.getBasedir() + "/src/test/resources/unit/javadocjar-invalid-destdir/" );
+    }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/Jdk5TestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/Jdk5TestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/Jdk5TestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/Jdk5TestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,13 +20,10 @@
  */
 
 import org.apache.maven.model.Build;
-import org.apache.maven.model.Model;
 import org.apache.maven.model.Scm;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -43,39 +40,26 @@
 
     public Jdk5TestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "jdk5-test-plugin-config.xml" ) );
 
-        try
-        {
-            model = pomReader.read( new FileReader( new File( getBasedir()
-                + "/src/test/resources/unit/jdk5-test/jdk5-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Scm scm = new Scm();
         scm.setConnection( "scm:svn:http://svn.apache.org/maven/sample/trunk" );
         setScm( scm );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
-        build.setDirectory( getBasedir() + "/target/test/unit/jdk5-test/target" );
+        build.setFinalName( getModel().getArtifactId() );
+        build.setDirectory( super.getBasedir() + "/target/test/unit/jdk5-test/target" );
         setBuild( build );
 
-        String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
-        compileSourceRoots.add( basedir + "/src/test/resources/unit/jdk5-test/" );
+        compileSourceRoots.add( getBasedir().getAbsolutePath() );
         setCompileSourceRoots( compileSourceRoots );
     }
 
@@ -102,4 +86,10 @@
     {
         this.build = build;
     }
+
+    /** {@inheritDoc} */
+    public File getBasedir()
+    {
+        return new File( super.getBasedir() + "/src/test/resources/unit/jdk5-test/" );
+    }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/Jdk6TestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/Jdk6TestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/Jdk6TestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/Jdk6TestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,13 +20,10 @@
  */
 
 import org.apache.maven.model.Build;
-import org.apache.maven.model.Model;
 import org.apache.maven.model.Scm;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -43,39 +40,26 @@
 
     public Jdk6TestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "jdk6-test-plugin-config.xml" ) );
 
-        try
-        {
-            model = pomReader.read( new FileReader( new File( getBasedir()
-                + "/src/test/resources/unit/jdk6-test/jdk6-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Scm scm = new Scm();
         scm.setConnection( "scm:svn:http://svn.apache.org/maven/sample/trunk" );
         setScm( scm );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
-        build.setDirectory( getBasedir() + "/target/test/unit/jdk6-test/target" );
+        build.setFinalName( getModel().getArtifactId() );
+        build.setDirectory( super.getBasedir() + "/target/test/unit/jdk6-test/target" );
         setBuild( build );
 
-        String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
-        compileSourceRoots.add( basedir + "/src/test/resources/unit/jdk6-test/" );
+        compileSourceRoots.add( getBasedir() + "/src/test/resources/unit/jdk6-test/" );
         setCompileSourceRoots( compileSourceRoots );
     }
 
@@ -102,4 +86,10 @@
     {
         this.build = build;
     }
+
+    /** {@inheritDoc} */
+    public File getBasedir()
+    {
+        return new File( super.getBasedir() + "/src/test/resources/unit/jdk6-test/" );
+    }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/NewlineTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/NewlineTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/NewlineTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/NewlineTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,12 +20,9 @@
  */
 
 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;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -39,29 +36,17 @@
 
     public NewlineTestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "newline-test-plugin-config.xml" ) );
 
-        try
-        {
-            model =
-                pomReader.read( new FileReader( new File( getBasedir(), "newline-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setSourceDirectory( getBasedir() + "/src/main/java" );
         build.setDirectory( super.getBasedir() + "/target/test/unit/newline-test/target" );
         setBuild( build );

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/PomMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/PomMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/PomMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/PomMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,13 +20,10 @@
  */
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
 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;
 
 /**
@@ -40,28 +37,17 @@
 
     public PomMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "pom-test-plugin-config.xml" ) );
 
-        try
-        {
-            model = pomReader.read( new FileReader( new File( getBasedir(), "pom-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setDirectory( super.getBasedir() + "/target/test/unit/pom-test/target" );
         build.setSourceDirectory( getBasedir() + "/src/main/java" );
         build.setOutputDirectory( super.getBasedir() + "/target/test/unit/pom-test/target/classes" );

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ProxyTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ProxyTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ProxyTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ProxyTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,12 +20,9 @@
  */
 
 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;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -39,29 +36,17 @@
 
     public ProxyTestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "proxy-test-plugin-config.xml" ) );
 
-        try
-        {
-            model =
-                pomReader.read( new FileReader( new File( getBasedir(), "proxy-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setSourceDirectory( getBasedir() + "/src/main/java" );
         build.setDirectory( super.getBasedir() + "/target/test/unit/proxy-test/target" );
         setBuild( build );

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/QuotedPathMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/QuotedPathMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/QuotedPathMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/QuotedPathMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -22,12 +22,9 @@
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 import org.apache.maven.model.Scm;
 import org.apache.maven.model.Build;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 
 import java.util.List;
 import java.util.ArrayList;
-import java.io.FileReader;
 import java.io.File;
 
 /**
@@ -43,6 +40,9 @@
 
     public QuotedPathMavenProjectStub()
     {
+        readModel( new File( getBasedir(), "quotedpath-test-plugin-config.xml" ) );
+
+
         setGroupId( "org.apache.maven.plugins.maven-javadoc-plugin.unit" );
         setArtifactId( "quotedpath-test" );
         setVersion( "1.0-SNAPSHOT" );
@@ -56,26 +56,12 @@
 
         Build build = new Build();
         build.setFinalName( "quotedpath-test" );
-        build.setDirectory( getBasedir() + "/target/test/unit/quotedpath'test/target" );
+        build.setDirectory( super.getBasedir() + "/target/test/unit/quotedpath'test/target" );
         setBuild( build );
 
-        String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
-        compileSourceRoots.add( basedir + "/src/test/resources/unit/quotedpath'test/quotedpath/test" );
+        compileSourceRoots.add( getBasedir() + "/quotedpath/test" );
         setCompileSourceRoots( compileSourceRoots );
-
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-
-        try
-        {
-            Model model = pomReader.read( new FileReader( new File( getBasedir() +
-                "/src/test/resources/unit/quotedpath'test/quotedpath-test-plugin-config.xml" ) ) );
-            setModel( model );
-        }
-        catch ( Exception e )
-        {
-            throw new RuntimeException( e );
-        }
     }
 
     /** {@inheritDoc} */
@@ -101,4 +87,10 @@
     {
         this.build = build;
     }
+
+    /** {@inheritDoc} */
+    public File getBasedir()
+    {
+        return new File( super.getBasedir() + "/src/test/resources/unit/quotedpath'test" );
+    }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,12 +20,9 @@
  */
 
 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;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -39,29 +36,17 @@
 
     public ResourcesTestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "resources-test-plugin-config.xml" ) );
 
-        try
-        {
-            model =
-                pomReader.read( new FileReader( new File( getBasedir(), "resources-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setSourceDirectory( getBasedir() + "/src/main/java" );
         build.setDirectory( super.getBasedir() + "/target/test/unit/resources-test/target" );
         setBuild( build );

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesWithExcludesTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesWithExcludesTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesWithExcludesTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesWithExcludesTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,12 +20,9 @@
  */
 
 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;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -39,29 +36,17 @@
 
     public ResourcesWithExcludesTestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "resources-with-excludes-test-plugin-config.xml" ) );
 
-        try
-        {
-            model =
-                pomReader.read( new FileReader( new File( getBasedir(), "resources-with-excludes-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setSourceDirectory( getBasedir() + "/src/main/java" );
         build.setDirectory( super.getBasedir() + "/target/test/unit/resources-with-excludes-test/target" );
         setBuild( build );

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/StandardDocletConflictOptionsTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/StandardDocletConflictOptionsTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/StandardDocletConflictOptionsTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/StandardDocletConflictOptionsTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,12 +20,9 @@
  */
 
 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;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -39,29 +36,17 @@
 
     public StandardDocletConflictOptionsTestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "conflict-options-test-plugin-config.xml" ) );
 
-        try
-        {
-            model =
-                pomReader.read( new FileReader( new File( getBasedir(), "conflict-options-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setSourceDirectory( getBasedir() + "/src/main/java" );
         build.setDirectory( super.getBasedir() + "/target/test/unit/validate-options-test/target" );
         setBuild( build );

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/SubpackagesTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/SubpackagesTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/SubpackagesTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/SubpackagesTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,13 +20,10 @@
  */
 
 import org.apache.maven.model.Build;
-import org.apache.maven.model.Model;
 import org.apache.maven.model.Scm;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -43,6 +40,8 @@
 
     public SubpackagesTestMavenProjectStub()
     {
+        readModel( new File( getBasedir(), "subpackages-test-plugin-config.xml" ) );
+
         setGroupId( "org.apache.maven.plugins.maven-javadoc-plugin.unit" );
         setArtifactId( "subpackages-test" );
         setVersion( "1.0-SNAPSHOT" );
@@ -56,26 +55,12 @@
 
         Build build = new Build();
         build.setFinalName( "subpackages-test" );
-        build.setDirectory( getBasedir() + "/target/test/unit/subpackages-test/target" );
+        build.setDirectory( super.getBasedir() + "/target/test/unit/subpackages-test/target" );
         setBuild( build );
 
-        String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
-        compileSourceRoots.add( basedir + "/src/test/resources/unit/subpackages-test/subpackages/test" );
+        compileSourceRoots.add( getBasedir() + "/subpackages/test" );
         setCompileSourceRoots( compileSourceRoots );
-
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-
-        try
-        {
-            Model model = pomReader.read( new FileReader( new File(
-                getBasedir() + "/src/test/resources/unit/subpackages-test/subpackages-test-plugin-config.xml" ) ) );
-            setModel( model );
-        }
-        catch ( Exception e )
-        {
-            throw new RuntimeException( e );
-        }
     }
 
     /** {@inheritDoc} */
@@ -101,4 +86,10 @@
     {
         this.build = build;
     }
+
+    /** {@inheritDoc} */
+    public File getBasedir()
+    {
+        return new File( super.getBasedir() + "/src/test/resources/unit/subpackages-test" );
+    }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,12 +20,9 @@
  */
 
 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;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -39,29 +36,17 @@
 
     public TagTestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "tag-test-plugin-config.xml" ) );
 
-        try
-        {
-            model =
-                pomReader.read( new FileReader( new File( getBasedir(), "tag-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setSourceDirectory( getBasedir() + "/src/main/java" );
         build.setDirectory( super.getBasedir() + "/target/test/unit/tag-test/target" );
         setBuild( build );

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagletArtifactsMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagletArtifactsMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagletArtifactsMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagletArtifactsMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,7 +20,6 @@
  */
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -29,8 +28,6 @@
 import org.apache.maven.artifact.repository.DefaultArtifactRepository;
 import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
 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;
 
 /**
@@ -47,29 +44,17 @@
      */
     public TagletArtifactsMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "tagletArtifacts-test-plugin-config.xml" ) );
 
-        try
-        {
-            model =
-                pomReader.read( new FileReader( new File( getBasedir(), "tagletArtifacts-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setSourceDirectory( getBasedir() + "/src/main/java" );
         build.setDirectory( super.getBasedir() + "/target/test/unit/tagletArtifacts-test/target" );
         setBuild( build );

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagletTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagletTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagletTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TagletTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,13 +20,10 @@
  */
 
 import org.apache.maven.model.Build;
-import org.apache.maven.model.Model;
 import org.apache.maven.model.Scm;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -43,39 +40,26 @@
 
     public TagletTestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "taglet-test-plugin-config.xml" ) );
 
-        try
-        {
-            model = pomReader.read( new FileReader( new File( getBasedir()
-                + "/src/test/resources/unit/taglet-test/taglet-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Scm scm = new Scm();
         scm.setConnection( "scm:svn:http://svn.apache.org/maven/sample/trunk" );
         setScm( scm );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
-        build.setDirectory( getBasedir() + "/target/test/unit/taglet-test/target" );
+        build.setFinalName( getModel().getArtifactId() );
+        build.setDirectory( super.getBasedir() + "/target/test/unit/taglet-test/target" );
         setBuild( build );
 
-        String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
-        compileSourceRoots.add( basedir + "/src/test/resources/unit/taglet-test/taglet/test" );
+        compileSourceRoots.add( getBasedir() + "/taglet/test" );
         setCompileSourceRoots( compileSourceRoots );
     }
 
@@ -102,4 +86,10 @@
     {
         this.build = build;
     }
+
+    /** {@inheritDoc} */
+    public File getBasedir()
+    {
+        return new File( super.getBasedir() + "/src/test/resources/unit/taglet-test" );
+    }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TestJavadocMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TestJavadocMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TestJavadocMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/TestJavadocMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,7 +20,6 @@
  */
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -33,8 +32,6 @@
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 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;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.artifact.InvalidDependencyVersionException;
@@ -50,25 +47,14 @@
 
     public TestJavadocMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "test-javadoc-test-plugin-config.xml" ) );
 
-        try
-        {
-            model = pomReader.read( new FileReader( new File( getBasedir(), "test-javadoc-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Artifact junit = new DefaultArtifact( "junit", "junit", VersionRange.createFromVersion( "3.8.1" ),
                                               Artifact.SCOPE_TEST, "jar", null, new DefaultArtifactHandler( "jar" ),
@@ -77,7 +63,7 @@
         setTestArtifacts( Collections.singletonList( junit ) );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setDirectory( super.getBasedir() + "/target/test/unit/test-javadoc-test/target" );
         build.setSourceDirectory( getBasedir() + "/src/main/java" );
         build.setOutputDirectory( super.getBasedir() + "/target/test/unit/test-javadoc-test/target/classes" );

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/WrongEncodingOptionsTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/WrongEncodingOptionsTestMavenProjectStub.java?rev=797895&r1=797894&r2=797895&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/WrongEncodingOptionsTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/WrongEncodingOptionsTestMavenProjectStub.java Sun Jul 26 10:03:39 2009
@@ -20,12 +20,9 @@
  */
 
 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;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -39,29 +36,17 @@
 
     public WrongEncodingOptionsTestMavenProjectStub()
     {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
+        readModel( new File( getBasedir(), "wrong-encoding-test-plugin-config.xml" ) );
 
-        try
-        {
-            model =
-                pomReader.read( new FileReader( new File( getBasedir(), "wrong-encoding-test-plugin-config.xml" ) ) );
-            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() );
+        setGroupId( getModel().getGroupId() );
+        setArtifactId( getModel().getArtifactId() );
+        setVersion( getModel().getVersion() );
+        setName( getModel().getName() );
+        setUrl( getModel().getUrl() );
+        setPackaging( getModel().getPackaging() );
 
         Build build = new Build();
-        build.setFinalName( model.getArtifactId() );
+        build.setFinalName( getModel().getArtifactId() );
         build.setSourceDirectory( getBasedir() + "/src/main/java" );
         build.setDirectory( super.getBasedir() + "/target/test/unit/validate-options-test/target" );
         setBuild( build );



Mime
View raw message