Hi Sandamal,

This happens because there are inconsistencies between coverage.ec and .em
files created during the instrumentation.

Could you try to exclude
[org.wso2.carbon.core.services.util.CarbonAuthenticationUtil]
from filter.txt file and see.

Anyway ESB does not want this class instrumented for coverage.

Thank You,
Dharshana.


On Thu, Dec 18, 2014 at 11:43 AM, Sandamal Weerasinghe <[email protected]>
wrote:
>
> The reason why I wanted to disable emma test coverage is because it throws
> the following error. But I can leave that as it is. I will use the above
> solution for (2) to access the adminServiceClients.
>
> Thanks.
>
> com.vladium.emma.EMMARuntimeException: [CLASS_STAMP_MISMATCH] runtime
> version of class
> [org.wso2.carbon.core.services.util.CarbonAuthenticationUtil] in the
> coverage data is not consistent with the version of this class in the
> metadata, possibly because stale metadata is being used for report
> generation.
> at com.vladium.emma.report.ReportDataModel.getView(ReportDataModel.java:95)
> at
> com.vladium.emma.report.AbstractReportGenerator.initialize(AbstractReportGenerator.java:210)
> at
> com.vladium.emma.report.html.ReportGenerator.process(ReportGenerator.java:85)
> at com.vladium.emma.report.ReportProcessor._run(ReportProcessor.java:255)
> at com.vladium.emma.Processor.run(Processor.java:88)
> at com.vladium.emma.report.reportCommand.run(reportCommand.java:139)
> at
> org.wso2.carbon.automation.core.utils.coreutils.CodeCoverageUtils.generateReports(CodeCoverageUtils.java:310)
> at
> org.wso2.carbon.automation.core.utils.serverutils.ServerUtils.shutdown(ServerUtils.java:214)
> at
> org.wso2.carbon.automation.core.TestServerManager.stopServer(TestServerManager.java:113)
> at
> org.wso2.carbon.automation.core.tests.utils.CarbonTestServerManager.stopServer(CarbonTestServerManager.java:46)
> at
> org.wso2.carbon.esb.security.basic.ESBJAVA3424TestCase.init(ESBJAVA3424TestCase.java:90)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
> at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525)
> at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202)
> at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:130)
> at
> org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:173)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
> at org.testng.TestRunner.runWorkers(TestRunner.java:1178)
> at org.testng.TestRunner.privateRun(TestRunner.java:757)
> at org.testng.TestRunner.run(TestRunner.java:608)
> at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
> at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
> at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
> at org.testng.SuiteRunner.run(SuiteRunner.java:240)
> at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
> at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
> at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158)
> at org.testng.TestNG.runSuitesLocally(TestNG.java:1083)
> at org.testng.TestNG.run(TestNG.java:999)
> at
> org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:178)
> at
> org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
> at
> org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:96)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
> at
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
> at
> org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
> at
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
> [2014-12-18 11:39:44,149]  INFO
> {org.wso2.carbon.automation.core.utils.coreutils.CodeCoverageUtils} -  Emma
> report generation completed
>
>
> Sandamal Weerasinghe | Software Engineer | WSO2 Lanka (Pvt) Ltd
>
> Mobile - +94-77-144-9640
>
> On Wed, Dec 17, 2014 at 11:07 PM, Nuwan Wimalasekara <[email protected]>
> wrote:
>>
>>
>>
>> On Wed, Dec 17, 2014 at 10:56 PM, Krishantha Samaraweera <
>> [email protected]> wrote:
>>>
>>> Hi Sandamal,
>>>
>>> On Wed, Dec 17, 2014 at 7:07 PM, Sandamal Weerasinghe <[email protected]
>>> > wrote:
>>>>
>>>> Hi all,
>>>>
>>>> In a test case that I'm working on, I need to copy several files to
>>>> CARBON_HOME.
>>>>
>>>> axis2.xml
>>>> carbon.xml
>>>> cipher-text.properties
>>>> master-datasources.xml
>>>> password-tmp
>>>> secret-conf.properties
>>>> wso2carbon.jks
>>>> wso2server.sh - has -Dkey.password=true environment variable
>>>>
>>>> After copying these files I need to shut down the ESB instance and
>>>> start it again. (gracefully restarting won't work because of the
>>>> wso2server.sh).
>>>>
>>>> I tried the following to start a new ESB instance on a different port
>>>>
>>>> Map<String, String> startupParameterMap = new HashMap<String, String>();
>>>> startupParameterMap.put("-DportOffset", "10");
>>>> CarbonTestServerManager carbonTestServerManager = new
>>>> CarbonTestServerManager(System.getProperty("carbon.zip"),
>>>> startupParameterMap);
>>>>
>>>> carbonHome = carbonTestServerManager.startServer();
>>>> carbonTestServerManager.stopServer();
>>>>
>>>> //copy files..
>>>>
>>>> ServerUtils serverUtils = new ServerUtils();
>>>> serverUtils.startServerUsingCarbonHome(carbonHome,
>>>> FrameworkFactory.getFrameworkProperties("ESB"), startupParameterMap);
>>>>
>>>> This part is working fine. But now I'm facing the following problems,
>>>>
>>>>    1. When the server is shutting down, it tries to generate an emma
>>>>    coverage report, is there a way to skip that?
>>>>
>>>> You can disable coverage generation by setting coverage.enable property
>>> value to false in automation.properties file.
>>>
>> if we disable the coverage by setting the coverage.enable value, It will
>> disable coverage from whole test module. if so  we can not collect the
>> coverage statistics.
>>
>>>
>>>>    1. How can I initialize an AdminServiceClient to work on the new
>>>>    ESB instance?
>>>>
>>>> Older test framework doesn't support for multiple configurations. So
>>> you need to hard code backend URL bases on your port off set value. And use
>>> LoginLogoutClient to get session cookie.
>>>
>>> In latest test framework release - TAF 4.3.1, you can specify multiple
>>> instance configurations in automation.xml file, and retrieve values though
>>> AutomationContext.
>>>
>>> Thanks,
>>> Krishantha.
>>>
>>>
>>>> Thanks.
>>>>
>>>> Sandamal Weerasinghe | Software Engineer | WSO2 Lanka (Pvt) Ltd
>>>>
>>>> Mobile - +94-77-144-9640
>>>>
>>>
>>>
>>> --
>>> Krishantha Samaraweera
>>> Senior Technical Lead - Test Automation
>>> Mobile: +94 77 7759918
>>> WSO2, Inc.; http://wso2.com/
>>> lean . enterprise . middlewear.
>>>
>>
>>
>> --
>> Nuwan Wimalasekara
>> Senior Software Engineer - Test Automation
>> WSO2, Inc.: http://wso2.com
>> lean. enterprise. middleware
>>
>> phone: +94 71 668 4620
>>
>>
>>
>>

-- 

Dharshana Warusavitharana
Senior Software Engineer , Test Automation
WSO2 Inc. http://wso2.com
email : [email protected] <[email protected]>
Tel  : +94 11 214 5345
Fax :+94 11 2145300
cell : +94770342233
blog : http://dharshanaw.blogspot.com

lean . enterprise . middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to