assertTrue( "key2 should not be a parameter", ! parameters.isParameter( "key2" ) );
}
public void testGetParameter()
{
final Parameters parameters = new Parameters();
parameters.setParameter( "key1", "value1" );
try
{
assertEquals( "key1 should equal value1", "value1", parameters.getParameter( "key1" ) );
}
catch ( final ParameterException pe )
{
fail( pe.getMessage() );
}
try
{
parameters.getParameter( "key2" );
fail( "Not inserted parameter 'key2' exists" );
}
catch( final ParameterException pe )
{
//OK
}
assertEquals( "key1 should use correct value1", "value1", parameters.getParameter( "key1", "value1-1" ) );
assertEquals( "key2 should use default value2", "value2", parameters.getParameter( "key2", "value2" ) );
}