Resource r = mockResource();
Logger logger = mockLogger();
replay();
MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null, false);
model.addEmbeddedComponent("fred", "Fred1", COMPONENT_CLASS_NAME, false, null);
try
{
model.addEmbeddedComponent("fred", "Fred2", COMPONENT_CLASS_NAME, false, null);
unreachable();
} catch (IllegalArgumentException ex)
{
assertEquals(ex.getMessage(),
"Embedded component 'fred' has already been defined for component class org.example.components.Foo.");