[jboss-dev-forums] [Design of POJO Server] - Re: Testing Bootstrap Dependencies
istudens@redhat.com
do-not-reply at jboss.com
Thu Sep 25 11:24:11 EDT 2008
There is a short look at my current implementation.
I have not followed Adrian's advice yet, because I don't know how to implement his idea. I can't even start JBoss server with empty deploy/ directory. Therefore I don't have any clue, how to at first start the AS with empty deploy directory and then deploy an ear and after that all services from all/deploy.
I have not even followed Brian's advice, because after trying methods from org.jboss.test.deployers.AbstractDeploymentTest I have found out that they test a structure of deployment only and hence they pass even if the deployment of the tested SAR fails.
Now my test creates a different profile for each tested module. The snippet of build.xml:
<!-- JBAS-5349 -->
| <target name="bootstrap-dependency-tests" description="Tests bootstrap deployment dependency in new JBossMC.">
| <!-- EJB3 Session Bean -->
| <create-bootstrapdependency-config baseconf="all" conf="bootstrapdependencyJBAS5349-EJB3Session">
| <module-patternset>
| <include name="bootstrapdependency-ejb3-sessionbean.jar"/>
| </module-patternset>
| </create-bootstrapdependency-config>
| <server:start name="bootstrapdependencyJBAS5349-EJB3Session"/>
| <run-junit junit.patternset="bootstrap-dependency.includes"
| junit.configuration="EJB3Session" />
| <server:stop name="bootstrapdependencyJBAS5349-EJB3Session"/>
| <!-- EJB3 Entity Bean -->
| <create-bootstrapdependency-config baseconf="all" conf="bootstrapdependencyJBAS5349-EJB3Entity">
| <module-patternset>
| <include name="bootstrapdependency-ejb3-entitybean.jar"/>
| </module-patternset>
| </create-bootstrapdependency-config>
| <server:start name="bootstrapdependencyJBAS5349-EJB3Entity"/>
| <run-junit junit.patternset="bootstrap-dependency.includes"
| junit.configuration="EJB3Entity" />
| <server:stop name="bootstrapdependencyJBAS5349-EJB3Entity"/>
| ...
The macro 'create-bootstrapdependency-config' is defined in the imports/server-config.xml:
<macrodef name="create-bootstrapdependency-config"
| description="Create a configuration based on 'all' profile">
| <attribute name="conf" />
| <attribute name="baseconf" />
| <element name="module-patternset" />
| <sequential>
| <server:config>
| <server name="@{conf}" host="${node0}">
| <jvmarg value="-Xms128m" />
| <jvmarg value="-Xmx512m" />
| <jvmarg value="-XX:MaxPermSize=512m" />
| <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
| <sysproperty key="java.net.preferIPv4Stack" value="true" />
| <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
| <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
| </server>
| </server:config>
| <delete dir="${jboss.dist}/server/@{conf}" />
| <create-config baseconf="@{baseconf}" newconf="@{conf}" newconf-src="bootstrap-dependency">
| <patternset>
| <include name="conf/**" />
| <include name="deployers/**" />
| <include name="deploy/**" />
| <include name="lib/**" />
| </patternset>
| </create-config>
| <copy todir="${jboss.dist}/server/@{conf}/deploy/Aaabootstrapdependency-jbas5349.sar"
| filtering="false">
| <fileset dir="${build.lib}">
| <patternset>
| <module-patternset />
| </patternset>
| </fileset>
| </copy>
| </sequential>
| </macrodef>
I have probably discovered a bug in the 'run-junit' macro in the file import/server-config.xml. There is an argument 'junit.configuration' which sets a 'report.ext' property. This argument should differentiate the outputs of repeatedly runing test. I am not sure if anyone has ever used this, because it does not work. The 'run-junit' macro uses the 'report.ext' property to remember an extension of test name, but in ant any property cannot be changed after it was once set. It means that if you run this macro twice with different junit.configuration arguments, you will get the same report.ext property value and it will be the value of the first one. So I have rewritten this macro to use a property ${report.ext.@{junit.configuration}} instead of ${report.ext} and simplified the syntax of condition to:
<!-- Set the report extension based on the -->
| <condition property="report.ext.@{junit.configuration}" value=".xml" else="-@{junit.configuration}.xml">
| <equals arg1="" arg2="@{junit.configuration}" />
| </condition>
I hope that checking of a status of the SAR's MBean is reliable manner method how to test the result of deployment. I consider it to be the best way how to do it.. the best one I know :)
Should I commit the new test to the https://svn.jboss.org/repos/jbossas/trunk/testsuite/? Should I report the issue of run-junit's bug?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4178855#4178855
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4178855
More information about the jboss-dev-forums
mailing list