[jboss-as7-dev] Hard Coded URL's in Tests

Stuart Douglas stuart.w.douglas at gmail.com
Fri Feb 24 00:18:23 EST 2012


I have noticed that at the moment we don't have a solution for how to deal with server changes that need to happen before the deployment (e.g. adding a security domain).

At the moment this is hacked up by having the @Deployment method connect with a hard coded URL, and performing any setup it needs to do.

I have come up with a solution to this: https://github.com/jbossas/jboss-as/commit/5bbdbb1f7428300982aeafc8e73864e817246ac7

If you need to do any setup in your test class you simply annotate it @ServerSetup(MySetupClass.class) (where MySetupClass implements ServerSetupTask).

You can then do any server setup/cleanup necessary in your MySetupClass using the ManagementClient that is passed to the method.

At the moment the implementation is quite simple (only one action per test, superclasses are not examined etc) but if more functionality is required it should be fairly easy to implement.

Stuart

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-as7-dev/attachments/20120224/54a5e07c/attachment.html 


More information about the jboss-as7-dev mailing list