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, Anjana Fernando <anj...@wso2.com> wrote: > 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 >> 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 >>> 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 to be just called once, as you do with >>> the server startup. Maybe a method like "hasServerStarted()" in the >>> class "ServerUtils" can be put to check whether the server has already >>> started and that can be used inside the >>> CarbonIntegrationTestCase#setUp() to check whether other actions needs >>> to be done (i.e. setUpCarbonHome, copyArtifacts etc..). >>> >>> Cheers, >>> Anjana. >>> >>> On Tue, Mar 22, 2011 at 9:33 PM, Afkham Azeez <az...@wso2.com> wrote: >>>> 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. >>>> If >>>> there is a bug in that setup method, we will have to change many places >>>> since the code has been copied several times over. Instead, I have >>>> introduced a copyArtifacts method to CarbonIntegrationTestCase which you >>>> can >>>> override, and there you can have the logic which copies the artifacts. >>>> Please change your code to use that method. >>>> >>>> -- >>>> Afkham Azeez >>>> Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com, >>>> >>>> Member; Apache Software Foundation; http://www.apache.org/ >>>> email: az...@wso2.com cell: +94 77 3320919 >>>> blog: http://blog.afkham.org >>>> twitter: http://twitter.com/afkham_azeez >>>> linked-in: http://lk.linkedin.com/in/afkhamazeez >>>> >>>> Lean . Enterprise . Middleware >>>> >>>> _______________________________________________ >>>> Carbon-dev mailing list >>>> Carbon-dev@wso2.org >>>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev >>>> >>>> >>> >>> >>> >>> -- >>> Anjana Fernando >>> Software Engineer >>> WSO2, Inc.; http://wso2.com >>> lean.enterprise.middleware >> > > > > -- > Anjana Fernando > Software Engineer > WSO2, Inc.; http://wso2.com > lean.enterprise.middleware > -- Anjana Fernando Software Engineer WSO2, Inc.; http://wso2.com lean.enterprise.middleware _______________________________________________ Carbon-dev mailing list Carbon-dev@wso2.org http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev