org.opencms.i18n
Class TestCmsEncoder

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

public class TestCmsEncoder
extends junit.framework.TestCase

Tests for the CmsEncoder.

Since:
6.0.0

Constructor Summary
TestCmsEncoder()
           
 
Method Summary
 void testDecodeHtmlEntities()
           
 void testDecodeUmlauts()
          Tests decoding german "umlaute".
 void testDoubleEncoding()
          Tests wether two subsequent calls to CmsEncoder.escapeWBlanks(String, String) lead to an expected result and ensures that the 2nd call does not do any further modifications.
 void testEncodeForHtml()
           
 void testEncodeNonIsoEntities()
           
 void testEncodePercent()
          Encodes a single '%' and ensures that it is transformed.
 void testLookupEncoding()
           
 void testParamEncoding()
          Tests the encoding of a single parameter.
 void testParameterEncoding()
          Tests encoding of parameters.
 void testRecursiveDecodingOfDoubleEncoded()
          Tests wether two subsequent calls to CmsEncoder.escapeWBlanks(String, String) are undone by onde decode call (the 2nd encode call must not modify anything.
 
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

TestCmsEncoder

public TestCmsEncoder()
Method Detail

testDecodeHtmlEntities

public void testDecodeHtmlEntities()
See Also:
CmsEncoder.decodeHtmlEntities(String, String)

testEncodeNonIsoEntities

public void testEncodeNonIsoEntities()
See Also:
CmsEncoder.encodeJavaEntities(String, String)

testDecodeUmlauts

public void testDecodeUmlauts()
Tests decoding german "umlaute".


testDoubleEncoding

public void testDoubleEncoding()
Tests wether two subsequent calls to CmsEncoder.escapeWBlanks(String, String) lead to an expected result and ensures that the 2nd call does not do any further modifications.


testEncodeForHtml

public void testEncodeForHtml()
See Also:
CmsEncoder.encodeHtmlEntities(String, String)

testParamEncoding

public void testParamEncoding()
Tests the encoding of a single parameter.


testEncodePercent

public void testEncodePercent()
Encodes a single '%' and ensures that it is transformed. Encodes a sequence that is already an encoded special character (e.g.: "%25") and ensures that this sequence is not encoded several times.


testLookupEncoding

public void testLookupEncoding()
See Also:
CmsEncoder.lookupEncoding(String, String)

testParameterEncoding

public void testParameterEncoding()
Tests encoding of parameters.


testRecursiveDecodingOfDoubleEncoded

public void testRecursiveDecodingOfDoubleEncoded()
Tests wether two subsequent calls to CmsEncoder.escapeWBlanks(String, String) are undone by onde decode call (the 2nd encode call must not modify anything.