Hard Coded URL's in Tests

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Hard Coded URL's in Tests

Stuart Douglas
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.


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


_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Hard Coded URL's in Tests

Brian Stansberry
Thanks, Stuart.

This is a big, big improvement.

If you've written some tests that use a ModelControllerClient to do
setup and teardown, it's very likely they are hard coded to
localhost:9999. Please convert them ASAP to the approach Stuart has
created, as it is critical that we get any such hardcoding out of our
testsuite so we can do things like run the entire testsuite using IPv6
addresses.

On 2/23/12 11:18 PM, Stuart Douglas wrote:

> 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
>
>
>
> _______________________________________________
> jboss-as7-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev


--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev