Hi,
  I move my implementation of JAX-RS from RestEasy to CXF. One feature in
RestEasy I like is that it provides a very simple way to test my resources.
Its test code is like below:

        this.dispatcher = MockDispatcherFactory.createDispatcher();
        this.dispatcher.getRegistry().addResourceFactory(new
POJOResourceFactory(organization.class), "hr");
        this.dispatcher.getRegistry().addResourceFactory(new
POJOResourceFactory(bureaucracy.class), "hr");

        MockHttpRequest request = MockHttpRequest.get("/hr/bureaucracy/" +
oid(b) + "/organization/" + oid(finance) +"/children");
        MockHttpResponse response = new MockHttpResponse();
        this.dispatcher.invoke(request, response);
        System.out.println(response.getContentAsString());
        assert response.getStatus() == 200;

That is, I don't need to startup http (jetty) server. All (server and
client) are done in memory and in one thread. Is there similar way to do
this in CXF?

Regards,
Rice

Reply via email to