If you are running junit tests I recommend using the code from the jboss
testsuite, mostly in JBossTestServices.

If you want to deploy and leave it there, I've written a jmx task for ant
that you can use to call any mbean method, in particular
MainDeployer.deploy.  I asked for advice on where to put it and haven't
gotten any feedback.  I guess I'll put it in 3.1 in with jason's console
module unless I hear any different.

david jencks

On 2002.06.18 17:53:35 -0400 Jim Crossley wrote:
> Hi jboss-users.
> 
> As cool as "putting a file in a directory to deploy it" is, it doesn't
> work
> well for unit testing.  I find it very convenient to have a "test" target
> in
> my build file like so:
> 
> <target name="test" depends="deploy">...
> 
> But that doesn't work well when the deploy target merely copies a jar
> file
> to a jboss-watched directory.  Because it takes a few seconds for jboss
> to
> actually deploy the file, the test target commences before the file has
> been
> deployed.
> 
> With jboss 2.4, I solved this problem using the very cool
> org.jboss.jmx.client.Deployer (shown below).  This guaranteed that my
> deployed file was actually deployed by the time the test target ran,
> because
> the class' main method didn't return until the app was successfully
> deployed.  It made my build/test/debug cycle a breeze!
> 
> But alas, the magical class has disappeared in jboss 3.0.  :-(
> 
> It seems to have been renamed org.jboss.jmx.service.Deployer and it
> doesn't
> seem to be included in the binary distribution.  I think it's now part of
> the testsuite.
> 
> I really think the new Template Project would benefit from a "synchronous
> deploy target".  It sure makes testing easier.  Can we include a Deployer
> class in the distro?  Or am I missing a more obvious JMX-ish way of
> accomplishing the same thing?
> 
> Here's what I do in 2.4:
> 
> <property name="deploy.args" value="file:////${dist.home}/ejb-test.jar"/>
> <target name="deploy" depends="jar">
>   <java classname="org.jboss.jmx.service.Deployer">
>     <classpath>
>       <fileset dir="${jboss.lib}" includes="*.jar"/>
>     </classpath>
>     <arg line="${deploy.args}"/>
>     <sysproperty key="java.naming.factory.initial"
> value="org.jnp.interfaces.NamingContextFactory"/>
>     <sysproperty key="java.naming.provider.url"    
> value="localhost:1099"/>
>     <sysproperty key="java.naming.factory.url.pkgs"
> value="org.jboss.naming:org.jnp.interfaces"/>
>   </java>
> </target>
> <target name="undeploy">
>   <antcall target="deploy">
>     <param name="deploy.args" value="-undeploy ${deploy.args}"/>
>   </antcall>
> </target>
> 
> 
> 
> ----------------------------------------------------------------------------
>                    Bringing you mounds of caffeinated joy
>                    >>>     http://thinkgeek.com/sf    <<<
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 
> 

----------------------------------------------------------------------------
                   Bringing you mounds of caffeinated joy
                   >>>     http://thinkgeek.com/sf    <<<

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to