ObjectName installerName = getInstallationService().loadNewInstaller(installJarUrl);
InstallerMBean installer = (InstallerMBean) MBeanServerInvocationHandler.newProxyInstance(container.getMBeanServer(),
installerName, InstallerMBean.class, false);
assertFalse(installer.isInstalled());
ObjectName lifecycleName = installer.install();
LifeCycleMBean lifecycleMBean = (LifeCycleMBean) MBeanServerInvocationHandler.newProxyInstance(container.getMBeanServer(),
lifecycleName, LifeCycleMBean.class, false);
assertEquals(LifeCycleMBean.SHUTDOWN, lifecycleMBean.getCurrentState());
// check mocks
verify();
// configure mocks
reset();
component.getLifeCycle();
componentMock.setReturnValue(lifecycle, MockControl.ONE_OR_MORE);
lifecycle.init(null);
lifecycleMock.setMatcher(MockControl.ALWAYS_MATCHER);
lifecycle.start();
replay();
// test component installation
lifecycleMBean.start();
assertEquals(LifeCycleMBean.STARTED, lifecycleMBean.getCurrentState());
// check mocks
verify();
// configure mocks
reset();