Hi Darshana,

You can do this by referring following sample code segment. This will
restart the server after copying out particular resources to lib directory.

        private ServerConfigurationManager serverConfigurationManager;
        init();
        serverConfigurationManager=new ServerConfigurationManager(context);
        serverConfigurationManager.copyToComponentLib
                (new File(getClass().getResource(JAR_LOCATION +
File.separator + CLASS_JAR_THREE_PROPERTIES).toURI()));
        serverConfigurationManager.restartGracefully();


Thank you,
Dharshana.



On Tue, Oct 14, 2014 at 8:27 AM, Darshana Akalanka Pagoda Arachchi <
[email protected]> wrote:

> want sent before the completion :)
>
> continue....
>
> I can change the configs and restart the server as follows,
>
>         ServerConfigurationManager serverManager = new
> ServerConfigurationManager(automationContext);
>
>         serverManager.applyConfiguration(new
> File(FrameworkPathUtil.getSystemResourceLocation() + File.separator
>                         + "artifacts" + File.separator + "mb" +
> File.separator + "config" + File.separator + "advanced"
>                         + File.separator +
> "andes-virtualhosts-H2-mem.xml"),
>                 new File(ServerConfigurationManager.getCarbonHome() +
> File.separator + "repository" + File.separator
>                         + "conf" + File.separator + "advanced" +
> File.separator + "andes-virtualhosts.xml"), true, true);
>
> But this doesn't seem to restart the server which was started by the test
> automation.
>
> Any ideas how I can achieve this.
>
>
> Thanks in advance,
>
> On Tue, Oct 14, 2014 at 8:24 AM, Darshana Akalanka Pagoda Arachchi <
> [email protected]> wrote:
>
>> Hi devs,
>>
>> I want to restart the WSO2 server which was started in the beginning of
>> the Integration Test Run phase. I want to do this because I want to run all
>> the tests cases again for different configurations.
>>
>> I was able to get all the tests run again with by creating a new test
>> suit xml with same test cases. However, I am not able to get the server
>> restarted with different configurations.
>>
>>
>>         serverManager1.applyConfiguration(new
>> File(FrameworkPathUtil.getSystemResourceLocation() + File.separator
>>                         + "artifacts" + File.separator + "mb" +
>> File.separator + "config" + File.separator + "advanced"
>>                         + File.separator +
>> "andes-virtualhosts-H2-mem.xml"),
>>                 new File(ServerConfigurationManager.getCarbonHome() +
>> File.separator + "repository" + File.separator
>>                         + "conf" + File.separator + "advanced" +
>> File.separator + "andes-virtualhosts.xml"), true, true);
>>
>>
>>
>> --
>> *Darshana Akalanka Pagoda Arachchi,*
>> *Software Engineer*
>> *078-4721791 <078-4721791>*
>>
>
>
>
> --
> *Darshana Akalanka Pagoda Arachchi,*
> *Software Engineer*
> *078-4721791 <078-4721791>*
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

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