use of org.picocontainer.defaults.DefaultPicoContainer in project intellij-community by JetBrains.
the class ExtensionsAreaTest method testGetComponentAdapterDoesntDuplicateAdapters.
@Test
public void testGetComponentAdapterDoesntDuplicateAdapters() throws Exception {
MutablePicoContainer picoContainer = new ExtensionsAreaImpl("foo", null, new DefaultPicoContainer(), new Extensions.SimpleLogProvider()).getPicoContainer();
picoContainer.registerComponentImplementation("runnable", ExtensionsAreaTest.class);
List adapters = picoContainer.getComponentAdaptersOfType(ExtensionsAreaTest.class);
assertEquals(1, adapters.size());
}
use of org.picocontainer.defaults.DefaultPicoContainer in project intellij-community by JetBrains.
the class ExtensionsImplTest method testExtensionsNamespaces.
@Test
public void testExtensionsNamespaces() {
ExtensionsAreaImpl extensionsArea = new ExtensionsAreaImpl(new DefaultPicoContainer(), new Extensions.SimpleLogProvider());
extensionsArea.registerExtensionPoint("plugin.ep1", TestExtensionClassOne.class.getName(), ExtensionPoint.Kind.BEAN_CLASS);
extensionsArea.registerExtension("plugin", ExtensionComponentAdapterTest.readElement("<plugin:ep1 xmlns:plugin=\"plugin\" order=\"LAST\"><text>3</text></plugin:ep1>"));
extensionsArea.registerExtension("plugin", ExtensionComponentAdapterTest.readElement("<ep1 xmlns=\"plugin\" order=\"FIRST\"><text>1</text></ep1>"));
extensionsArea.registerExtension("plugin", ExtensionComponentAdapterTest.readElement("<extension point=\"plugin.ep1\"><text>2</text></extension>"));
ExtensionPoint extensionPoint = extensionsArea.getExtensionPoint("plugin.ep1");
TestExtensionClassOne[] extensions = (TestExtensionClassOne[]) extensionPoint.getExtensions();
assertEquals(3, extensions.length);
assertEquals("1", extensions[0].getText());
assertEquals("2", extensions[1].getText());
assertEquals("3", extensions[2].getText());
}
Aggregations