protected void setUp() throws Exception {
kernel = new Kernel("test.kernel", "simple.geronimo.test");
kernel.boot();
GBeanMBean gbean;
// Create all the parts
gbean = new GBeanMBean("org.apache.geronimo.security.jaas.LoginService");
loginService = new ObjectName("geronimo.security:type=LoginService");
gbean.setReferencePatterns("Realms", Collections.singleton(new ObjectName("geronimo.security:type=SecurityRealm,*")));
gbean.setAttribute("reclaimPeriod", new Long(10 * 1000)); // todo check other tests to see if ok
gbean.setAttribute("algorithm", "HmacSHA1");
gbean.setAttribute("password", "secret");
kernel.loadGBean(loginService, gbean);
gbean = new GBeanMBean("org.apache.geronimo.security.bridge.TestRealm");
testRealm = new ObjectName("geronimo.security:type=SecurityRealm,realm=testrealm");
gbean.setAttribute("realmName", TestRealm.REALM_NAME);
gbean.setAttribute("maxLoginModuleAge", new Long(1 * 1000));
gbean.setAttribute("debug", new Boolean(true));
kernel.loadGBean(testRealm, gbean);
gbean = new GBeanMBean("org.apache.geronimo.remoting.router.SubsystemRouter");
subsystemRouter = new ObjectName("geronimo.remoting:router=SubsystemRouter");
kernel.loadGBean(subsystemRouter, gbean);
gbean = new GBeanMBean("org.apache.geronimo.remoting.transport.TransportLoader");
gbean.setAttribute("bindURI", new URI("async://0.0.0.0:4242"));
gbean.setReferencePatterns("Router", Collections.singleton(subsystemRouter));
asyncTransport = new ObjectName("geronimo.remoting:transport=async");
kernel.loadGBean(asyncTransport, gbean);
gbean = new GBeanMBean("org.apache.geronimo.remoting.router.JMXRouter");
gbean.setReferencePatterns("SubsystemRouter", Collections.singleton(subsystemRouter));
jmxRouter = new ObjectName("geronimo.remoting:router=JMXRouter");
kernel.loadGBean(jmxRouter, gbean);
gbean = new GBeanMBean("org.apache.geronimo.security.remoting.jmx.LoginServiceStub");
gbean.setReferencePatterns("Router", Collections.singleton(jmxRouter));
serverStub = new ObjectName("geronimo.remoting:target=LoginServiceStub");
kernel.loadGBean(serverStub, gbean);
kernel.startGBean(loginService);
kernel.startGBean(testRealm);