This happens when the resources used for a test is not cleared
properly after the test. Those clearance  should be called under AfterClass
or After Test annotated methods. Then Those methods will call even if the
test is failed or passed.  Then there are no effects of other test classes.
Some test methods have all the steps inside it. Once it gets failed, It may
affect other test too.  If we do that properly we can use the same
resources in many test cases. if not we have to use different names for
artifact we use.

Thanks,
Nuwanw


On Wed, Aug 7, 2013 at 5:44 PM, Vijitha Kumara <viji...@wso2.com> wrote:

> Hi All,
>
> Apparently there's some serious ordering/execution issue when the bunch of
> tests run with the framework.
>
> For example if you run a single class LCStateIdNameTestCase all test
> passes but fails when running only with the package
> (org.wso2.carbon.registry.lifecycle.test in this case). Failure below with
> the reason for the same. This fails as the logs indicate a different LC is
> attached to the service while executing the method.
>
> So how this is possible? There can be multiple reasons but one can be the
> use of same service/metadata in multiple test cases and another test case
> attaches a different LC to the same service referred by the current test
> case.
>
> One way this can be avoided (at least for the most part) is re-factor the
> test cases to avoid these multiple test methods with @Test (to add
> service/LC etc...) in that the main test case in focus do the necessary
>  method calls directly (to setup required services etc...) and do the
> asserts (This can be done some restructuring of the current tests) itself.
>
> Is there any other way this interference can be avoided within the
> framework?
>
>
>
>
> [2013-08-07 16:33:49,811]  INFO
> {org.wso2.carbon.automation.core.PlatformTestManager} -  On test success..
> [2013-08-07 16:33:49,812]  INFO
> {org.wso2.carbon.automation.core.PlatformTestManager} -  Running the test
> method ---
> org.wso2.carbon.registry.lifecycle.test.LCStateIdNameTestCase.testAddLcToService
> ----
> +++++++++++++++++++ LC PR:
> +++++++++++++++++++++++++/trunk/services/com/abb/IntergalacticService, *
> StateIdNameLC*
> ++++++++++++++++++ LC PROP: +++++++++++++++registry.lifecycle.*
> TransitionApprovalLC*.state
> ++++++++++++++++++ LC PROP:
> +++++++++++++++registry.custom_lifecycle.checklist.option.1.item
> ++++++++++++++++++ LC PROP:
> +++++++++++++++registry.custom_lifecycle.checklist.option.1.item.permission
> ++++++++++++++++++ LC PROP:
> +++++++++++++++registry.custom_lifecycle.checklist.option.2.item
> ++++++++++++++++++ LC PROP:
> +++++++++++++++registry.custom_lifecycle.checklist.option.0.item.permission
> ++++++++++++++++++ LC PROP:
> +++++++++++++++registry.custom_lifecycle.checklist.option.2.item.permission
> ++++++++++++++++++ LC PROP:
> +++++++++++++++registry.custom_lifecycle.checklist.option.0.item
> [2013-08-07 16:33:50,082] ERROR
> {org.wso2.carbon.automation.core.PlatformTestManager} -  On Test failure..
> [2013-08-07 16:33:50,083] ERROR
> {org.wso2.carbon.automation.core.PlatformTestManager} -  
> *java.lang.AssertionError:
> LifeCycle not added to service expected [true] but found [false]*
>
>
>
>
> Regards,
> Vijitha.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> Vijitha Kumara
> Senior Software Engineer; WSO2, Inc.;  http://wso2.com/
> email: viji...@wso2.com
>
>
> Lean . Enterprise . Middleware
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Nuwan Wimalasekara
Senior Software Engineer - Test Automation
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

phone: +94 71 668 4620
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to