Hi Saneth/Dharshana, Thanks for the support. As per the offline chat we had yesterday, I managed to start a server with CarbonTestServerManager with an offset and tenant idle time set. As suggested I hard coded the backend url and proceeded with the test logic.
On a side note, since AS 5.2.1 is using TAF 4.2.4, the approach with the automation.xml is not possible. It applies to TAF 4.3.x [1] [1] http://wso2.com/library/articles/2014/05/automation-of-custom-environments-with-wso2-test-automation-framework/ On Wed, Jan 28, 2015 at 5:49 PM, Saneth Dharmakeerthi <[email protected]> wrote: > HI Kalpa, > > If you using CarbonTestServerManager and start the server > with tenant.idle.time and with a port offset, it will start a new server. > asServer is the default AutomationContext used by the test cases. After > you start the second server with CarbonTestServerManager, With > asServer you can't get the second servers information. > > For that you have to create new AutomationContext. > > Ex: > AutomationContext newContext = new > AutomationContext("AS","appServerInstance0002", > TestUserMode.SUPER_TENANT_ADMIN); > then use newContext instead of asServer > > In automation.xml, you need to add new instance detail > > <platform> > <!-- > cluster instance details to be used to platform test execution > --> > <productGroup name="AS" clusteringEnabled="false" default="true"> > > <instance name="appServerInstance0001" type="standalone" > nonBlockingTransportEnabled="false"> > <hosts> > <host type="default">localhost</host> > </hosts> > <ports> > <port type="http">9763</port> > <port type="https">9443</port> > </ports> > <properties> > </properties> > </instance> > <instance name="appServerInstance0002" type="standalone" > nonBlockingTransportEnabled="false"> > <hosts> > <host type="default">localhost</host> > </hosts> > <ports> > <port type="http">9764</port> <!-- IF offset is 1 --> > <port type="https">9444</port> <!-- IF offset is 1--> > > </ports> > <properties> > </properties> > </instance> > </productGroup> > </platform> > > > > Thanks and Best Regards, > > Saneth Dharmakeerthi > Senior Software Engineer > WSO2, Inc. > Mobile: +94772325511 > > On Wed, Jan 28, 2015 at 11:15 AM, Kalpa Welivitigoda <[email protected]> > wrote: > >> Thanks Kasun and Saneth, I will try the suggestions and will update with >> the status. >> >> On Wed, Jan 28, 2015 at 7:55 AM, Saneth Dharmakeerthi <[email protected]> >> wrote: >> >>> Hi Kalpa, >>> >>> Updating the automation.xml with the idle time information should solve >>> your problem. values are in minutes. >>> >>> <listenerExtensions> >>> <platformExecutionManager> >>> <extentionClasses> >>> <class> >>> >>> <name>org.wso2.carbon.integration.common.extensions.carbonserver.CarbonServerExtension</name> >>> <parameter name="-Dwebapp.idle.time" value="1"/> >>> <parameter name="-Dtenant.idle.time" value="2"/> >>> >>> </class> >>> >>> >>> Thanks and Best Regards, >>> >>> Saneth Dharmakeerthi >>> Senior Software Engineer >>> WSO2, Inc. >>> Mobile: +94772325511 >>> >>> On Tue, Jan 27, 2015 at 6:32 PM, KasunG Gajasinghe <[email protected]> >>> wrote: >>> >>>> >>>> I'm not sure what the 'asServer' object represents, but I assume it's a >>>> bean object in the automation test code? May be the system property is set >>>> successfully in the server-side! You could write a simple webapp that >>>> return a list of system properties from the server to verify that. >>>> >>>> On Tue, Jan 27, 2015 at 6:24 PM, Kalpa Welivitigoda <[email protected]> >>>> wrote: >>>> >>>>> Hi, >>>>> >>>>> I am writing a test case for AS 5.2.1 when ghost deployment is enabled >>>>> to test the following, >>>>> >>>>> 1. webapp deployment from CApps >>>>> 2. for a tenant, when it is idle, the first request for a >>>>> webapp/axis2service being successful >>>>> >>>>> AKAIK the default tenant idle time is 15 minutes and cannot be >>>>> configured other than from a system property as of now. >>>>> >>>>> Based on the offline chat I had with Krishantha, I >>>>> tried CarbonTestServerManager (sample usage [1]) and was successful in >>>>> starting an AS server setting the tenant.idle.time and with a port offset. >>>>> However when I checked asServer (which holds the back end url, session >>>>> cookies etc.) environment variable, it doesn't contain the values of the >>>>> server started with CarbonTestServerManager. Is there a way to get those >>>>> variables for the server started with CarbonTestServerManager? >>>>> >>>>> A work around would be, without starting the server >>>>> with CarbonTestServerManager, simply deploy the CApp in a tenant, do a >>>>> graceful restart so that the tenant is idle when the server is up. Is >>>>> there >>>>> a better way to achieve the task? >>>>> >>>>> [1] >>>>> 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 >>>>> >>>>> >>>>> -- >>>>> Best Regards, >>>>> >>>>> Kalpa Welivitigoda >>>>> Software Engineer, WSO2 Inc. http://wso2.com >>>>> Email: [email protected] >>>>> Mobile: +94776509215 >>>>> >>>>> _______________________________________________ >>>>> Dev mailing list >>>>> [email protected] >>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>> >>>>> >>>> >>>> >>>> -- >>>> >>>> *Kasun Gajasinghe*Senior Software Engineer, WSO2 Inc. >>>> email: kasung AT spamfree wso2.com >>>> linked-in: http://lk.linkedin.com/in/gajasinghe >>>> blog: http://kasunbg.org >>>> >>>> >>>> >>>> _______________________________________________ >>>> Dev mailing list >>>> [email protected] >>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>> >>>> >>> >> >> >> -- >> Best Regards, >> >> Kalpa Welivitigoda >> Software Engineer, WSO2 Inc. http://wso2.com >> Email: [email protected] >> Mobile: +94776509215 >> > > -- Best Regards, Kalpa Welivitigoda Software Engineer, WSO2 Inc. http://wso2.com Email: [email protected] Mobile: +94776509215
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
