{"id":1427,"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-i-ejb-3-1-embeddable-api.html"},"modified":"2012-10-22T05:42:22","modified_gmt":"2012-10-22T05:42:22","slug":"java-ee-6-testing-part-i-ejb-31","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.html","title":{"rendered":"Java EE 6 Testing Part I &#8211; EJB 3.1 Embeddable API"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">One of the most common requests we hear from Enterprise JavaBeans developers is for improved unit\/integration testing support.<br \/>\n<a href=\"http:\/\/jcp.org\/en\/jsr\/detail?id=318\" target=\"_blank\">EJB 3.1 Specification<\/a> introduced the EJB 3.1 Embeddable API for executing EJB components within a Java SE environment.  <\/p>\n<p><i>    Unlike traditional Java EE server-based execution, embeddable usage allows client code and its corresponding enterprise beans to run within the same JVM and class loader. This provides better support for testing, offline processing (e.g. batch), and the use of the EJB programming model in desktop applications.<br \/>\n [&#8230;]<br \/>\n The embeddable EJB container provides a managed environment with support for the same basic services that exist within a Java EE runtime: injection, access to a component environment, container-managed transactions, etc. In general, enterprise bean components are unaware of the kind of managed environment in which they are running. This allows maximum reusability of enterprise components across a wide range of testing and deployment scenarios without significant rework.    <\/i>   <\/p>\n<p>Let\u2019s look at an example.    <\/p>\n<p>Start by creating a Maven project and add the embeddable GlassFish dependency.<br \/>\nI chose to use <a href=\"http:\/\/testng.org\/\" target=\"_blank\">TestNG<\/a> testing framework, but <a href=\"http:\/\/www.junit.org\/\" target=\"_blank\">JUnit<\/a> should work just as well.    <\/p>\n<pre class=\"brush:xml\">&lt;dependencies&gt;\r\n    &lt;dependency&gt;\r\n        &lt;groupId&gt;org.glassfish.extras&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;glassfish-embedded-all&lt;\/artifactId&gt;\r\n        &lt;version&gt;3.1.2&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.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;!--\r\n        The javaee-api is stripped of any code and is just used to\r\n        compile your application. The scope provided in Maven means\r\n        that it is used for compiling, but is also available when\r\n        testing. For this reason, the javaee-api needs to be below\r\n        the embedded Glassfish dependency. The javaee-api can actually\r\n        be omitted when the embedded Glassfish dependency is included,\r\n        but to keep your project Java-EE 6 rather than GlassFish,\r\n        specification is important.\r\n    --&gt;\r\n    &lt;dependency&gt;\r\n        &lt;groupId&gt;javax&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;javaee-api&lt;\/artifactId&gt;\r\n        &lt;version&gt;6.0&lt;\/version&gt;\r\n        &lt;scope&gt;provided&lt;\/scope&gt;\r\n    &lt;\/dependency&gt;\r\n&lt;\/dependencies&gt;<\/pre>\n<p>Here\u2019s a simple <code>Stateless<\/code> session bean:    <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\"brush:java\">@Stateless\r\npublic class HelloWorld {\r\n    public String hello(String message) {\r\n        return \"Hello \" + message;\r\n    }\r\n}<\/pre>\n<p>It exposes business methods through a <a href=\"http:\/\/java.sun.com\/developer\/technicalArticles\/JavaEE\/JavaEE6Overview_Part3.html#noiview\" target=\"_blank\">no-interface view<\/a>.<br \/>\nThere is no special API it must use to be capable of embeddable execution.    <\/p>\n<p>Here is some test code to execute the bean in an embeddable container:    <\/p>\n<pre class=\"brush:java\">public class HelloWorldTest {\r\n    private static EJBContainer ejbContainer;\r\n\r\n    private static Context ctx;\r\n\r\n    @BeforeClass\r\n    public static void setUpClass() throws Exception {\r\n        \/\/ Instantiate an embeddable EJB container and search the\r\n        \/\/ JVM class path for eligible EJB modules or directories\r\n        ejbContainer = EJBContainer.createEJBContainer();\r\n\r\n        \/\/ Get a naming context for session bean lookups\r\n        ctx = ejbContainer.getContext();\r\n    }\r\n\r\n    @AfterClass\r\n    public static void tearDownClass() throws Exception {\r\n        \/\/ Shutdown the embeddable container\r\n        ejbContainer.close();\r\n    }\r\n\r\n    @Test\r\n    public void hello() throws NamingException {\r\n        \/\/ Retrieve a reference to the session bean using a portable\r\n        \/\/ global JNDI name\r\n        HelloWorld helloWorld = (HelloWorld)\r\n                ctx.lookup(\"java:global\/classes\/HelloWorld\");\r\n\r\n        \/\/ Do your tests\r\n        assertNotNull(helloWorld);\r\n        String expected = \"World\";\r\n        String hello = helloWorld.hello(expected);\r\n        assertNotNull(hello);\r\n        assertTrue(hello.endsWith(expected));\r\n    }\r\n}<\/pre>\n<p>The source code is available on <a href=\"https:\/\/github.com\/samaxes\/java-ee-testing\" target=\"_blank\">GitHub<\/a> under the folder <code>ejb31-embeddable<\/code>.    <\/p>\n<p>For a step by step tutorial with a JPA example take a look at <a href=\"http:\/\/netbeans.org\/kb\/docs\/javaee\/javaee-entapp-junit.html\" target=\"_blank\">Using the Embedded EJB Container to Test Enterprise Applications<\/a> from NetBeans docs.    <\/p>\n<p>While this new API is a step forward, I still have an issue with this approach: you are bringing the container to the test. This requires a specialized container which is different from your production environment.    <\/p>\n<p>In <a href=\"http:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-ii-introduction.html\">Java EE 6 Testing Part II<\/a>, I will introduce <a href=\"http:\/\/www.jboss.org\/arquillian\" target=\"_blank\">Arquillian<\/a> and <a href=\"http:\/\/www.jboss.org\/shrinkwrap\" target=\"_blank\">ShrinkWrap<\/a>.<br \/>\nArquillian, a powerful container-oriented testing framework layered atop TestNG and JUnit, gives you the ability to create the production environment on the container of your choice and just execute tests in that environment (using the datasources, JMS destinations, and a whole lot of other configurations you expect to see in production environment). Instead of bringing your runtime to the test, Arquillian brings your test to the runtime.<\/p>\n<p><strong>Related Posts<\/strong> <\/p>\n<ul>\n<li><a href=\"http:\/\/www.samaxes.com\/2012\/05\/javaee-testing-introduction-arquillian-shrinkwrap\/\" title=\"Java EE 6 Testing Part II \u2013 Introduction to Arquillian and ShrinkWrap\">Java EE 6 Testing Part II \u2013 Introduction to Arquillian and ShrinkWrap<\/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\/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\/2008\/01\/stripes-and-ejb3\/\" title=\"Stripes framework and EJB3\">Stripes framework and EJB3<\/a><\/li>\n<li><a href=\"http:\/\/www.samaxes.com\/2007\/06\/maven-2-cobertura-plugin\/\" title=\"Maven 2 Cobertura Plugin\">Maven 2 Cobertura Plugin<\/a><\/li>\n<li><a href=\"http:\/\/www.samaxes.com\/2011\/09\/change-url-parameters-with-jquery\/\" rel=\"prev\">Previous Entry: Changing URL parameters with jQuery<\/a><\/li>\n<li><a href=\"http:\/\/www.samaxes.com\/2012\/05\/javaee-testing-introduction-arquillian-shrinkwrap\/\" rel=\"next\">Next Entry: Java EE 6 Testing Part II \u2013 Introduction to Arquillian and ShrinkWrap<\/a><\/li>\n<\/ul>\n<p><strong><i>Reference: <\/i><\/strong><a href=\"http:\/\/www.samaxes.com\/2011\/12\/javaee-testing-ejb31-embeddable\/\">Java EE 6 Testing Part I \u2013 EJB 3.1 Embeddable API<\/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>One of the most common requests we hear from Enterprise JavaBeans developers is for improved unit\/integration testing support. EJB 3.1 Specification introduced the EJB 3.1 Embeddable API for executing EJB components within a Java SE environment. Unlike traditional Java EE server-based execution, embeddable usage allows client code and its corresponding enterprise beans to run within &hellip;<\/p>\n","protected":false},"author":228,"featured_media":148,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[90,289,273],"class_list":["post-1427","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-ejb","tag-java-ee6","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 I - EJB 3.1 Embeddable API - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"One of the most common requests we hear from Enterprise JavaBeans developers is for improved unit\/integration testing support. EJB 3.1 Specification\" \/>\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-i-ejb-31.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 I - EJB 3.1 Embeddable API - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"One of the most common requests we hear from Enterprise JavaBeans developers is for improved unit\/integration testing support. EJB 3.1 Specification\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.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:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-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=\"4 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-i-ejb-31.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-i-ejb-31.html\"},\"author\":{\"name\":\"Samuel Santos\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/cd56a59549f8c033272e083db1e9c216\"},\"headline\":\"Java EE 6 Testing Part I &#8211; EJB 3.1 Embeddable API\",\"datePublished\":\"2012-06-07T10:00:00+00:00\",\"dateModified\":\"2012-10-22T05:42:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-i-ejb-31.html\"},\"wordCount\":448,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-i-ejb-31.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"keywords\":[\"EJB\",\"Java EE6\",\"Testing\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-i-ejb-31.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-i-ejb-31.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-i-ejb-31.html\",\"name\":\"Java EE 6 Testing Part I - EJB 3.1 Embeddable API - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-i-ejb-31.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-i-ejb-31.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"datePublished\":\"2012-06-07T10:00:00+00:00\",\"dateModified\":\"2012-10-22T05:42:22+00:00\",\"description\":\"One of the most common requests we hear from Enterprise JavaBeans developers is for improved unit\\\/integration testing support. EJB 3.1 Specification\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-i-ejb-31.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-i-ejb-31.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-i-ejb-31.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/java-ee-6-testing-part-i-ejb-31.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 I &#8211; EJB 3.1 Embeddable API\"}]},{\"@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 I - EJB 3.1 Embeddable API - Java Code Geeks","description":"One of the most common requests we hear from Enterprise JavaBeans developers is for improved unit\/integration testing support. EJB 3.1 Specification","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-i-ejb-31.html","og_locale":"en_US","og_type":"article","og_title":"Java EE 6 Testing Part I - EJB 3.1 Embeddable API - Java Code Geeks","og_description":"One of the most common requests we hear from Enterprise JavaBeans developers is for improved unit\/integration testing support. EJB 3.1 Specification","og_url":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.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:22+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.html"},"author":{"name":"Samuel Santos","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/cd56a59549f8c033272e083db1e9c216"},"headline":"Java EE 6 Testing Part I &#8211; EJB 3.1 Embeddable API","datePublished":"2012-06-07T10:00:00+00:00","dateModified":"2012-10-22T05:42:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.html"},"wordCount":448,"commentCount":1,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","keywords":["EJB","Java EE6","Testing"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.html","url":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.html","name":"Java EE 6 Testing Part I - EJB 3.1 Embeddable API - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","datePublished":"2012-06-07T10:00:00+00:00","dateModified":"2012-10-22T05:42:22+00:00","description":"One of the most common requests we hear from Enterprise JavaBeans developers is for improved unit\/integration testing support. EJB 3.1 Specification","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/java-ee-6-testing-part-i-ejb-31.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 I &#8211; EJB 3.1 Embeddable API"}]},{"@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\/1427","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=1427"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1427\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/148"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=1427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=1427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=1427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}