-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MJAVADOC-544] - Changed behaviour of Javadoc for temporary files enc…
…oding (options, argfile, ...) added test for correct encoding of special characters in argsfile-file
- Loading branch information
1 parent
06f1c33
commit 90d16c6
Showing
5 changed files
with
268 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...st/java/org/apache/maven/plugins/javadoc/stubs/ArgfileUmlautEncodingMavenProjectStub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package org.apache.maven.plugins.javadoc.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.plugin.testing.stubs.MavenProjectStub; | ||
import org.apache.maven.model.Scm; | ||
import org.apache.maven.model.Build; | ||
|
||
import java.util.List; | ||
import java.util.ArrayList; | ||
import java.io.File; | ||
|
||
public class ArgfileUmlautEncodingMavenProjectStub | ||
extends MavenProjectStub | ||
{ | ||
private Scm scm; | ||
|
||
public ArgfileUmlautEncodingMavenProjectStub() | ||
{ | ||
readModel( new File( getBasedir(), "argfileumlautencoding-test-plugin-config.xml" ) ); | ||
|
||
setGroupId( "org.apache.maven.plugins.maven-javadoc-plugin.unit" ); | ||
setArtifactId( "argfileumlautencoding-test" ); | ||
setVersion( "1.0-SNAPSHOT" ); | ||
setName( "Maven Javadoc Plugin Argfile Umlaut Encoding Test" ); | ||
setUrl( "http://maven.apache.org" ); | ||
setPackaging( "jar" ); | ||
|
||
Scm scm = new Scm(); | ||
scm.setConnection( "scm:svn:http://svn.apache.org/maven/sample/trunk" ); | ||
setScm( scm ); | ||
|
||
Build build = new Build(); | ||
build.setFinalName( "argfileumlautencoding-test" ); | ||
build.setDirectory( super.getBasedir() + "/target/test/unit/argfileumlautencoding-test/target" ); | ||
setBuild( build ); | ||
|
||
List<String> compileSourceRoots = new ArrayList<>(); | ||
compileSourceRoots.add( getBasedir() + "/argfileumlautencoding/test" ); | ||
setCompileSourceRoots( compileSourceRoots ); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public Scm getScm() | ||
{ | ||
return scm; | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public void setScm( Scm scm ) | ||
{ | ||
this.scm = scm; | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public File getBasedir() | ||
{ | ||
return new File( super.getBasedir() + "/src/test/resources/unit/argfileumlautencoding-test" ); | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
...st/resources/unit/argfileumlautencoding-test/argfileumlautencoding-test-plugin-config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.apache.maven.plugins.maven-javadoc-plugin.unit</groupId> | ||
<artifactId>argfileumlautencoding-test</artifactId> | ||
<packaging>jar</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<inceptionYear>2006</inceptionYear> | ||
<name>Maven Javadoc Plugin Organization Umlaut Encoding Test</name> | ||
<url>http://maven.apache.org</url> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<configuration> | ||
<project implementation="org.apache.maven.plugins.javadoc.stubs.ArgfileUmlautEncodingMavenProjectStub"/> | ||
<localRepository>${localRepository}</localRepository> | ||
<outputDirectory>${basedir}/target/test/unit/argfileumlautencoding-test/target/site/apidocs</outputDirectory> | ||
<javadocOptionsDir>${basedir}/target/test/unit/argfileumlautencoding-test/target/javadoc-bundle-options</javadocOptionsDir> | ||
<breakiterator>false</breakiterator> | ||
<old>false</old> | ||
<show>protected</show> | ||
<quiet>true</quiet> | ||
<verbose>false</verbose> | ||
<author>true</author> | ||
<encoding>UTF-8</encoding> | ||
<docfilessubdirs>false</docfilessubdirs> | ||
<linksource>false</linksource> | ||
<nocomment>false</nocomment> | ||
<nodeprecated>false</nodeprecated> | ||
<nodeprecatedlist>false</nodeprecatedlist> | ||
<nohelp>false</nohelp> | ||
<noindex>false</noindex> | ||
<nonavbar>false</nonavbar> | ||
<nosince>false</nosince> | ||
<notree>false</notree> | ||
<serialwarn>false</serialwarn> | ||
<splitindex>false</splitindex> | ||
<stylesheet>java</stylesheet> | ||
<groups/> | ||
<tags/> | ||
<use>true</use> | ||
<version>true</version> | ||
<windowtitle>Maven Javadoc Plugin Argfile Umlaut Encoding Test 1.0-SNAPSHOT API</windowtitle> | ||
<debug>true</debug> | ||
<failOnError>true</failOnError> | ||
<detectJavaApiLink>true</detectJavaApiLink> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
39 changes: 39 additions & 0 deletions
39
src/test/resources/unit/argfileumlautencoding-test/argfileumlautencoding/test/AppSample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package argfileumlautencoding.test; | ||
|
||
/* | ||
* 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 Maria Odea Ching | ||
* @since 1.4 | ||
* @version %I%, %G% | ||
*/ | ||
public class AppSample | ||
{ | ||
|
||
/** | ||
* The main method | ||
* | ||
* @param args an array of strings that contains the arguments | ||
*/ | ||
public static void main( String[] args ) | ||
{ | ||
System.out.println( "Another Sample Application" ); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/test/resources/unit/argfileumlautencoding-test/argfileumlautencoding/test/Appäöüß.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package argfileumlautencoding.test; | ||
|
||
/* | ||
* 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. | ||
*/ | ||
|
||
public class Appäöüß | ||
{ | ||
|
||
public static void main( String[] args ) | ||
{ | ||
System.out.println( "Sample Application." ); | ||
} | ||
|
||
|
||
protected void sampleMethod( String str ) | ||
{ | ||
System.out.println( str ); | ||
} | ||
|
||
} |