Skip to content

Commit

Permalink
[MJAVADOC-616] Adjust test to please generate-test-metadata goal
Browse files Browse the repository at this point in the history
  • Loading branch information
rfscholte committed Jul 28, 2019
1 parent 12eaec4 commit 1969cea
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class JavadocReportTest

private static final char LINE_SEPARATOR = ' ';

public static final String OPTIONS_UMLAUT_ENCODING_Ö_Ä_Ü_ß = "Options Umlaut Encoding ö ä ü ß";
public static final String OPTIONS_UMLAUT_ENCODING = "Options Umlaut Encoding ö ä ü ß";

/** flag to copy repo only one time */
private static boolean TEST_REPO_CREATED = false;
Expand Down Expand Up @@ -559,9 +559,9 @@ public void testQuotedPath()
* @throws Exception if any
*/
public void testOptionsUmlautEncoding()
throws Exception
throws Exception
{
File testPom = new File(unit, "optionsumlautencoding-test/optionsumlautencoding-test-plugin-config.xml" );
File testPom = new File( unit, "optionsumlautencoding-test/optionsumlautencoding-test-plugin-config.xml" );
JavadocReport mojo = lookupMojo( testPom );
mojo.execute();

Expand All @@ -570,18 +570,19 @@ public void testOptionsUmlautEncoding()

// check for a part of the window title
String content;
String expected = OPTIONS_UMLAUT_ENCODING_Ö_Ä_Ü_ß;
String expected;
if ( JavaVersion.JAVA_VERSION.isAtLeast( "9" ) )
{
content = readFile( optionsFile, StandardCharsets.UTF_8 );
expected = OPTIONS_UMLAUT_ENCODING;
}
else
{
content = readFile( optionsFile, Charset.defaultCharset() );
expected = new String(expected.getBytes(Charset.defaultCharset()));
expected = new String( OPTIONS_UMLAUT_ENCODING.getBytes( Charset.defaultCharset() ) );
}

assertTrue( content.contains(expected) );
assertTrue( content.contains( expected ) );

File apidocs = new File( getBasedir(), "target/test/unit/optionsumlautencoding-test/target/site/apidocs" );

Expand Down

0 comments on commit 1969cea

Please sign in to comment.