*/
public class TestModuleDescriptor extends HiveMindTestCase
{
public void testAddDupeSchema() throws Exception
{
ModuleDescriptor md = new ModuleDescriptor(getClassResolver(), new DefaultErrorHandler());
md.setModuleId("foo");
Resource r = new ClasspathResource(getClassResolver(), "/foo/bar");
Location l1 = new LocationImpl(r, 20);
Location l2 = new LocationImpl(r, 97);
SchemaImpl s1 = new SchemaImpl("test");
s1.setId("bar");
s1.setLocation(l1);
SchemaImpl s2 = new SchemaImpl("test");
s2.setId("bar");
s2.setLocation(l2);
interceptLogging(md.getClass().getName());
md.addSchema(s1);
md.addSchema(s2);
assertLoggedMessagePattern("Schema foo.bar conflicts with existing schema at classpath:/foo/bar, line 20\\.");
assertSame(s1, md.getSchema("bar"));
}