-
1. Re: In-Container vs. As-Client: Differences and Applications
bmajsak Jul 4, 2012 11:41 AM (in response to zharvey)Hi Zac,
your description fits exactly in-container mode (plus your test class and additional arquillian modules such as enrichers for EJB etc will be deployed to the server as well).
When it comes to client mode, you deploy your shrinkwrap test archive (without repackaging as it's the case for in-container testing), but tests are performed from your local jvm (outside of the container in remote way).
More information can be found in our confluence space - https://docs.jboss.org/author/display/ARQ/Test+run+modes
I hope that helps.
Cheers,
Bartosz
-
2. Re: In-Container vs. As-Client: Differences and Applications
zharvey Jul 4, 2012 11:56 AM (in response to bmajsak)Thanks Bartosz!
So, to summarize:
- in-container: Arquillian simulates the container you describe/configure it with, repackages your code (somehow), and then runs your code right from inside your IDE (Eclipse in my case); but
- as-client: Arquillian uses ShrinkWrap to bundle up an archive (JAR/WAR/EAR) and deploy it to a remote container
Is this the gist of it or am I missing something here? Please understand I have already read the "Test run modes" page that you cited and am still having a tough time "seeing the forest through the trees" here! Thanks again!
-
3. Re: In-Container vs. As-Client: Differences and Applications
bmajsak Jul 4, 2012 12:03 PM (in response to zharvey)You are welcome.
Just to clarify.
in-container mode: Arquillian deploys your Shrinkwrap archive together with some additions (namely extensions you are using or which your container adapter relies on) to your target environment (through container adapter such as JBoss, Tomcat, Websphere to name a few). Then it runs your tests within this environment, collects the result and send them back to your test runner - could be IDE or a build tool (such as mvn's surefire).
as-client mode: Arquillian deploys your test archive and runs tests locally talking with your target environment from outside (local jvm)
I hope this gives you slightly better picture
Cheers!
-
4. Re: In-Container vs. As-Client: Differences and Applications
bmajsak Jul 4, 2012 12:09 PM (in response to zharvey)So "As-client" mode fits perfectly functional test of the web application or testing rest services using client.
-
5. Re: In-Container vs. As-Client: Differences and Applications
zharvey Jul 4, 2012 12:44 PM (in response to bmajsak)Ahhhh, so as a rule of thumb, one should probably use "as-client" for functionality testing and "in-container" for integration testing, correct? Thanks again!
-
6. Re: In-Container vs. As-Client: Differences and Applications
bmajsak Jul 4, 2012 2:12 PM (in response to zharvey)Or in other words you might think of it in the following way:
in-container mode for white box testing
client mode for black box testing
but obviously that's only one angle