I've been trying to create a test file for an Application subclass that I have
created, but when I run it I get many errors. Here is an example of a test
case:
RestletServer server = new RestletServer(TEST_PORT);
SubApplication app = new SubApplication(new Context());
server.setApplication(app);
server.start();
Request request = new Request(Method.GET,
"http://localhost:"+TEST_PORT+"/blah");
Response response = new Response(request);
server.handle(request, response);
Fairly straightforward? Problem is that when I run it I get a
NullPointerException that points to
com.noelios.restlet.container.HostScorer.beforeHandle(HostScorer.java:176)
Possibly any ideas on what could be going wrong? Thanks.