@SuppressWarnings("unchecked") @Override public Void call() throws Exception { delegate.setup(configuration); return null; } });
@SuppressWarnings("unchecked") @Override public Void call() throws Exception { delegate.setup(configuration); return null; } });
public void setup() throws IOException { deployableContainer = loadDeployableContainer(); manager = (ManagerBuilder.from()).extension(LoadableExtensionLoader.class).create(); manager.getContext(ContainerContext.class).activate("AS7 Managed"); configuration = new ManagedContainerConfiguration(); configuration.setJavaVmArguments(System.getProperty("jboss.options")); manager.inject(deployableContainer); deployableContainer.setup(configuration); try { deployableContainer.start(); } catch (LifecycleException e) { throw new RuntimeException(e); } }
@Test public void shouldNotStartCustomContainersInRegistry() throws Exception { registry.create(container5, serviceLoader).setState(Container.State.STOPPED); fire(new SetupContainers()); verify(deployableContainer, times(1)).setup(isA(DummyContainerConfiguration.class)); fire(new StartSuiteContainers()); verify(deployableContainer, times(0)).start(); fire(new StartClassContainers()); verify(deployableContainer, times(0)).start(); Assert.assertEquals(Container.State.SETUP, registry.getContainer(CONTAINER_5_NAME).getState()); }
@SuppressWarnings({"rawtypes", "unchecked"}) @Override public void setup() throws Exception { event.fire(new BeforeSetup(deployableContainer)); try { /* * TODO: should the Container producer some how be automatically registered ? * Or should we just 'know' who is the first one to create the context */ containerProducer.set(this); ((DeployableContainer) deployableContainer).setup(createDeployableConfiguration()); setState(Container.State.SETUP); } catch (Exception e) { setState(State.SETUP_FAILED); failureCause = e; throw e; } event.fire(new AfterSetup(deployableContainer)); }
@SuppressWarnings({"rawtypes", "unchecked"}) @Override public void setup() throws Exception { event.fire(new BeforeSetup(deployableContainer)); try { /* * TODO: should the Container producer some how be automatically registered ? * Or should we just 'know' who is the first one to create the context */ containerProducer.set(this); ((DeployableContainer) deployableContainer).setup(createDeployableConfiguration()); setState(Container.State.SETUP); } catch (Exception e) { setState(State.SETUP_FAILED); failureCause = e; throw e; } event.fire(new AfterSetup(deployableContainer)); }
@Test public void shouldSetupAllContainersInRegistry() throws Exception { registry.create(container1, serviceLoader); registry.create(container2, serviceLoader); registry.create(container3, serviceLoader); registry.create(container4, serviceLoader); registry.create(container5, serviceLoader); fire(new SetupContainers()); assertEventFiredInContext(SetupContainer.class, ContainerContext.class); assertEventFired(SetupContainer.class, 5); assertEventFiredInContext(BeforeSetup.class, ContainerContext.class); assertEventFired(BeforeSetup.class, 5); assertEventFiredInContext(AfterSetup.class, ContainerContext.class); assertEventFired(AfterSetup.class, 5); verify(deployableContainer, times(5)).setup(isA(DummyContainerConfiguration.class)); }