[Dev] Enabling ghost mode in test environment
Hi, I need to write a test case to get the first request to a deployed web app after the web app went to ghost mode or unloaded. how should i enable ghost mode, web app idle time in test environment? Thank you. -- Shashika Prabath Karunatilaka, Software Engineer, WSO2, Inc: http://wso2.com/ mobile : +94 77 7487792 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Enabling ghost mode in test environment
Hi Shashika, Small correction on CarbonTestServerManager and MultipleServersManager. As it shows in the code block and reference links in [2] and [3] in my previous mail, you have to create a instance of CarbonTestServerManager with your required parameters and using MultipleServersManager you can start the server. Thanks and Best Regards, Saneth Dharmakeerthi Senior Software Engineer WSO2, Inc. Mobile: +94772325511 On Tue, Mar 24, 2015 at 11:17 PM, Saneth Dharmakeerthi sane...@wso2.com wrote: Hi Shashika, - Only way to enable the Ghost mode in test environment is to changing the repository/conf/carbon.xml. You have to copy the edited carbon.xml at @BeforeClass method and restore the carbon.xml at @AfterClasss method. You can do this task by using applyConfiguration methods in org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager.java. For sample usage of ServerConfigurationManager [1]. - *Do not edit the **wso2server.sh* and configure the webapp and tenant unloading time. For this you have to start a new server with a port offset and pass those parameters. You can use one of following ways. - Using CarbonTestServerManager.java. Usage and more details can be found in [2] mail thread and [3] - Using MultipleServersManager.java private HashMapString, String serverPropertyMap = new HashMapString, String(); private MultipleServersManager manager = new MultipleServersManager(); @BeforeClass(alwaysRun = true) public void init() throws Exception { // to start the server from a different port offset *int portOffset = 1;* *int idleTime = 1;* *serverPropertyMap.put(-DportOffset, Integer.toString(portOffset));* *serverPropertyMap.put(-Dtenant.idle.time, Integer.toString(idleTime));* AutomationContext autoCtx = new AutomationContext(); CarbonTestServerManager server = new CarbonTestServerManager(autoCtx, System.getProperty(carbon.zip), serverPropertyMap); manager.startServers(server); UserPopulator userPopulator = new UserPopulator(AS, appServerInstance0002); userPopulator.populateUsers(); } same as -*Dtenant.idle.time *u can add the *-Dwebapp.idle.time* [1] https://github.com/wso2/product-apim/blob/master/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIManagerConfigurationChangeTest.java [2][Dev] How to set tenant idle time in writing integration test for AS 5.2.1 [3 https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/products/esb/4.7.0/modules/integration/tests/src/test/java/org/wso2/carbon/esb/test/servers/NewInstanceTestCase.java] Thanks and Best Regards, Saneth Dharmakeerthi Senior Software Engineer WSO2, Inc. Mobile: +94772325511 On Tue, Mar 24, 2015 at 10:14 PM, Shashika Karunatilaka shashi...@wso2.com wrote: Hi Mahesh, AFAIK we cant enable ghost mode in test environment by editing carbon.xml. On Tue, Mar 24, 2015 at 10:02 PM, Mahesh Chinthaka mahe...@wso2.com wrote: Hi Shashika, You can enable Ghost mode deployment from setting the value 'true' in repository/conf/carbon.xml GhostDeployment Enabled*true*/Enabled PartialUpdatefalse/PartialUpdate /GhostDeployment And to set the webapp unloading time u can do following, open wso2server.sh in vim editor ( sudo vi wso2server.sh) Add following line in the bottom section ( inside do while ) -Dwebapp.idle.time=1 \ Thanks On Tue, Mar 24, 2015 at 7:44 PM, Shashika Karunatilaka shashi...@wso2.com wrote: Hi, I need to write a test case to get the first request to a deployed web app after the web app went to ghost mode or unloaded. how should i enable ghost mode, web app idle time in test environment? Thank you. -- Shashika Prabath Karunatilaka, Software Engineer, WSO2, Inc: http://wso2.com/ mobile : +94 77 7487792 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- *Mahesh Chinthaka Vidanagama* | Software Engineer WSO2, Inc | lean. enterprise. middleware. #20, Palm Grove, Colombo 03, Sri Lanka Mobile: +94 71 63 63 083 | Work: +94 112 145 345 Email: mahe...@wso2.com | Web: www.wso2.com -- Shashika Prabath Karunatilaka, Software Engineer, WSO2, Inc: http://wso2.com/ mobile : +94 77 7487792 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Enabling ghost mode in test environment
Hi Saneth, Thanks for the info, i will try with the steps you mentioned On Wed, Mar 25, 2015 at 7:52 AM, Saneth Dharmakeerthi sane...@wso2.com wrote: Hi Shashika, Small correction on CarbonTestServerManager and MultipleServersManager. As it shows in the code block and reference links in [2] and [3] in my previous mail, you have to create a instance of CarbonTestServerManager with your required parameters and using MultipleServersManager you can start the server. Thanks and Best Regards, Saneth Dharmakeerthi Senior Software Engineer WSO2, Inc. Mobile: +94772325511 On Tue, Mar 24, 2015 at 11:17 PM, Saneth Dharmakeerthi sane...@wso2.com wrote: Hi Shashika, - Only way to enable the Ghost mode in test environment is to changing the repository/conf/carbon.xml. You have to copy the edited carbon.xml at @BeforeClass method and restore the carbon.xml at @AfterClasss method. You can do this task by using applyConfiguration methods in org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager.java. For sample usage of ServerConfigurationManager [1]. - *Do not edit the **wso2server.sh* and configure the webapp and tenant unloading time. For this you have to start a new server with a port offset and pass those parameters. You can use one of following ways. - Using CarbonTestServerManager.java. Usage and more details can be found in [2] mail thread and [3] - Using MultipleServersManager.java private HashMapString, String serverPropertyMap = new HashMapString, String(); private MultipleServersManager manager = new MultipleServersManager(); @BeforeClass(alwaysRun = true) public void init() throws Exception { // to start the server from a different port offset *int portOffset = 1;* *int idleTime = 1;* *serverPropertyMap.put(-DportOffset, Integer.toString(portOffset));* *serverPropertyMap.put(-Dtenant.idle.time, Integer.toString(idleTime));* AutomationContext autoCtx = new AutomationContext(); CarbonTestServerManager server = new CarbonTestServerManager(autoCtx, System.getProperty(carbon.zip), serverPropertyMap); manager.startServers(server); UserPopulator userPopulator = new UserPopulator(AS, appServerInstance0002); userPopulator.populateUsers(); } same as -*Dtenant.idle.time *u can add the *-Dwebapp.idle.time* [1] https://github.com/wso2/product-apim/blob/master/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIManagerConfigurationChangeTest.java [2][Dev] How to set tenant idle time in writing integration test for AS 5.2.1 [3 https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/products/esb/4.7.0/modules/integration/tests/src/test/java/org/wso2/carbon/esb/test/servers/NewInstanceTestCase.java] Thanks and Best Regards, Saneth Dharmakeerthi Senior Software Engineer WSO2, Inc. Mobile: +94772325511 On Tue, Mar 24, 2015 at 10:14 PM, Shashika Karunatilaka shashi...@wso2.com wrote: Hi Mahesh, AFAIK we cant enable ghost mode in test environment by editing carbon.xml. On Tue, Mar 24, 2015 at 10:02 PM, Mahesh Chinthaka mahe...@wso2.com wrote: Hi Shashika, You can enable Ghost mode deployment from setting the value 'true' in repository/conf/carbon.xml GhostDeployment Enabled*true*/Enabled PartialUpdatefalse/PartialUpdate /GhostDeployment And to set the webapp unloading time u can do following, open wso2server.sh in vim editor ( sudo vi wso2server.sh) Add following line in the bottom section ( inside do while ) -Dwebapp.idle.time=1 \ Thanks On Tue, Mar 24, 2015 at 7:44 PM, Shashika Karunatilaka shashi...@wso2.com wrote: Hi, I need to write a test case to get the first request to a deployed web app after the web app went to ghost mode or unloaded. how should i enable ghost mode, web app idle time in test environment? Thank you. -- Shashika Prabath Karunatilaka, Software Engineer, WSO2, Inc: http://wso2.com/ mobile : +94 77 7487792 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- *Mahesh Chinthaka Vidanagama* | Software Engineer WSO2, Inc | lean. enterprise. middleware. #20, Palm Grove, Colombo 03, Sri Lanka Mobile: +94 71 63 63 083 | Work: +94 112 145 345 Email: mahe...@wso2.com | Web: www.wso2.com -- Shashika Prabath Karunatilaka, Software Engineer, WSO2, Inc: http://wso2.com/ mobile : +94 77 7487792 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Shashika Prabath Karunatilaka, Software Engineer, WSO2, Inc: http://wso2.com/ mobile : +94 77 7487792 ___ Dev
Re: [Dev] Enabling ghost mode in test environment
Hi Shashika, - Only way to enable the Ghost mode in test environment is to changing the repository/conf/carbon.xml. You have to copy the edited carbon.xml at @BeforeClass method and restore the carbon.xml at @AfterClasss method. You can do this task by using applyConfiguration methods in org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager.java. For sample usage of ServerConfigurationManager [1]. - *Do not edit the **wso2server.sh* and configure the webapp and tenant unloading time. For this you have to start a new server with a port offset and pass those parameters. You can use one of following ways. - Using CarbonTestServerManager.java. Usage and more details can be found in [2] mail thread and [3] - Using MultipleServersManager.java private HashMapString, String serverPropertyMap = new HashMapString, String(); private MultipleServersManager manager = new MultipleServersManager(); @BeforeClass(alwaysRun = true) public void init() throws Exception { // to start the server from a different port offset *int portOffset = 1;* *int idleTime = 1;* *serverPropertyMap.put(-DportOffset, Integer.toString(portOffset));* *serverPropertyMap.put(-Dtenant.idle.time, Integer.toString(idleTime));* AutomationContext autoCtx = new AutomationContext(); CarbonTestServerManager server = new CarbonTestServerManager(autoCtx, System.getProperty(carbon.zip), serverPropertyMap); manager.startServers(server); UserPopulator userPopulator = new UserPopulator(AS, appServerInstance0002); userPopulator.populateUsers(); } same as -*Dtenant.idle.time *u can add the *-Dwebapp.idle.time* [1] https://github.com/wso2/product-apim/blob/master/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIManagerConfigurationChangeTest.java [2][Dev] How to set tenant idle time in writing integration test for AS 5.2. 1 [3 https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/products/esb/4.7.0/modules/integration/tests/src/test/java/org/wso2/carbon/esb/test/servers/NewInstanceTestCase.java] Thanks and Best Regards, Saneth Dharmakeerthi Senior Software Engineer WSO2, Inc. Mobile: +94772325511 On Tue, Mar 24, 2015 at 10:14 PM, Shashika Karunatilaka shashi...@wso2.com wrote: Hi Mahesh, AFAIK we cant enable ghost mode in test environment by editing carbon.xml. On Tue, Mar 24, 2015 at 10:02 PM, Mahesh Chinthaka mahe...@wso2.com wrote: Hi Shashika, You can enable Ghost mode deployment from setting the value 'true' in repository/conf/carbon.xml GhostDeployment Enabled*true*/Enabled PartialUpdatefalse/PartialUpdate /GhostDeployment And to set the webapp unloading time u can do following, open wso2server.sh in vim editor ( sudo vi wso2server.sh) Add following line in the bottom section ( inside do while ) -Dwebapp.idle.time=1 \ Thanks On Tue, Mar 24, 2015 at 7:44 PM, Shashika Karunatilaka shashi...@wso2.com wrote: Hi, I need to write a test case to get the first request to a deployed web app after the web app went to ghost mode or unloaded. how should i enable ghost mode, web app idle time in test environment? Thank you. -- Shashika Prabath Karunatilaka, Software Engineer, WSO2, Inc: http://wso2.com/ mobile : +94 77 7487792 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- *Mahesh Chinthaka Vidanagama* | Software Engineer WSO2, Inc | lean. enterprise. middleware. #20, Palm Grove, Colombo 03, Sri Lanka Mobile: +94 71 63 63 083 | Work: +94 112 145 345 Email: mahe...@wso2.com | Web: www.wso2.com -- Shashika Prabath Karunatilaka, Software Engineer, WSO2, Inc: http://wso2.com/ mobile : +94 77 7487792 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Enabling ghost mode in test environment
Hi Shashika, You can enable Ghost mode deployment from setting the value 'true' in repository/conf/carbon.xml GhostDeployment Enabled*true*/Enabled PartialUpdatefalse/PartialUpdate /GhostDeployment And to set the webapp unloading time u can do following, open wso2server.sh in vim editor ( sudo vi wso2server.sh) Add following line in the bottom section ( inside do while ) -Dwebapp.idle.time=1 \ Thanks On Tue, Mar 24, 2015 at 7:44 PM, Shashika Karunatilaka shashi...@wso2.com wrote: Hi, I need to write a test case to get the first request to a deployed web app after the web app went to ghost mode or unloaded. how should i enable ghost mode, web app idle time in test environment? Thank you. -- Shashika Prabath Karunatilaka, Software Engineer, WSO2, Inc: http://wso2.com/ mobile : +94 77 7487792 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- *Mahesh Chinthaka Vidanagama* | Software Engineer WSO2, Inc | lean. enterprise. middleware. #20, Palm Grove, Colombo 03, Sri Lanka Mobile: +94 71 63 63 083 | Work: +94 112 145 345 Email: mahe...@wso2.com | Web: www.wso2.com ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Enabling ghost mode in test environment
Hi Mahesh, AFAIK we cant enable ghost mode in test environment by editing carbon.xml. On Tue, Mar 24, 2015 at 10:02 PM, Mahesh Chinthaka mahe...@wso2.com wrote: Hi Shashika, You can enable Ghost mode deployment from setting the value 'true' in repository/conf/carbon.xml GhostDeployment Enabled*true*/Enabled PartialUpdatefalse/PartialUpdate /GhostDeployment And to set the webapp unloading time u can do following, open wso2server.sh in vim editor ( sudo vi wso2server.sh) Add following line in the bottom section ( inside do while ) -Dwebapp.idle.time=1 \ Thanks On Tue, Mar 24, 2015 at 7:44 PM, Shashika Karunatilaka shashi...@wso2.com wrote: Hi, I need to write a test case to get the first request to a deployed web app after the web app went to ghost mode or unloaded. how should i enable ghost mode, web app idle time in test environment? Thank you. -- Shashika Prabath Karunatilaka, Software Engineer, WSO2, Inc: http://wso2.com/ mobile : +94 77 7487792 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- *Mahesh Chinthaka Vidanagama* | Software Engineer WSO2, Inc | lean. enterprise. middleware. #20, Palm Grove, Colombo 03, Sri Lanka Mobile: +94 71 63 63 083 | Work: +94 112 145 345 Email: mahe...@wso2.com | Web: www.wso2.com -- Shashika Prabath Karunatilaka, Software Engineer, WSO2, Inc: http://wso2.com/ mobile : +94 77 7487792 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev