assertEquals(one, structure.getContext("one"));
}
public void testRemoveContexts()
{
StructureMetaData structure = createDefault();
assertEmpty(structure.getContexts());
ContextInfo one = createContext("one");
ContextInfo two = createContext("two");
ContextInfo three = createContext("three");
structure.addContext(one);
structure.addContext(two);
structure.addContext(three);
assertEquals(getExpected(one, two, three), structure.getContexts());
assertEquals(one, structure.getContext("one"));
assertEquals(two, structure.getContext("two"));
assertEquals(three, structure.getContext("three"));
structure.removeContext(one);
assertEquals(getExpected(two, three), structure.getContexts());
assertNull(structure.getContext("one"));
assertEquals(two, structure.getContext("two"));
assertEquals(three, structure.getContext("three"));
structure.removeContext(two);
assertEquals(getExpected(three), structure.getContexts());
assertNull(structure.getContext("one"));
assertNull(structure.getContext("two"));
assertEquals(three, structure.getContext("three"));
structure.removeContext(three);
assertEquals(getExpected(), structure.getContexts());
assertNull(structure.getContext("one"));
assertNull(structure.getContext("two"));
assertNull(structure.getContext("three"));
structure.addContext(one);
assertEquals(getExpected(one), structure.getContexts());
assertEquals(one, structure.getContext("one"));
// Removing a context not present is ok
structure.removeContext(two);
}