o added test case

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@617806 13f79535-47bb-0310-9956-ffa450edef68
master
Vincent Siveton 2008-02-02 14:33:57 +00:00
parent a850c5bd8a
commit 20347131d3
2 changed files with 44 additions and 1 deletions

View File

@ -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 ) )

View File

@ -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 <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id$
*/
public class PluginHelpGeneratorTest
extends AbstractGeneratorTestCase
{
public void testToText()
throws Exception
{
String javadoc = "";
assertEquals( "", PluginHelpGenerator.toText( javadoc ) );
// true HTML
javadoc = "Generates <i>something</i> for the project.";
assertEquals( "Generates something for the project.", PluginHelpGenerator.toText( javadoc ) );
// wrong HTML
javadoc = "Generates <i>something</i> <b> for the project.";
assertEquals( "Generates something for the project.", PluginHelpGenerator.toText( javadoc ) );
}
}