{"id":1426,"date":"2012-06-07T10:00:00","date_gmt":"2012-06-07T10:00:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/java-ee-6-testing-part-ii-introduction-to-arquillian-and-shrinkwrap.html"},"modified":"2012-10-22T05:42:11","modified_gmt":"2012-10-22T05:42:11","slug":"java-ee-6-testing-part-ii-introduction","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html","title":{"rendered":"Java EE 6 Testing Part II &#8211; Introduction to Arquillian and ShrinkWrap"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">In <a href=\"http:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.html\">Java EE 6 Testing Part I<\/a> I briefly introduced the EJB 3.1 Embeddable API using Glassfish embedded container to demonstrate how to start the container, lookup a bean in the project classpath and run a very simple integration test.<\/p>\n<p>This post focus on <a href=\"http:\/\/www.jboss.org\/arquillian\" target=\"_blank\">Arquillian<\/a> and <a href=\"http:\/\/www.jboss.org\/shrinkwrap\" target=\"_blank\">ShrinkWrap<\/a> and why they are awesome tools for integration testing of enterprise Java applications.    <\/p>\n<p>The source code used for this post is available on <a href=\"https:\/\/github.com\/samaxes\/java-ee-testing\" target=\"_blank\">GitHub<\/a> under the folder <code>arquillian-shrinkwrap<\/code>.     <\/p>\n<p><strong>The tools<\/strong>   <\/p>\n<dl>\n<dt>   Arquillian<\/dt>\n<dt>\n<\/dt>\n<dd><i> Arquillian brings test execution to the target runtime, alleviating the burden on the developer of managing the runtime from within the test or project build. To invert this control, Arquillian wraps a lifecycle around test execution that does the following:       <\/i><\/p>\n<ul><i><\/p>\n<li>Manages the lifecycle of one or more containers<\/li>\n<li>Bundles the test case, dependent classes and resources as ShrinkWrap archives<\/li>\n<li>Deploys the archives to the containers<\/li>\n<li>Enriches the test case with dependency injection and other declarative services<\/li>\n<li>Executes the tests inside (or against) the containers<\/li>\n<li>Returns the results to the test runner for reporting<\/li>\n<p><\/i><\/ul>\n<p><i>     <\/i>    <\/dd>\n<dt>   ShrinkWrap   <\/dt>\n<dd><i><br \/>\n ShrinkWrap, a central component of Arquillian, provides a simple mechanism to assemble archives like JARs, WARs, and EARs with a friendly, fluent API.<\/i><\/dd>\n<\/dl>\n<p>One of the major benefits of using Arquillian is that you run the tests in a remote container (i.e. application server). That means you\u2019ll be testing the <i>real deal<\/i>. No mocks. Not even embedded runtimes!     <\/p>\n<p><strong>Agenda<\/strong>   <\/p>\n<p>The following topics will be covered on this post:    <\/p>\n<ul>\n<li>Configure the Arquillian infrastructure in a Maven-based Java project<\/li>\n<li>Inject EJBs and Managed Beans (CDI) directly in test instances<\/li>\n<li>Test Java Persistence API (JPA) layer<\/li>\n<li>Run Arquillian in client mode<\/li>\n<li>Run and debug Arquillian tests inside your IDE<\/li>\n<\/ul>\n<p><strong>Configure Maven to run integration tests<\/strong>   <\/p>\n<p>To run integration tests with Maven we need a different approach. By different approach I mean a different plugin: the <a href=\"http:\/\/maven.apache.org\/plugins\/maven-failsafe-plugin\/\" target=\"_blank\" title=\"Maven Failsafe Plugin\">Maven Failsafe Plugin<\/a>.    <\/p>\n<p>The Failsafe Plugin is a fork of the <a href=\"http:\/\/maven.apache.org\/plugins\/maven-surefire-plugin\/\" target=\"_blank\" title=\"Maven Surefire Plugin\">Maven Surefire Plugin<\/a> designed to run integration tests.    <\/p>\n<p>The Failsafe plugin goals are designed to run after the package phase, on the integration-test phase.    <\/p>\n<p>The Maven lifecycle has four phases for running integration tests:    <\/p>\n<ul>\n<li><strong>pre-integration-test:<\/strong> on this phase we can start any required service or do any action, like starting a database, or starting a webserver, anything\u2026<\/li>\n<li><strong>integration-test:<\/strong> failsafe will run the test on this phase, so after all required services are started.<\/li>\n<li><strong>post-integration-test:<\/strong> time to shutdown all services\u2026<\/li>\n<li><strong>verify:<\/strong> failsafe runs another goal that interprets the results of tests here, if any tests didn\u2019t pass failsafe will display the results and exit the build.<\/li>\n<\/ul>\n<p>Configuring Failsafe in the POM:    <\/p>\n<pre class=\"brush:xml\">&lt;!-- clip --&gt;\r\n&lt;plugin&gt;\r\n    &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;maven-surefire-plugin&lt;\/artifactId&gt;\r\n    &lt;version&gt;2.12&lt;\/version&gt;\r\n    &lt;configuration&gt;\r\n        &lt;skipTests&gt;true&lt;\/skipTests&gt;\r\n    &lt;\/configuration&gt;\r\n&lt;\/plugin&gt;\r\n&lt;plugin&gt;\r\n    &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;maven-failsafe-plugin&lt;\/artifactId&gt;\r\n    &lt;version&gt;2.12&lt;\/version&gt;\r\n    &lt;configuration&gt;\r\n        &lt;encoding&gt;UTF-8&lt;\/encoding&gt;\r\n    &lt;\/configuration&gt;\r\n    &lt;executions&gt;\r\n        &lt;execution&gt;\r\n            &lt;id&gt;integration-test&lt;\/id&gt;\r\n            &lt;goals&gt;\r\n                &lt;goal&gt;integration-test&lt;\/goal&gt;\r\n            &lt;\/goals&gt;\r\n        &lt;\/execution&gt;\r\n        &lt;execution&gt;\r\n            &lt;id&gt;verify&lt;\/id&gt;\r\n            &lt;goals&gt;\r\n                &lt;goal&gt;verify&lt;\/goal&gt;\r\n            &lt;\/goals&gt;\r\n        &lt;\/execution&gt;\r\n    &lt;\/executions&gt;\r\n&lt;\/plugin&gt;\r\n&lt;!-- clip --&gt;<\/pre>\n<p>By default, the Surefire plugin executes <code>**\/Test*.java<\/code>, <code>**\/*Test.java<\/code>, and <code>**\/*TestCase.java<\/code> test classes. The Failsafe plugin will look for <code>**\/IT*.java<\/code>, <code>**\/*IT.java<\/code>, and <code>**\/*ITCase.java<\/code>. If you are using both the Surefire and Failsafe plugins, make sure that you use this naming convention to make it easier to identify which tests are being executed by which plugin.     <\/p>\n<p><strong>Configure Arquillian infrastructure in Maven<\/strong>   <\/p>\n<p>Configure your Maven project descriptor to use Arquillian by appending the following XML fragment:    <\/p>\n<pre class=\"brush:xml\">&lt;!-- clip --&gt;\r\n&lt;repositories&gt;\r\n    &lt;repository&gt;\r\n        &lt;id&gt;jboss-public-repository-group&lt;\/id&gt;\r\n        &lt;name&gt;JBoss Public Repository Group&lt;\/name&gt;\r\n        &lt;url&gt;http:\/\/repository.jboss.org\/nexus\/content\/groups\/public\/&lt;\/url&gt;\r\n    &lt;\/repository&gt;\r\n&lt;\/repositories&gt;\r\n\r\n&lt;dependencyManagement&gt;\r\n    &lt;dependencies&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;org.jboss.arquillian&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;arquillian-bom&lt;\/artifactId&gt;\r\n            &lt;version&gt;1.0.1.Final&lt;\/version&gt;\r\n            &lt;scope&gt;import&lt;\/scope&gt;\r\n            &lt;type&gt;pom&lt;\/type&gt;\r\n        &lt;\/dependency&gt;\r\n    &lt;\/dependencies&gt;\r\n&lt;\/dependencyManagement&gt;\r\n\r\n&lt;dependencies&gt;\r\n    &lt;dependency&gt;\r\n        &lt;groupId&gt;org.jboss.arquillian.testng&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;arquillian-testng-container&lt;\/artifactId&gt;\r\n        &lt;scope&gt;test&lt;\/scope&gt;\r\n    &lt;\/dependency&gt;\r\n    &lt;dependency&gt;\r\n        &lt;groupId&gt;org.testng&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;testng&lt;\/artifactId&gt;\r\n        &lt;version&gt;6.4&lt;\/version&gt;\r\n        &lt;scope&gt;test&lt;\/scope&gt;\r\n    &lt;\/dependency&gt;\r\n    &lt;dependency&gt;\r\n        &lt;groupId&gt;org.jboss.spec&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;jboss-javaee-6.0&lt;\/artifactId&gt;\r\n        &lt;version&gt;3.0.1.Final&lt;\/version&gt;\r\n        &lt;scope&gt;provided&lt;\/scope&gt;\r\n        &lt;type&gt;pom&lt;\/type&gt;\r\n    &lt;\/dependency&gt;\r\n&lt;\/dependencies&gt;\r\n\r\n&lt;profiles&gt;\r\n    &lt;profile&gt;\r\n        &lt;id&gt;jbossas-remote-7&lt;\/id&gt;\r\n        &lt;activation&gt;\r\n            &lt;activeByDefault&gt;true&lt;\/activeByDefault&gt;\r\n        &lt;\/activation&gt;\r\n        &lt;dependencies&gt;\r\n            &lt;dependency&gt;\r\n                &lt;groupId&gt;org.jboss.as&lt;\/groupId&gt;\r\n                &lt;artifactId&gt;jboss-as-arquillian-container-remote&lt;\/artifactId&gt;\r\n                &lt;version&gt;7.1.1.Final&lt;\/version&gt;\r\n                &lt;scope&gt;test&lt;\/scope&gt;\r\n            &lt;\/dependency&gt;\r\n        &lt;\/dependencies&gt;\r\n    &lt;\/profile&gt;\r\n&lt;\/profiles&gt;\r\n&lt;!-- clip --&gt;\r\n<\/pre>\n<p>Arquillian has a vast list of <a href=\"https:\/\/docs.jboss.org\/author\/display\/ARQ\/Container+adapters\" target=\"_blank\" title=\"Arquillian container adapters\">container adapters<\/a>. An Arquillian test can be executed in any container that is compatible with the programming model used in the test. However, throughout this post, only JBoss AS 7 is used.<br \/>\nSimilarly to <a href=\"http:\/\/www.samaxes.com\/2011\/12\/javaee-testing-ejb31-embeddable\/\" title=\"EJB 3.1 Embeddable API\">Java EE 6 Testing Part I<\/a>, I chose to use <a href=\"http:\/\/testng.org\/\">TestNG<\/a> testing framework, but again, <a href=\"http:\/\/www.junit.org\/\">JUnit<\/a> should work just as well.     <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><strong>Create testable components<\/strong>   <\/p>\n<p>Before looking at how to write integration tests with Arquillian we first need to have a component to test.<br \/>\nA <a href=\"http:\/\/docs.oracle.com\/javaee\/6\/tutorial\/doc\/gipjg.html\" target=\"_blank\" title=\"What Is a Session Bean?\">Session Bean<\/a> is a common component in Java EE stack and will serve as test subject. In this post, I\u2019ll be creating a very basic backend for adding new users to a database.    <\/p>\n<pre class=\"brush:java\">@Stateless\r\npublic class UserServiceBean {\r\n\r\n    @PersistenceContext\r\n    private EntityManager em;\r\n\r\n    public User addUser(User user) {\r\n        em.persist(user);\r\n        return user;\r\n    }\r\n\r\n    \/\/ Annotation says that we do not need to open a transaction\r\n    @TransactionAttribute(TransactionAttributeType.SUPPORTS)\r\n    public User findUserById(Long id) {\r\n        return em.find(User.class, id);\r\n    }\r\n}<\/pre>\n<p>In the code above I use <a href=\"http:\/\/docs.oracle.com\/javaee\/6\/tutorial\/doc\/bnbpz.html\" target=\"_blank\" title=\"Java Persistence API\">JPA<\/a> and so we need a persistence unit.<br \/>\nA <a href=\"http:\/\/docs.oracle.com\/javaee\/6\/tutorial\/doc\/bnbqw.html#bnbrj\" target=\"_blank\" title=\"Persistence Units\">persistence unit<\/a> defines a set of all entity classes that are managed by <code>EntityManager<\/code> instances in an application. This set of entity classes represents the data contained within a single data store.<br \/>\nPersistence units are defined by the <code>persistence.xml<\/code> configuration file:    <\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;persistence xmlns=\"http:\/\/java.sun.com\/xml\/ns\/persistence\"\r\n    xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n    xsi:schemaLocation=\"http:\/\/java.sun.com\/xml\/ns\/persistence\r\n\r\nhttp:\/\/java.sun.com\/xml\/ns\/persistence\/persistence_2_0.xsd\"\r\n\r\n    version=\"2.0\"&gt;\r\n    &lt;persistence-unit name=\"example\"&gt;\r\n        &lt;jta-data-source&gt;java:jboss\/datasources\/ExampleDS&lt;\/jta-data-source&gt;\r\n        &lt;properties&gt;\r\n            &lt;property name=\"hibernate.hbm2ddl.auto\" value=\"create-drop\" \/&gt;\r\n            &lt;property name=\"hibernate.show_sql\" value=\"true\" \/&gt;\r\n        &lt;\/properties&gt;\r\n    &lt;\/persistence-unit&gt;\r\n&lt;\/persistence&gt;<\/pre>\n<p>In this example I\u2019m using an example data source that uses H2 database and comes already configured with JBoss AS 7.    <\/p>\n<p>Finally, we also need an entity that maps to a table in the database:    <\/p>\n<pre class=\"brush:java\">@Entity\r\npublic class User {\r\n\r\n    @Id\r\n    @GeneratedValue\r\n    private Long id;\r\n\r\n    @NotNull\r\n    private String name;\r\n\r\n    \/\/ Removed constructors, getters and setters for brevity\r\n\r\n    @Override\r\n    public String toString() {\r\n        return \"User [id=\" + id + \", name=\" + name + \"]\";\r\n    }\r\n}\r\n<\/pre>\n<p><strong>Test JPA with Arquillian<\/strong>   <\/p>\n<p>We are now all set to write our first Arquillian test.<br \/>\nAn Arquillian test case looks just like a unit test with some extras. It must have three things:    <\/p>\n<ul>\n<li>Extend Arquillian class (this is specific to TestNG, with JUnit you need a <code>@RunWith(Arquillian.class)<\/code> annotation on the class)<\/li>\n<li>A public static method annotated with @Deployment that returns a ShrinkWrap archive<\/li>\n<li>At least one method annotated with @Test<\/li>\n<\/ul>\n<pre class=\"brush:java\">public class UserServiceBeanIT extends Arquillian {\r\n\r\n    private static final Logger LOGGER = Logger.getLogger(UserServiceBeanIT.class.getName());\r\n\r\n    @Inject\r\n    private UserServiceBean service;\r\n\r\n    @Deployment\r\n    public static JavaArchive createTestableDeployment() {\r\n        final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, \"example.jar\")\r\n                .addClasses(User.class, UserServiceBean.class)\r\n                .addAsManifestResource(\"META-INF\/persistence.xml\", \"persistence.xml\")\r\n                \/\/ Enable CDI\r\n                .addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create(\"beans.xml\"));\r\n\r\n        LOGGER.info(jar.toString(Formatters.VERBOSE));\r\n\r\n        return jar;\r\n    }\r\n\r\n    @Test\r\n    public void callServiceToAddNewUserToDB() {\r\n        final User user = new User(\"Ike\");\r\n        service.addUser(user);\r\n        assertNotNull(user.getId(), \"User id should not be null!\");\r\n    }\r\n}<\/pre>\n<p>This test is straightforward, it inserts a new user and checks that the <code>id<\/code> property has been filled with the generated value from the database.<br \/>\nSince the test is enriched by Arquillian, you can inject EJBs and managed beans normally using <code>@EJB<\/code> or <code>@Inject<\/code> annotations.<br \/>\nThe method annotated with <code>@Deployment<\/code> uses ShrinkWrap to build a JAR archive which will be deployed to the container and to which your tests will be run against. ShrinkWrap isolates the classes and resources which are needed by the test from the remainder of the classpath, you should include every component needed for the test to run inside the deployment archive.     <\/p>\n<p><strong>Client mode<\/strong>   <\/p>\n<p>Arquillian supports three test run modes:    <\/p>\n<ul>\n<li><strong>In-container mode<\/strong> is to test your application internals. This gives Arquillian the ability to communicate with the test, enrich the test and run the test remotely. In this mode, the test executes in the remote container; Arquillian uses this mode by default.<\/li>\n<li><strong>Client mode<\/strong> is to test how your application is used by clients. As opposed to in-container mode which repackages and overrides the test execution, the client mode does as little as possible. It does not repackage your <code>@Deployment<\/code> nor does it forward the test execution to a remote server. Your test case is running in your JVM as expected and you\u2019re free to test the container from the outside, as your clients see it. The only thing Arquillian does is to control the lifecycle of your <code>@Deployment<\/code>.<\/li>\n<li><strong>Mixed mode<\/strong> allows to mix the two run modes within the same test class.<\/li>\n<\/ul>\n<p>To run Arquillian in client mode lets first build a servlet to be tested:    <\/p>\n<pre class=\"brush:java\">@WebServlet(\"\/User\")\r\npublic class UserServlet extends HttpServlet {\r\n\r\n    private static final long serialVersionUID = -7125652220750352874L;\r\n\r\n    @Inject\r\n    private UserServiceBean service;\r\n\r\n    @Override\r\n    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n        response.setContentType(\"text\/plain\");\r\n\r\n        PrintWriter out = response.getWriter();\r\n        out.println(service.addUser(new User(\"Ike\")).toString());\r\n        out.close();\r\n    }\r\n\r\n    @Override\r\n    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,\r\n            IOException {\r\n        doGet(request, response);\r\n    }\r\n}<\/pre>\n<p>And now lets test it:    <\/p>\n<pre class=\"brush:java\">public class UserServletIT extends Arquillian {\r\n\r\n    private static final Logger LOGGER = Logger.getLogger(UserServletIT.class.getName());\r\n\r\n    \/\/ Not managed, should be used for external calls (e.g. HTTP)\r\n    @Deployment(testable = false)\r\n    public static WebArchive createNotTestableDeployment() {\r\n        final WebArchive war = ShrinkWrap.create(WebArchive.class, \"example.war\")\r\n                .addClasses(User.class, UserServiceBean.class, UserServlet.class)\r\n                .addAsResource(\"META-INF\/persistence.xml\")\r\n                \/\/ Enable CDI\r\n                .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create(\"beans.xml\"));\r\n\r\n        LOGGER.info(war.toString(Formatters.VERBOSE));\r\n\r\n        return war;\r\n    }\r\n\r\n    @RunAsClient \/\/ Same as @Deployment(testable = false), should only be used in mixed mode\r\n    @Test(dataProvider = Arquillian.ARQUILLIAN_DATA_PROVIDER)\r\n    public void callServletToAddNewUserToDB(@ArquillianResource URL baseURL) throws IOException {\r\n        \/\/ Servlet is listening at &lt;context_path&gt;\/User\r\n        final URL url = new URL(baseURL, \"User\");\r\n        final User user = new User(1L, \"Ike\");\r\n\r\n        StringBuilder builder = new StringBuilder();\r\n        BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));\r\n        String line;\r\n\r\n        while ((line = reader.readLine()) != null) {\r\n            builder.append(line);\r\n        }\r\n        reader.close();\r\n\r\n        assertEquals(builder.toString(), user.toString());\r\n    }\r\n}<\/pre>\n<p>Although this test is very simple, it allows you to test multiple layers of you application with a single method call.     <\/p>\n<p><strong>Run tests inside Eclipse<\/strong>   <\/p>\n<p>You can run an Arquillian test from inside your IDE just like a unit test.     <\/p>\n<p><strong>Run an Arquillian test<\/strong>   <\/p>\n<p>(Click on the images to enlarge)<\/p>\n<ul style=\"text-align: left\">\n<li> Install <a href=\"http:\/\/testng.org\/\" target=\"_blank\" title=\"TestNG\">TestNG<\/a> and <a href=\"http:\/\/www.jboss.org\/tools\" target=\"_blank\" title=\"JBoss Tools\">JBoss Tools<\/a> Eclipse plugins. <\/li>\n<li> Add a new JBoss AS server to Eclipse:<\/li>\n<\/ul>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/-XSsXVxhnSag\/T8_bkIG_AGI\/AAAAAAAAAjo\/WWiAholMgWw\/s1600\/add-jboss-server-big.png\"><img decoding=\"async\" border=\"0\" height=\"400\" src=\"http:\/\/3.bp.blogspot.com\/-XSsXVxhnSag\/T8_bkIG_AGI\/AAAAAAAAAjo\/WWiAholMgWw\/s400\/add-jboss-server-big.png\" width=\"357\" \/><\/a><\/div>\n<ul style=\"text-align: left\">\n<li>Start JBoss AS server:<\/li>\n<\/ul>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/4.bp.blogspot.com\/-qJBtgS6KD1w\/T8_cTahvLRI\/AAAAAAAAAjw\/7ruo9IgT1Ak\/s1600\/start-jboss-big.png\"><img decoding=\"async\" border=\"0\" height=\"312\" src=\"http:\/\/4.bp.blogspot.com\/-qJBtgS6KD1w\/T8_cTahvLRI\/AAAAAAAAAjw\/7ruo9IgT1Ak\/s400\/start-jboss-big.png\" width=\"400\" \/><\/a><\/div>\n<div>\n<\/div>\n<ul style=\"text-align: left\">\n<li>&nbsp;Run the test case from Eclipse, right click on the test file on the Project Explorer and select&nbsp;<\/li>\n<\/ul>\n<p><code>Run As &gt; TestNG Test<\/code>:<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/1.bp.blogspot.com\/-M6tZ1-xit9E\/T8_cmul4-OI\/AAAAAAAAAj4\/uW0_-9L6u4c\/s1600\/arquillian-testng-eclipse-test-big.png\"><img decoding=\"async\" border=\"0\" height=\"313\" src=\"http:\/\/1.bp.blogspot.com\/-M6tZ1-xit9E\/T8_cmul4-OI\/AAAAAAAAAj4\/uW0_-9L6u4c\/s400\/arquillian-testng-eclipse-test-big.png\" width=\"400\" \/><\/a><\/div>\n<p>The result should look similar to this:<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/4.bp.blogspot.com\/-tihaWTTMrqU\/T8_cwUgejoI\/AAAAAAAAAkA\/t_i79uRnT5E\/s1600\/arquillian-testng-eclipse-result-big.png\"><img decoding=\"async\" border=\"0\" height=\"313\" src=\"http:\/\/4.bp.blogspot.com\/-tihaWTTMrqU\/T8_cwUgejoI\/AAAAAAAAAkA\/t_i79uRnT5E\/s400\/arquillian-testng-eclipse-result-big.png\" width=\"400\" \/><\/a><\/div>\n<p><strong>Debug an Arquillian test<\/strong>   <\/p>\n<p>(Click on the images to enlarge)    <\/p>\n<p>Since we are using a remote container <code>Debug As &gt; TestNG Test<\/code> does not cause breakpoints to be activated.<br \/>\nInstead, we need to start the container in debug mode and attach the debugger. That\u2019s because the test is run in a different JVM than the original test runner.<br \/>\nThe only change you need to make to debug your test is to start JBoss AS server in debug mode:    <\/p>\n<ul style=\"text-align: left\">\n<li> Start JBoss AS server debug mode:<\/li>\n<\/ul>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/2.bp.blogspot.com\/-pD5kCtAoG6c\/T8_dyem-ZfI\/AAAAAAAAAkI\/5fHuzPUM4JU\/s1600\/debug-jboss-big.png\"><img decoding=\"async\" border=\"0\" height=\"312\" src=\"http:\/\/2.bp.blogspot.com\/-pD5kCtAoG6c\/T8_dyem-ZfI\/AAAAAAAAAkI\/5fHuzPUM4JU\/s400\/debug-jboss-big.png\" width=\"400\" \/><\/a><\/div>\n<ul style=\"text-align: left\">\n<li> Add the breakpoints you need to your code.<\/li>\n<li>And debug it by right clicking on the test file on the Project Explorer and selecting&nbsp;<\/li>\n<\/ul>\n<p><code>Run As &gt; TestNG Test<\/code>:<\/p>\n<ol><\/ol>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/2.bp.blogspot.com\/-7Yn1pfFyYFE\/T8_eU--StOI\/AAAAAAAAAkQ\/qxn1SBF_jKA\/s1600\/debug-arquillian-test-big.png\"><img decoding=\"async\" border=\"0\" height=\"311\" src=\"http:\/\/2.bp.blogspot.com\/-7Yn1pfFyYFE\/T8_eU--StOI\/AAAAAAAAAkQ\/qxn1SBF_jKA\/s400\/debug-arquillian-test-big.png\" width=\"400\" \/><\/a><\/div>\n<p><strong>More resources<\/strong>   <\/p>\n<p>I hope to have been able to highlight some of the benefits of Arquillian.<br \/>\nFor more Arquillian awesomeness take a look at the following resources:    <\/p>\n<ul>\n<li><a href=\"http:\/\/arquillian.org\/guides\/\" target=\"_blank\" title=\"Arquillian Guides\">Arquillian Guides<\/a><\/li>\n<li><a href=\"http:\/\/arquillian.org\/community\/\" target=\"_blank\" title=\"Arquillian Community\">Arquillian Community<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/arquillian\" target=\"_blank\" title=\"Arquillian Git Repository\">Arquillian Git Repository<\/a><\/li>\n<\/ul>\n<p><strong>Related Posts<\/strong> <\/p>\n<ul>\n<li><a href=\"http:\/\/www.samaxes.com\/2009\/09\/test-jboss-microcontainer-services\/\" title=\"Unit Testing JBoss 5 Services\">Unit Testing JBoss 5 Services<\/a><\/li>\n<li><a href=\"http:\/\/www.samaxes.com\/2011\/12\/javaee-testing-ejb31-embeddable\/\" title=\"Java EE 6 Testing Part I \u2013 EJB 3.1 Embeddable API\">Java EE 6 Testing Part I \u2013 EJB 3.1 Embeddable API<\/a><\/li>\n<li><a href=\"http:\/\/www.samaxes.com\/2010\/04\/maven-2-cobertura-plugin-updated\/\" title=\"Maven 2 Cobertura Plugin \u2013 Updated\">Maven 2 Cobertura Plugin \u2013 Updated<\/a><\/li>\n<li><a href=\"http:\/\/www.samaxes.com\/2009\/03\/jboss-pojocache-configuration\/\" title=\"JBoss PojoCache configuration\">JBoss PojoCache configuration<\/a><\/li>\n<li><a href=\"http:\/\/www.samaxes.com\/2008\/12\/jboss-as-50-is-out\/\" title=\"JBoss AS 5.0 is out!\">JBoss AS 5.0 is out!<\/a><\/li>\n<li><a href=\"http:\/\/www.samaxes.com\/2011\/12\/javaee-testing-ejb31-embeddable\/\" rel=\"prev\">Previous Entry: Java EE 6 Testing Part I \u2013 EJB 3.1 Embeddable API<\/a><\/li>\n<li><a href=\"http:\/\/www.samaxes.com\/2012\/06\/comparing-openddr-to-wurfl\/\" rel=\"next\">Next Entry: Comparing OpenDDR to WURFL<\/a><\/li>\n<\/ul>\n<p><strong><i>Reference: <\/i><\/strong><a href=\"http:\/\/www.samaxes.com\/2012\/05\/javaee-testing-introduction-arquillian-shrinkwrap\/\">Java EE 6 Testing Part II \u2013 Introduction to Arquillian and ShrinkWrap<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Samuel Santos at the <a href=\"http:\/\/www.samaxes.com\/\">Samaxes<\/a> blog.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In Java EE 6 Testing Part I I briefly introduced the EJB 3.1 Embeddable API using Glassfish embedded container to demonstrate how to start the container, lookup a bean in the project classpath and run a very simple integration test. This post focus on Arquillian and ShrinkWrap and why they are awesome tools for integration &hellip;<\/p>\n","protected":false},"author":228,"featured_media":163,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[336,90,289,550,273],"class_list":["post-1426","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-arquillian","tag-ejb","tag-java-ee6","tag-jboss-shrinkwrap","tag-testing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java EE 6 Testing Part II - Introduction to Arquillian and ShrinkWrap - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In Java EE 6 Testing Part I I briefly introduced the EJB 3.1 Embeddable API using Glassfish embedded container to demonstrate how to start the container,\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java EE 6 Testing Part II - Introduction to Arquillian and ShrinkWrap - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In Java EE 6 Testing Part I I briefly introduced the EJB 3.1 Embeddable API using Glassfish embedded container to demonstrate how to start the container,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2012-06-07T10:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-22T05:42:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jboss-shrinkwrap-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Samuel Santos\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/samaxes\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Samuel Santos\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-ii-introduction.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-ii-introduction.html\"},\"author\":{\"name\":\"Samuel Santos\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/cd56a59549f8c033272e083db1e9c216\"},\"headline\":\"Java EE 6 Testing Part II &#8211; Introduction to Arquillian and ShrinkWrap\",\"datePublished\":\"2012-06-07T10:00:00+00:00\",\"dateModified\":\"2012-10-22T05:42:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-ii-introduction.html\"},\"wordCount\":1345,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-ii-introduction.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jboss-shrinkwrap-logo.jpg\",\"keywords\":[\"Arquillian\",\"EJB\",\"Java EE6\",\"JBoss ShrinkWrap\",\"Testing\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-ii-introduction.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-ii-introduction.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-ii-introduction.html\",\"name\":\"Java EE 6 Testing Part II - Introduction to Arquillian and ShrinkWrap - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-ii-introduction.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-ii-introduction.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jboss-shrinkwrap-logo.jpg\",\"datePublished\":\"2012-06-07T10:00:00+00:00\",\"dateModified\":\"2012-10-22T05:42:11+00:00\",\"description\":\"In Java EE 6 Testing Part I I briefly introduced the EJB 3.1 Embeddable API using Glassfish embedded container to demonstrate how to start the container,\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-ii-introduction.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-ii-introduction.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-ii-introduction.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jboss-shrinkwrap-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jboss-shrinkwrap-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-ii-introduction.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Java EE 6 Testing Part II &#8211; Introduction to Arquillian and ShrinkWrap\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/cd56a59549f8c033272e083db1e9c216\",\"name\":\"Samuel Santos\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b6c5678bb5209583d05b239c02310b8d782188cbae9cff83b0e78e3f1f0e69fc?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b6c5678bb5209583d05b239c02310b8d782188cbae9cff83b0e78e3f1f0e69fc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b6c5678bb5209583d05b239c02310b8d782188cbae9cff83b0e78e3f1f0e69fc?s=96&d=mm&r=g\",\"caption\":\"Samuel Santos\"},\"description\":\"Java and Open Source evangelist, JUG leader and Web advocate for web standards and semantic technologies.\",\"sameAs\":[\"http:\\\/\\\/www.samaxes.com\\\/\",\"http:\\\/\\\/www.linkedin.com\\\/in\\\/samaxes\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/samaxes\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Samuel-Santos\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java EE 6 Testing Part II - Introduction to Arquillian and ShrinkWrap - Java Code Geeks","description":"In Java EE 6 Testing Part I I briefly introduced the EJB 3.1 Embeddable API using Glassfish embedded container to demonstrate how to start the container,","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html","og_locale":"en_US","og_type":"article","og_title":"Java EE 6 Testing Part II - Introduction to Arquillian and ShrinkWrap - Java Code Geeks","og_description":"In Java EE 6 Testing Part I I briefly introduced the EJB 3.1 Embeddable API using Glassfish embedded container to demonstrate how to start the container,","og_url":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2012-06-07T10:00:00+00:00","article_modified_time":"2012-10-22T05:42:11+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jboss-shrinkwrap-logo.jpg","type":"image\/jpeg"}],"author":"Samuel Santos","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/samaxes","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Samuel Santos","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html"},"author":{"name":"Samuel Santos","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/cd56a59549f8c033272e083db1e9c216"},"headline":"Java EE 6 Testing Part II &#8211; Introduction to Arquillian and ShrinkWrap","datePublished":"2012-06-07T10:00:00+00:00","dateModified":"2012-10-22T05:42:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html"},"wordCount":1345,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jboss-shrinkwrap-logo.jpg","keywords":["Arquillian","EJB","Java EE6","JBoss ShrinkWrap","Testing"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html","url":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html","name":"Java EE 6 Testing Part II - Introduction to Arquillian and ShrinkWrap - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jboss-shrinkwrap-logo.jpg","datePublished":"2012-06-07T10:00:00+00:00","dateModified":"2012-10-22T05:42:11+00:00","description":"In Java EE 6 Testing Part I I briefly introduced the EJB 3.1 Embeddable API using Glassfish embedded container to demonstrate how to start the container,","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jboss-shrinkwrap-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jboss-shrinkwrap-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Java EE 6 Testing Part II &#8211; Introduction to Arquillian and ShrinkWrap"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/cd56a59549f8c033272e083db1e9c216","name":"Samuel Santos","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b6c5678bb5209583d05b239c02310b8d782188cbae9cff83b0e78e3f1f0e69fc?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b6c5678bb5209583d05b239c02310b8d782188cbae9cff83b0e78e3f1f0e69fc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b6c5678bb5209583d05b239c02310b8d782188cbae9cff83b0e78e3f1f0e69fc?s=96&d=mm&r=g","caption":"Samuel Santos"},"description":"Java and Open Source evangelist, JUG leader and Web advocate for web standards and semantic technologies.","sameAs":["http:\/\/www.samaxes.com\/","http:\/\/www.linkedin.com\/in\/samaxes","https:\/\/x.com\/https:\/\/twitter.com\/samaxes"],"url":"https:\/\/www.javacodegeeks.com\/author\/Samuel-Santos"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1426","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/228"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=1426"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1426\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/163"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=1426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=1426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=1426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}