|
From: Vance K. <va...@us...> - 2007-02-12 02:13:16
|
User: vancek
Date: 07/02/11 18:13:17
Modified: andromda-ejb3/src/site/fml faq.fml
andromda-ejb3/src/site changes.xml
andromda-ejb3/src/site/axdoc howto22.xml
Log:
add docs for message driven test cases
Revision Changes Path
1.6 +15 -0 cartridges/andromda-ejb3/src/site/fml/faq.fml
Index: faq.fml
===================================================================
RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/site/fml/faq.fml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- faq.fml 5 Feb 2007 13:14:51 -0000 1.5
+++ faq.fml 12 Feb 2007 02:13:16 -0000 1.6
@@ -108,5 +108,20 @@
</p>
</answer>
</faq>
+ <faq id="NoSuchMethodError_KernelAbstractionFactory_setKernel_with_Tests">
+ <question>Why am I getting "java.lang.RuntimeException: java.lang.NoSuchMethodError: org.jboss.ejb3.KernelAbstractionFactory.setKernel(Lorg/jboss/kernel/Kernel;)V" when running the test!</question>
+ <answer>
+ <p>
+ This is a classpath issue. The JBoss libs/artifacts that are setup as dependencies in the project
+ contain different versions of the org.jboss.ejb3.KernelAbstractionFactory class.
+ </p>
+ <p>
+ You should be able to safely comment out or remove the <b>jboss-ejb3-client</b> dependency from your
+ dependencies list. This library's version of KernelAbstractionFactory does not contain the
+ <i>kernel</i> attribute. This allows this class to be seen/loaded from the <b>jboss-ejb3-all</b>
+ library.
+ </p>
+ </answer>
+ </faq>
</part>
</faqs>
1.9 +4 -0 cartridges/andromda-ejb3/src/site/changes.xml
Index: changes.xml
===================================================================
RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/site/changes.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -r1.8 -r1.9
--- changes.xml 11 Feb 2007 14:06:37 -0000 1.8
+++ changes.xml 12 Feb 2007 02:13:16 -0000 1.9
@@ -373,6 +373,10 @@
<action dev="vancek" type="add">
Add support for MDB testing within embedded EJB3 container. Further customised test templates.
</action>
+ <action dev="vancek" type="add">
+ Resource libs jms-ra.rar and jcainflow.rar are copied to src/test/resources folder of the core project
+ for testing of message driven test cases.
+ </action>
</release>
</body>
</document>
\ No newline at end of file
1.3 +44 -0 cartridges/andromda-ejb3/src/site/axdoc/howto22.xml
Index: howto22.xml
===================================================================
RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/site/axdoc/howto22.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- howto22.xml 5 Feb 2007 00:40:30 -0000 1.2
+++ howto22.xml 12 Feb 2007 02:13:16 -0000 1.3
@@ -73,6 +73,7 @@
<li class="impl"><a class="changed" href="howto/org/andromda/test/roles.properties"><code>roles.properties</code></a></li>
<li class="impl"><a class="changed" href="howto/org/andromda/test/users.properties"><code>users.properties</code></a></li>
<li class="impl"><a class="changed" href="howto/org/andromda/test/testng.xml"><code>testng.xml</code></a></li>
+ <li class="impl"><a class="changed" href="howto/org/andromda/test/testjms.xml"><code>testjms.xml</code></a></li>
</ul>
</p>
<p>
@@ -172,6 +173,49 @@
project or running the tests.
</p>
</subsection>
+ <a name="Message_Driven_Bean_Tests"/>
+ <subsection name="Message Driven Tests">
+ <p>
+ If you have one or more message driven beans, you must make sure the
+ <code>EJB3Container.java</code> contains the following section
+ in the <i>startup</i> method:
+<source><![CDATA[
+ logger.info("==>Deploying jboss-jms-beans - init JBoss MQ core services");
+ EJB3StandaloneBootstrap.deployXmlResource("jboss-jms-beans.xml");
+ logger.info("==>Deployed jboss-jms-beans");
+
+ logger.info("==>Configure test queue and topic");
+ EJB3StandaloneBootstrap.deployXmlResource("testjms.xml");
+ logger.info("==>Configured test queues and topics");
+]]></source>
+ </p>
+ <p>
+ The cartridge will generate one test class with one test case per message driven bean to
+ the <code>core/src/test/java</code> source folder in the corresponding package.
+ The the test source files will NOT be
+ over-written, so if you wish, you can add further cases.
+ </p>
+ <p>
+ Take a look at your <code>testng.xml</code> in <code>core/src/test/resources</code>.
+ Apart from the other session test classes, you also have a message driven test class
+ reference. This is how message driven tests are triggered.
+ </p>
+ <p>
+ Finally, take a look at <code>testjms.xml</code>. This file contains the necessary
+ configuration to create the queue/topics within the embedded container before the
+ MDB's are deployed and tests are run. This file will be automatically re-generated on
+ every run, so when you add another MDB, this file will be updated to reflect the
+ addition of another queue or topic.
+ </p>
+ <p class="highlight">
+ For your message driven test framework to work, you need to make sure the <code>jms-ra.rar</code>
+ and <code>jcainflow.rar</code> RAR files exist in your project <code>src/test/resources</code>
+ folder. These are from JBoss Embeddable Microcontainer <code>lib</code>. When you run
+ your model generation phase, these libs will be automatically copied to your resources
+ folder. We are forced to do this until Eclipse (perhaps other IDE's don't have this issue) can
+ include .rar files in the project classpath.
+ </p>
+ </subsection>
</section>
</body>
</document>
|