public void setUp() throws Exception {
kernel = new Kernel("test.kernel", "simple.geronimo.test");
kernel.boot();
GBeanMBean gbean;
// Create all the parts
gbean = new GBeanMBean(ServerInfo.GBEAN_INFO);
serverInfo = new ObjectName("geronimo.system:role=ServerInfo");
gbean.setAttribute("baseDirectory", ".");
kernel.loadGBean(serverInfo, gbean);
kernel.startGBean(serverInfo);
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(100));
gbean.setAttribute("algorithm", "HmacSHA1");
gbean.setAttribute("password", "secret");
kernel.loadGBean(loginService, gbean);
gbean = new GBeanMBean("org.apache.geronimo.security.realm.providers.PropertiesFileSecurityRealm");
kerberosRealm = new ObjectName("geronimo.security:type=SecurityRealm,realm=properties-realm");
gbean.setAttribute("realmName", "properties-realm");
gbean.setAttribute("maxLoginModuleAge", new Long(1 * 1000));
gbean.setAttribute("usersURI", (new File(new File("."), "src/test-data/data/users.properties")).toURI());
gbean.setAttribute("groupsURI", (new File(new File("."), "src/test-data/data/groups.properties")).toURI());
gbean.setReferencePatterns("ServerInfo", Collections.singleton(serverInfo));
kernel.loadGBean(kerberosRealm, 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:0"));
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.remoting.router.SubsystemRouter");
secureSubsystemRouter = new ObjectName("geronimo.remoting:router=SubsystemRouter,type=secure");
kernel.loadGBean(secureSubsystemRouter, 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(secureSubsystemRouter));
saslTransport = new ObjectName("geronimo.remoting:transport=async,subprotocol=sasl");
kernel.loadGBean(saslTransport, gbean);
gbean = new GBeanMBean("org.apache.geronimo.remoting.transport.TransportLoader");
gbean.setAttribute("bindURI", new URI("async://0.0.0.0:4243"));
gbean.setReferencePatterns("Router", Collections.singleton(secureSubsystemRouter));
gssapiTransport = new ObjectName("geronimo.remoting:transport=async,subprotocol=gssapi");
kernel.loadGBean(gssapiTransport, gbean);
gbean = new GBeanMBean("org.apache.geronimo.remoting.router.JMXRouter");
gbean.setReferencePatterns("SubsystemRouter", Collections.singleton(secureSubsystemRouter));
secureJmxRouter = new ObjectName("geronimo.remoting:router=JMXRouter,type=secure");
kernel.loadGBean(secureJmxRouter, gbean);
gbean = new GBeanMBean("org.apache.geronimo.security.remoting.jmx.LoginServiceStub");
gbean.setReferencePatterns("Router", Collections.singleton(secureJmxRouter));
serverStub = new ObjectName("geronimo.remoting:target=LoginServiceStub");
kernel.loadGBean(serverStub, gbean);
kernel.startGBean(loginService);
kernel.startGBean(kerberosRealm);