MuleAgentHttpServerFactory { public static MuleAgentHttpServer create(Agent pParent, MuleAgentConfig pConfig) { if (ClassUtil.checkForClass("org.mortbay.jetty.Server")) { return new MortbayMuleAgentHttpServer(pParent, pConfig); } else if (ClassUtil.checkForClass("org.eclipse.jetty.server.ServerConnector")) { return new Jetty9MuleAgentHttpServer(pParent, pConfig); } else if (ClassUtil.checkForClass("org.eclipse.jetty.server.Server")) { return new Jetty7And8MuleAgentHttpServer(pParent, pConfig); } throw new IllegalStateException("Cannot detect Jetty version (tried 6,7,8,9)"); } protected  MuleAgentHttpServerFactory(); static MuleAgentHttpServer create(Agent pParent, MuleAgentConfig pConfig);  }
@Test public void createServerOfMortbayPackage() throws Exception { MuleAgentHttpServer actual = MuleAgentHttpServerFactory.create(agent, agent); assertEquals(actual.getClass(), MortbayMuleAgentHttpServer.class); }