Hi Nalin Problem is that another test class deploy a StockQuoteProxy and it failed to undeploy proxy service properly. after test is executed. to solve the issue, first find all the test classes which use proxy service named StockQuoteProxy. then check AfterClass method for any possibility to avoid service undeployment. may be undeployment is not called or may be it skipped due to failure at above step.
Thanks, Nuwanw On Mon, Sep 2, 2013 at 11:18 PM, Nalin Chandraratne <[email protected]> wrote: > Hi, > > When the passThroughProxy integration tests were run, 2 tests got skipped > at the "BeforeClass" level. Following is the error. > > FAILED CONFIGURATION: @BeforeClass setEnvironment > org.wso2.carbon.proxyadmin.stub.ProxyServiceAdminProxyAdminException: > ProxyServiceAdminProxyAdminException > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) > at java.lang.reflect.Constructor.newInstance(Constructor.java:513) > at java.lang.Class.newInstance0(Class.java:357) > at java.lang.Class.newInstance(Class.java:310) > at > org.wso2.carbon.proxyadmin.stub.ProxyServiceAdminStub.addProxy(ProxyServiceAdminStub.java:1297) > at > org.wso2.carbon.automation.api.clients.proxy.admin.ProxyServiceAdminClient.addProxyService(ProxyServiceAdminClient.java:145) > ............................ > > When the esb log is observed, following exception was found before > skipping the tests. > > TID: [0] [ESB] [2013-09-02 22:20:54,334] INFO > {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} - > '[email protected] [-1234]' logged in at [2013-09-02 > 22:20:54,334+0530] > {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} > TID: [0] [ESB] [2013-09-02 22:20:54,990] ERROR > {org.wso2.carbon.proxyadmin.service.ProxyServiceAdmin} - A service named > StockQuoteProxy already exists > {org.wso2.carbon.proxyadmin.service.ProxyServiceAdmin} > org.wso2.carbon.proxyadmin.ProxyAdminException: A service named > StockQuoteProxy already exists > at > org.wso2.carbon.proxyadmin.service.ProxyServiceAdmin.handleException(ProxyServiceAdmin.java:978) > at > org.wso2.carbon.proxyadmin.service.ProxyServiceAdmin.addProxyService(ProxyServiceAdmin.java:233) > at > org.wso2.carbon.proxyadmin.service.ProxyServiceAdmin.addProxy(ProxyServiceAdmin.java:685) > ............................... > > When I try to debug the skipping test case (by putting a debug pointer > inside @BeforeClass setEnvironment() method ), the test cases executed > fine. I observed that the esb configuration to be submitted by the test > class had a proxy service "StockQuoteProxy" and the esb running at that > time already had a proxy service by that name. However the whole > configuration got changed successfully in debugging mode. > > At the same time when the test cases were run individually with the > following testng.xml configuration, they got passed successfully. > > <test name="ProxyService-Test" preserve-order="true" verbose="2"> > <classes> > <class > name="org.wso2.carbon.esb.proxyservice.test.passThroughProxy.EditPassThroughProxyServiceTestCase"/> > <class > name="org.wso2.carbon.esb.proxyservice.test.passThroughProxy.ProxyServiceEnablingHTTPSTestCase"/> > <class > name="org.wso2.carbon.esb.proxyservice.test.passThroughProxy.ProxyServiceEndPointThroughURLTestCase"/> > <class > name="org.wso2.carbon.esb.proxyservice.test.passThroughProxy.ProxyServiceEnablingHTTPTestCase"/> > <class > name="org.wso2.carbon.esb.proxyservice.test.passThroughProxy.WSDLOptionsPickedFromRegistryTestCase"/> > <class > name="org.wso2.carbon.esb.proxyservice.test.passThroughProxy.WSDLOptionsSpecifiedSourceUrlTestCase"/> > <class > name="org.wso2.carbon.esb.proxyservice.test.passThroughProxy.ProxyServiceWithCustomServiceURITestCase"/> > <class > name="org.wso2.carbon.esb.proxyservice.test.passThroughProxy.PassThroughProxyServiceTestCase"/> > <class > name="org.wso2.carbon.esb.proxyservice.test.passThroughProxy.WSDLOptionsSpecifiedInlineTestCase"/> > <class > name="org.wso2.carbon.esb.proxyservice.test.passThroughProxy.PickEndPointFromRegistryTestCase"/> > </classes> > </test> > > > > What would be the reason for skipping test cases when the testng.xml is > like below ? > > > <test name="ProxyService-Test" preserve-order="true" verbose="2"> > <packages> > <package > name="org.wso2.carbon.esb.proxyservice.test.passThroughProxy"/> > </packages> > </test> > > > surefire reports in both scenarios are attached below. > > > > > -- > Nalin Chamara > Software Engineer > [email protected] > +94715614756 > -- Nuwan Wimalasekara Senior Software Engineer - Test Automation WSO2, Inc.: http://wso2.com lean. enterprise. middleware phone: +94 71 668 4620
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
