Re: [Carbon-dev] Important: Copying test artifacts before starting the server

2011-03-29 Thread Isuru Suriarachchi
This copyArtifacts method will be called only once. So all the artifacts should be copied from one single place in the test suite. Extending this method in individual test classes is useless. But in Carbon core integration, I can see two different individual test classes which extends this method.

[Carbon-dev] Important: Copying test artifacts before starting the server

2011-03-22 Thread Afkham Azeez
I noticed that some product teams have overridden the setup method of the CarbonIntegrationTestCase, copied and pasted the existing method, and added a bit of code to copy some artifacts before the server is started. This is not the proper way of achieving reusability and violates OO principles.

Re: [Carbon-dev] Important: Copying test artifacts before starting the server

2011-03-22 Thread Anjana Fernando
Hi Azeez, By looking at how copyArtifacts() method is invoked at CarbonIntegrationTestCase#setUp(), it seems it will always call that method when a new test class is run. This will cause unexpected problems, since all the services will be redeployed while the tests are run. So ideally this need

Re: [Carbon-dev] Important: Copying test artifacts before starting the server

2011-03-22 Thread Senaka Fernando
Hi Azeez, Anjana, +1 for this. And, Anjana, IMO, that's only if the test class implements it right? We also need a similar callback after the server has stopped, in order to do the required clean-up. Thanks, Senaka. On Tue, Mar 22, 2011 at 11:22 PM, Anjana Fernando anj...@wso2.com wrote: Hi

Re: [Carbon-dev] Important: Copying test artifacts before starting the server

2011-03-22 Thread Anjana Fernando
Hi Senaka, On Tue, Mar 22, 2011 at 11:35 PM, Senaka Fernando sen...@wso2.com wrote: Hi Azeez, Anjana, +1 for this. And, Anjana, IMO, that's only if the test class implements it right? Yeah I was actually thinking of a pattern like this. We've our own class which extends the TestTemplate

Re: [Carbon-dev] Important: Copying test artifacts before starting the server

2011-03-22 Thread Senaka Fernando
On Tue, Mar 22, 2011 at 11:50 PM, Anjana Fernando anj...@wso2.com wrote: Hi Senaka, On Tue, Mar 22, 2011 at 11:35 PM, Senaka Fernando sen...@wso2.com wrote: Hi Azeez, Anjana, +1 for this. And, Anjana, IMO, that's only if the test class implements it right? Yeah I was actually

Re: [Carbon-dev] Important: Copying test artifacts before starting the server

2011-03-22 Thread Afkham Azeez
No, if the server is running this method won't get called. Anyway you could create a test suite, add all test cases to it and then run the suite. On Mar 22, 2011 11:22 PM, Anjana Fernando anj...@wso2.com wrote: Hi Azeez, By looking at how copyArtifacts() method is invoked at

Re: [Carbon-dev] Important: Copying test artifacts before starting the server

2011-03-22 Thread Senaka Fernando
Hi Azeez, We still need a solution for the restart-scenario. Currently there is no way of shutting down the running server, cleaning up resources and restarting. How are we going to address this? Thanks, Senaka. On Wed, Mar 23, 2011 at 6:25 AM, Afkham Azeez az...@wso2.com wrote: No, if the

Re: [Carbon-dev] Important: Copying test artifacts before starting the server

2011-03-22 Thread Anjana Fernando
Hi Azeez, Yeah, I see, I just saw the usage of carbonHome variable to check if the server has started. Sorry for the confusion. Cheers, Anjana. On Wed, Mar 23, 2011 at 6:25 AM, Afkham Azeez az...@wso2.com wrote: No, if the server is running this method won't get called. Anyway you could

Re: [Carbon-dev] Important: Copying test artifacts before starting the server

2011-03-22 Thread Anjana Fernando
Hi, A small detail, the carbonHome variable becomes null for test class instances other than the first one. Since it is put as an instance variable, I guess it is meant to be used by a test class, and it will find it to be null unexpectedly. Cheers, Anjana. On Wed, Mar 23, 2011 at 10:24 AM,