FileDocCategorySizeDatePackage
ParamNameMapperTest.javaAPI DocGlassfish v2 API4837Fri May 04 22:24:06 BST 2007com.sun.enterprise.management.support

ParamNameMapperTest

public final class ParamNameMapperTest extends TestCase

Fields Summary
Constructors Summary
public ParamNameMapperTest()

	
Methods Summary
public voidtestAcronyms1()

		final ParamNameMapper	m	= new ParamNameMapper();
		
		assertEquals( "ssl_algorithm", m.mangleAttributeName( "SSLAlgorithm" ) );
	
public voidtestAcronyms2()

		final ParamNameMapper	m	= new ParamNameMapper();
		
		assertEquals( "ssl_algorithm_enabled_today",
			m.mangleAttributeName( "SSLAlgorithmEnabledToday" ) );
	
public voidtestAcronyms3()

		final ParamNameMapper	m	= new ParamNameMapper();
		
		assertEquals( "ssl-tls-http-jndi_algorithm",
			m.mangleAttributeName( "SSL-TLS-HTTP-JNDIAlgorithm" ) );
	
public voidtestCreate()

		final ParamNameMapper	m	= new ParamNameMapper();
	
public voidtestEmpty()

		final ParamNameMapper	m	= new ParamNameMapper();
		
		assertEquals( "", m.mangleAttributeName( "" ) );
	
public voidtestMultipleLowerCaseWords()

		final ParamNameMapper	m	= new ParamNameMapper();
		
		assertEquals( "hello-there-you", m.mangleAttributeName( "hello-there-you" ) );
	
public voidtestMultipleUpperCaseWords()

		final ParamNameMapper	m	= new ParamNameMapper();
		
		assertEquals( "hello_there_you", m.mangleAttributeName( "HelloThereYou" ) );
	
public voidtestOverrides()

		final Map<String,String>	overrides	= MapUtil.newMap(
			new String[]
			{
				"SSLTLS", "ssl_tls",
				"GOOFY", "THECLOWN",
			}
		);
		
		final ParamNameMapper	m	= new ParamNameMapper( overrides );
		
		assertEquals( "ssl_tls", m.mangleAttributeName( "SSLTLS" ) );
		assertEquals( "THECLOWN", m.mangleAttributeName( "GOOFY" ) );
	
public voidtestSingleAllUpperCaseWord()

		final ParamNameMapper	m	= new ParamNameMapper();
		
		assertEquals( "hello", m.mangleAttributeName( "HELLO" ) );
	
public voidtestSingleLowerCaseLetter()

		final ParamNameMapper	m	= new ParamNameMapper();
		
		assertEquals( "x", m.mangleAttributeName( "x" ) );
	
public voidtestSingleLowerCaseWord()

		final ParamNameMapper	m	= new ParamNameMapper();
		
		assertEquals( "hello", m.mangleAttributeName( "hello" ) );
		assertEquals( "hello_there", m.mangleAttributeName( "hello_there" ) );
	
public voidtestSingleUpperCaseLetter()

		final ParamNameMapper	m	= new ParamNameMapper();
		
		assertEquals( "x", m.mangleAttributeName( "X" ) );
	
public voidtestSingleUpperCaseWord()

		final ParamNameMapper	m	= new ParamNameMapper();
		
		assertEquals( "hello", m.mangleAttributeName( "Hello" ) );