-
1. Re: Using web.xml's non-test servlets
aslak Aug 8, 2010 6:05 AM (in response to alesj)Which Container are you running against?
If you want to test a Servlet, your probably don't want to be in-container, but run as a client. Use the @Run(AS_CLIENT) annotation on your Test class.
-
2. Re: Using web.xml's non-test servlets
alesj Aug 9, 2010 3:09 AM (in response to aslak)Which Container are you running against?
Jetty 6.1
If you want to test a Servlet, your probably don't want to be in-container, but run as a client. Use the @Run(AS_CLIENT) annotation on your Test class.
That's what I'm doing already:
@RunWith(Arquillian.class) @Run(RunModeType.AS_CLIENT) public class GMcTestCase
-
3. Re: Using web.xml's non-test servlets
aslak Aug 9, 2010 5:17 AM (in response to alesj)I see now that the Jetty Containers has hard coded a limitation of the Arquillian invokers in the Container it self, binding all deployments to "/test".
https://jira.jboss.org/browse/ARQ-243
You could try the arquillian-tomcat-embedded-6 container instead..
http://docs.jboss.org/arquillian/reference/latest/en-US/html_single/#container.tomcat-embedded-6
-
4. Re: Using web.xml's non-test servlets
dan.j.allen Aug 9, 2010 5:49 PM (in response to aslak)It's the context path that is hard-coded, not the servlet path. So the correct URL to use for your test w/ Alpha3 is:
http://localhost:8080/test/client/mc-initial
You can see an example of this in the client test case for the Jetty container:
Now, should the context path of the WAR be hard-coded to "/test"? No, especially when using @Run(AS_CLIENT). However, the problem is that the container needs to be able to communicate back to the invoker what context path the test deployment is using. So the hard-coding in the container is a result of hard-coding in the invoker. We need to make it dynamic.