Methods Summary |
---|
DottedNameRegistry1To1Impl | createNew()
return( new DottedNameRegistry1To1Impl() );
|
public void | test1To1Mapping()
final DottedNameRegistry1To1Impl registry = createNew();
final String dottedName1 = "a.b.c";
final String dottedName2 = "a.b.c.d";
final ObjectName objectName = new ObjectName( ":name=test" );
registry.add( dottedName1, objectName );
registry.add( dottedName2, objectName );
assertEquals( 1, registry.allDottedNameStrings().size() );
assertEquals( dottedName2, (String)registry.allDottedNameStrings().iterator().next() );
|
public void | testAdd()
final DottedNameRegistry1To1Impl registry = createNew();
final String dottedName = "a.b.c";
final ObjectName objectName = new ObjectName( ":name=test" );
registry.add( dottedName, objectName );
assertEquals( objectName, registry.dottedNameToObjectName( dottedName ) );
assertEquals( dottedName, registry.objectNameToDottedName( objectName ) );
assertEquals( 1, registry.allDottedNameStrings().size() );
assertEquals( 1, registry.allObjectNames().size() );
assertEquals( dottedName, (String)registry.allDottedNameStrings().iterator().next() );
|
public void | testCreation()
createNew();
|
public void | testNewIsEmpty()
assertEquals( 0, createNew().allDottedNameStrings().size() );
|
public void | testRemove()
final DottedNameRegistry1To1Impl registry = createNew();
final String dottedName = "a.b.c";
final ObjectName objectName = new ObjectName( ":name=test" );
registry.add( dottedName, objectName );
registry.remove( dottedName, objectName );
assertEquals( 0, registry.allDottedNameStrings().size() );
assertEquals( 0, registry.allObjectNames().size() );
|
public void | testReplaceWorks()
final DottedNameRegistry1To1Impl registry = createNew();
final String dottedName1 = "a.b.c";
final String dottedName2 = "a.b.c.d";
final ObjectName objectName = new ObjectName( ":name=test" );
registry.add( dottedName1, objectName );
registry.add( dottedName2, objectName );
assertEquals( dottedName2, registry.objectNameToDottedName( objectName ) );
|