From 20347131d33b5947e3bd18f559751c8eeb981aab Mon Sep 17 00:00:00 2001 From: Vincent Siveton Date: Sat, 2 Feb 2008 14:33:57 +0000 Subject: [PATCH] o added test case git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@617806 13f79535-47bb-0310-9956-ffa450edef68 --- .../plugin/generator/PluginHelpGenerator.java | 2 +- .../generator/PluginHelpGeneratorTest.java | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/generator/PluginHelpGeneratorTest.java diff --git a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java index bf5f3cc..347b868 100644 --- a/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java +++ b/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java @@ -478,7 +478,7 @@ public class PluginHelpGenerator * @return a String with HTML tags into pure text * @throws IOException if any */ - private static String toText( String str ) + protected static String toText( String str ) throws IOException { if ( StringUtils.isEmpty( str ) ) diff --git a/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/generator/PluginHelpGeneratorTest.java b/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/generator/PluginHelpGeneratorTest.java new file mode 100644 index 0000000..49cfbf7 --- /dev/null +++ b/maven-plugin-tools-api/src/test/java/org/apache/maven/tools/plugin/generator/PluginHelpGeneratorTest.java @@ -0,0 +1,43 @@ +package org.apache.maven.tools.plugin.generator; + +/* + * 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 Vincent Siveton + * @version $Id$ + */ +public class PluginHelpGeneratorTest + extends AbstractGeneratorTestCase +{ + public void testToText() + throws Exception + { + String javadoc = ""; + assertEquals( "", PluginHelpGenerator.toText( javadoc ) ); + + // true HTML + javadoc = "Generates something for the project."; + assertEquals( "Generates something for the project.", PluginHelpGenerator.toText( javadoc ) ); + + // wrong HTML + javadoc = "Generates something for the project."; + assertEquals( "Generates something for the project.", PluginHelpGenerator.toText( javadoc ) ); + } +} \ No newline at end of file