[jboss-cvs] JBossAS SVN: r94003 - in projects/jboss-jca/trunk/doc/userguide/en: modules and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 24 15:14:24 EDT 2009


Author: jesper.pedersen
Date: 2009-09-24 15:14:24 -0400 (Thu, 24 Sep 2009)
New Revision: 94003

Added:
   projects/jboss-jca/trunk/doc/userguide/en/modules/embedded.xml
Modified:
   projects/jboss-jca/trunk/doc/userguide/en/master.xml
Log:
[JBJCA-166] First pass of the documentation

Modified: projects/jboss-jca/trunk/doc/userguide/en/master.xml
===================================================================
--- projects/jboss-jca/trunk/doc/userguide/en/master.xml	2009-09-24 19:03:43 UTC (rev 94002)
+++ projects/jboss-jca/trunk/doc/userguide/en/master.xml	2009-09-24 19:14:24 UTC (rev 94003)
@@ -8,6 +8,7 @@
         <!ENTITY configuration SYSTEM "modules/configuration.xml">
         <!ENTITY deployment SYSTEM "modules/deployment.xml">
         <!ENTITY running SYSTEM "modules/running.xml">
+        <!ENTITY embedded SYSTEM "modules/embedded.xml">
         <!ENTITY community SYSTEM "modules/community.xml">
         <!ENTITY troubleshooting SYSTEM "modules/troubleshooting.xml">
         ]>
@@ -35,6 +36,8 @@
 
    &running;
 
+   &embedded;
+
    &community;
 
    &troubleshooting;

Added: projects/jboss-jca/trunk/doc/userguide/en/modules/embedded.xml
===================================================================
--- projects/jboss-jca/trunk/doc/userguide/en/modules/embedded.xml	                        (rev 0)
+++ projects/jboss-jca/trunk/doc/userguide/en/modules/embedded.xml	2009-09-24 19:14:24 UTC (rev 94003)
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="embedded">
+   <title>Embedded</title>
+
+   <section id="embedded_overview">
+      <title>Overview</title>
+
+      <para>The JBoss JCA embedded configuration provides a way of running a JCA container
+        in-VM.</para>
+
+      <para>The configuration is useful when you want a</para>
+
+      <itemizedlist>
+        <listitem>
+          JCA container within your environment
+        </listitem>
+        <listitem>
+          JCA container when doing unit testing
+        </listitem>
+      </itemizedlist>
+
+      <para>Especially the ability to unit test your resource adapter archives before deploying them
+        into a testing or a production environment will benefit developers.</para>
+
+   </section>
+
+   <section id="embedded_deployment">
+      <title>Deployment</title>
+
+      <para>Current you will need all the JAR files located in the</para>
+
+      <programlisting>
+$JBOSS_JCA_HOME/lib
+      </programlisting>
+
+      <para>directory as well as sub-directories on your application class loader - f.ex.</para>
+
+      <programlisting>
+java -classpath allthejarfiles.jar yourapp
+      </programlisting>
+
+      <para>in order to use the embedded configuration.</para>
+
+   </section>
+
+   <section id="embedded_usage">
+      <title>Usage</title>
+
+      <para>The code sample below shows a simple usage of using the JBoss JCA embedded environment
+        in a JUnit 4 test case.</para>
+
+      <programlisting>
+import org.jboss.jca.embedded.EmbeddedJCA;
+
+import java.net.URL;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class MyTestCase
+{
+   /* Embedded */
+   private static EmbeddedJCA embedded;
+
+   /**
+    * Simple test to verify deployment of myresourceadapter.rar
+    * @throws Throwable throwable exception 
+    */
+   @Test
+   public void testDeployment() throws Throwable
+   {
+      URL archive = getURL("myresourceadapter.rar");
+ 
+      try
+      {
+         embedded.deploy(archive);
+      }
+      catch (Throwable t)
+      {
+         fail(t.getMessage());
+      }
+      finally
+      {
+         embedded.undeploy(archive);
+      }
+   }
+
+   @BeforeClass
+   public static void beforeClass() throws Throwable
+   {
+      // Create an embedded JCA instance
+      embedded = new EmbeddedJCA();
+
+      // Startup
+      embedded.startup();
+   }
+
+   @AfterClass
+   public static void afterClass() throws Throwable
+   {
+      // Shutdown
+      embedded.shutdown();
+   }
+}
+      </programlisting>
+
+   </section>
+
+
+</chapter>




More information about the jboss-cvs-commits mailing list