StringBuilder sb;
protected void setUp() throws Exception {
agent = new ChukwaAgent();
ServletHolder servletHolder = new ServletHolder(ServletContainer.class);
servletHolder.setInitParameter("com.sun.jersey.config.property.resourceConfigClass",
"com.sun.jersey.api.core.PackagesResourceConfig");
servletHolder.setInitParameter("com.sun.jersey.config.property.packages",
"org.apache.hadoop.chukwa.datacollection.agent.rest");
servletHolder.setServletHandler(new ServletHandler());
jettyServer = new Server();
Context root = new Context(jettyServer, "/foo/bar", Context.SESSIONS);
root.setAttribute("ChukwaAgent", agent);
root.addServlet(servletHolder, "/*");
jettyServer.start();
jettyServer.setStopAtShutdown(true);
servlet = servletHolder.getServlet();
request = new MockHttpServletRequest();
request.setContextPath("/foo/bar");
response = new MockHttpServletResponse();
agent.processAddCommandE("add org.apache.hadoop.chukwa.datacollection.adaptor.ChukwaTestAdaptor SomeDataType 0");