public class PluginParserTest extends TestCase
{
public void testParseExtensionPoint()
{
ClassLoaderResolver clr = new JDOClassLoaderResolver();
NonManagedPluginRegistry mgr = new NonManagedPluginRegistry(clr, "EXCEPTION");
assertEquals(0,mgr.getExtensionPoints().length);
Bundle bundle0 = mgr.registerBundle(clr.getResource("/org/jpox/samples/plugin/MANIFEST0.MF",null));
mgr.registerPluginExtensions(clr.getResource("/org/jpox/samples/plugin/plugin1expoint.xml",null),bundle0);
assertEquals(2,mgr.getExtensionPoints().length);
assertNull(mgr.getExtensionPoint("testID"));
assertNull(mgr.getExtensionPoint("testID2"));
assertNotNull(mgr.getExtensionPoint("org.jpox.testID"));
assertNotNull(mgr.getExtensionPoint("org.jpox.testID2"));
ExtensionPoint point = mgr.getExtensionPoint("org.jpox.testID");
assertEquals("testID", point.getId());
assertEquals("org.jpox.testID", point.getUniqueId());
assertEquals("testName", point.getName());
assertNotNull(clr.getResource("/org/jpox/samples/plugin/plugin1.xsd",null));
assertEquals(clr.getResource("/org/jpox/samples/plugin/plugin1.xsd",null), point.getSchema());
assertEquals(0,point.getExtensions().length);
mgr.registerPluginExtensions(clr.getResource("/org/jpox/samples/plugin/plugin1.xml",null),bundle0);
assertEquals(2,point.getExtensions().length);
Extension[] exts = point.getExtensions();
assertEquals(exts[0].getPlugin(),exts[1].getPlugin());
assertEquals(2,exts[0].getConfigurationElements().length);