svn commit: r1816952 - in /maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugins/javadoc: TestJavadocReportTest.java stubs/TestJavadocMavenProjectStub.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1816952 - in /maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugins/javadoc: TestJavadocReportTest.java stubs/TestJavadocMavenProjectStub.java

Robert Scholte-8
Author: rfscholte
Date: Sat Dec  2 14:04:40 2017
New Revision: 1816952

URL: http://svn.apache.org/viewvc?rev=1816952&view=rev
Log:
Improve TestJavadocReportTest#testTestJavadoc
J8 warns and continues with missing dependency, J9 fails.
In fact test was wrong: dependency should have been on classpath

Modified:
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugins/javadoc/TestJavadocReportTest.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugins/javadoc/stubs/TestJavadocMavenProjectStub.java

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugins/javadoc/TestJavadocReportTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugins/javadoc/TestJavadocReportTest.java?rev=1816952&r1=1816951&r2=1816952&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugins/javadoc/TestJavadocReportTest.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugins/javadoc/TestJavadocReportTest.java Sat Dec  2 14:04:40 2017
@@ -55,5 +55,8 @@ public class TestJavadocReportTest
         File generatedFile =
             new File( getBasedir(), "target/test/unit/test-javadoc-test/target/site/apidocs/maven/AppTest.html" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
+        
+        File options = new File( getBasedir(), "target/test/unit/test-javadoc-test/target/site/apidocs/options");
+        FileUtils.fileRead( options ).contains( "junit-3.8.1.jar" );
     }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugins/javadoc/stubs/TestJavadocMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugins/javadoc/stubs/TestJavadocMavenProjectStub.java?rev=1816952&r1=1816951&r2=1816952&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugins/javadoc/stubs/TestJavadocMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugins/javadoc/stubs/TestJavadocMavenProjectStub.java Sat Dec  2 14:04:40 2017
@@ -23,6 +23,7 @@ import java.io.File;
 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;
@@ -50,12 +51,6 @@ public class TestJavadocMavenProjectStub
         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" ),
-                                              false );
-        junit.setFile( new File( getBasedir() + "/junit/junit/3.8.1/junit-3.8.1.jar" ) );
-        setTestArtifacts( Collections.singletonList( junit ) );
-
         Build build = new Build();
         build.setFinalName( getModel().getArtifactId() );
         build.setDirectory( super.getBasedir() + "/target/test/unit/test-javadoc-test/target" );
@@ -87,4 +82,14 @@ public class TestJavadocMavenProjectStub
     {
         return this;
     }
+    
+    @Override
+    public Set<Artifact> getArtifacts()
+    {
+        Artifact junit = new DefaultArtifact( "junit", "junit", VersionRange.createFromVersion( "3.8.1" ),
+                                              Artifact.SCOPE_TEST, "jar", null, new DefaultArtifactHandler( "jar" ),
+                                              false );
+        junit.setFile( new File( getBasedir() + "/junit/junit/3.8.1/junit-3.8.1.jar" ) );
+        return Collections.singleton( junit );
+    }
 }