verifyControls();
}
public void testAddDupeSchema() throws Exception
{
RegistryAssemblyImpl ra = new RegistryAssemblyImpl(new DefaultErrorHandler());
MockControl c1 = newControl(Schema.class);
MockControl c2 = newControl(Schema.class);
Schema s1 = (Schema) c1.getMock();
Schema s2 = (Schema) c2.getMock();
Resource r = new ClasspathResource(new DefaultClassResolver(), "/foo/bar");
Location l1 = new LocationImpl(r, 20);
Location l2 = new LocationImpl(r, 97);
interceptLogging(ra.getClass().getName());
s1.getLocation();
c1.setReturnValue(l1);
s2.getLocation();
c2.setReturnValue(l2);
replayControls();
ra.addSchema("foo.bar", s1);
ra.addSchema("foo.bar", s2);
assertLoggedMessagePattern("Schema foo.bar conflicts with existing schema at classpath:/foo/bar, line 20\\.");
assertSame(s1, ra.getSchema("foo.bar"));
verifyControls();
}