org.opencms.util
Class TestCmsHtmlExtractor

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.opencms.util.TestCmsHtmlExtractor
All Implemented Interfaces:
junit.framework.Test

public class TestCmsHtmlExtractor
extends junit.framework.TestCase

Test case for CmsHtmlExtractor.

Since:
6.2.0

Constructor Summary
TestCmsHtmlExtractor(String arg0)
          Default JUnit constructor.
 
Method Summary
static String extractFromHtml2(String content)
          Extracts plain text from a String that contains HTML.
 void testHtmlExtractor()
          Tests the HTML extractor.
 void testHtmlExtractorWithEmptyInput()
          Tests the HTML extractor with an empty input String.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestCmsHtmlExtractor

public TestCmsHtmlExtractor(String arg0)
Default JUnit constructor.

Parameters:
arg0 - JUnit parameters
Method Detail

extractFromHtml2

public static String extractFromHtml2(String content)
                               throws Exception
Extracts plain text from a String that contains HTML.

Parameters:
content - the HTML content to extract the text from
Returns:
the extracted plain text
Throws:
Exception - in case something goes wrong

testHtmlExtractor

public void testHtmlExtractor()
                       throws Exception
Tests the HTML extractor.

Throws:
Exception - in case the test fails

testHtmlExtractorWithEmptyInput

public void testHtmlExtractorWithEmptyInput()
                                     throws Exception
Tests the HTML extractor with an empty input String.

Throws:
Exception - in case the test fails