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?
>
> Why do you need to skipp the emma coverage instrumentation from the server
you are starting?

>
>    1. How can I initialize an AdminServiceClient to work on the new ESB
>    instance?
>
> You can initialize an  AdminServiceClient by providing the backend url of
the server you have started. But you have to consider the offset when you
build the backend url.

We have already implemented this improvement in the framework
4.3.2-SNAPSHOT and you can make a server with any customisations and start,
stop and start again at ant time easily with TestServerManager. Since you
are using framework 4.2.x you have to follow above code to do this.

Thanks,
Nuwanw

> Thanks.
>
> Sandamal Weerasinghe | Software Engineer | WSO2 Lanka (Pvt) Ltd
>
> Mobile - +94-77-144-9640
>


-- 
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

Reply via email to