Fixing CDI test case

This commit is contained in:
Joakim Erdfelt 2014-11-11 12:42:10 -07:00
parent 27eccbc9b2
commit 4bf2d37d01
2 changed files with 12 additions and 2 deletions

View File

@ -36,6 +36,6 @@ public class HelloIT
{
URI serverURI = new URI("http://localhost:58080/cdi-webapp/");
SimpleRequest req = new SimpleRequest(serverURI);
assertThat(req.getString("hello"),is("Hello World"));
assertThat(req.getString("hello"),is("Hello World" + System.lineSeparator()));
}
}

View File

@ -32,6 +32,16 @@ public class ServerInfoIT
public void testGET() throws Exception {
URI serverURI = new URI("http://localhost:58080/cdi-webapp/");
SimpleRequest req = new SimpleRequest(serverURI);
assertThat(req.getString("serverinfo"),is("Hello World"));
// Typical response:
// context = ServletContext@o.e.j.w.WebAppContext@37cb63fd{/cdi-webapp,
// file:///tmp/jetty-0.0.0.0-58080-cdi-webapp.war-_cdi-webapp-any-417759194514596377.dir/webapp/,AVAILABLE}
// {/cdi-webapp.war}\ncontext.contextPath = /cdi-webapp\ncontext.effective-version = 3.1\n
assertThat(req.getString("serverinfo"),
allOf(
containsString("context = ServletContext@"),
containsString("context.contextPath = /cdi-webapp"),
containsString("context.effective-version = 3.1")
));
}
}