ExtensionComponentAdapter implements LoadingOrder.Orderable, AssignableToComponentAdapter { @Override public LoadingOrder getOrder() { return LoadingOrder.readOrder(myExtensionElement.getAttributeValue("order")); } ExtensionComponentAdapter(@NotNull String implementationClass,
                                   Element extensionElement,
                                   PicoContainer container,
                                   PluginDescriptor pluginDescriptor,
                                   boolean deserializeInstance); @Override Object getComponentKey(); @Override Class getComponentImplementation(); @Override Object getComponentInstance(final PicoContainer container); @Override void verify(PicoContainer container); @Override void accept(PicoVisitor visitor); Object getExtension(); @Override LoadingOrder getOrder(); @Override String getOrderId(); @Override Element getDescribingElement(); PluginId getPluginName(); PluginDescriptor getPluginDescriptor(); @Override String getAssignableToClassName(); boolean isNotificationSent(); void setNotificationSent(boolean notificationSent); @Override String toString(); static final ExtensionComponentAdapter[] EMPTY_ARRAY; }
@Test public void testLoadingOrderReading() { assertEquals(LoadingOrder.ANY, createAdapter("<extension/>").getOrder()); assertEquals(LoadingOrder.FIRST, createAdapter("<extension order=\"FIRST\"/>").getOrder()); assertEquals(LoadingOrder.LAST, createAdapter("<extension order=\"LAST\"/>").getOrder()); assertEquals(LoadingOrder.before("test"), createAdapter("<extension order=\"BEFORE test\"/>").getOrder()); assertEquals(LoadingOrder.after("test"), createAdapter("<extension order=\"AFTER test\"/>").getOrder()); }