You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2017/12/20 09:16:38 UTC
[maven-javadoc-plugin] 07/13: Improve
TestJavadocReportTest#testTestJavadoc J8 warns and continues with missing
dependency,
J9 fails. In fact test was wrong: dependency should have been on classpath
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master2
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git
commit e071bd56dc6a4f463da80eded59afff9f4b07e4c
Author: Robert Scholte <rf...@apache.org>
AuthorDate: Sat Dec 2 14:04:40 2017 +0000
Improve TestJavadocReportTest#testTestJavadoc
J8 warns and continues with missing dependency, J9 fails.
In fact test was wrong: dependency should have been on classpath
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1816952 13f79535-47bb-0310-9956-ffa450edef68
---
.../maven/plugins/javadoc/TestJavadocReportTest.java | 3 +++
.../javadoc/stubs/TestJavadocMavenProjectStub.java | 17 +++++++++++------
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/test/java/org/apache/maven/plugins/javadoc/TestJavadocReportTest.java b/src/test/java/org/apache/maven/plugins/javadoc/TestJavadocReportTest.java
index 740226b..047b754 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/TestJavadocReportTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/TestJavadocReportTest.java
@@ -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" );
}
}
diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/TestJavadocMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/TestJavadocMavenProjectStub.java
index 6a422c2..c0f246c 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/TestJavadocMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/TestJavadocMavenProjectStub.java
@@ -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 );
+ }
}
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.