use of org.datanucleus.plugin.Extension in project datanucleus-core by datanucleus.
the class PluginParserTest method testParseSymbolicName.
public void testParseSymbolicName() {
ClassLoaderResolver clr = new ClassLoaderResolverImpl();
NonManagedPluginRegistry mgr = new NonManagedPluginRegistry(clr, "EXCEPTION", true);
Bundle bundle1 = mgr.registerBundle(clr.getResource("/org/datanucleus/samples/plugin/MANIFEST1.MF", null));
mgr.registerExtensionsForPlugin(clr.getResource("/org/datanucleus/samples/plugin/plugin1expoint.xml", null), bundle1);
assertEquals(2, mgr.getExtensionPoints().length);
assertNull(mgr.getExtensionPoint("testID"));
assertNull(mgr.getExtensionPoint("testID2"));
assertNotNull(mgr.getExtensionPoint("org.datanucleus.plugin.test1.testID"));
assertNotNull(mgr.getExtensionPoint("org.datanucleus.plugin.test1.testID2"));
Bundle bundle2 = mgr.registerBundle(clr.getResource("/org/datanucleus/samples/plugin/MANIFEST2.MF", null));
mgr.registerExtensionsForPlugin(clr.getResource("/org/datanucleus/samples/plugin/plugin1expoint.xml", null), bundle2);
assertEquals(4, mgr.getExtensionPoints().length);
assertNotNull(mgr.getExtensionPoint("org.datanucleus.plugin.test2.testID"));
assertNotNull(mgr.getExtensionPoint("org.datanucleus.plugin.test2.testID2"));
Extension[] ex = mgr.getExtensionPoint("org.datanucleus.plugin.test2.testID").getExtensions();
assertEquals(ex.length, 0);
/*assertEquals("org.datanucleus.plugin.test2",ex[ex.length-1].getPlugin().getSymbolicName());*/
}
Aggregations