Thanks Malintha.

After adding the extension to automation.xml users are getting added
properly and test case executed successfully.
However we still need the modification done by me to the LoginLogoutClient.
It looks to me a bug in the framework.
Could you please verify the fix done by me and apply it ?

Thanks.



On Sun, Jul 27, 2014 at 7:58 PM, Malintha Adikari <malin...@wso2.com> wrote:

> Hi Isuru,
>
> We are using  pluggable extensions in test automation framework to allow
> user to plug additional extensions to the test execution flow.  We have
> already  provided user management ( user population) as a pluggable
> extension. We have to register those extensions in automation.xml under
> *listenerExtensions* section in order to use those pluggable modules.
>
> In your issue , seems you haven't  register that user populator extension
> in your automation.xml file. You can register user management extension in
> automation.xml as follows
>
> <listenerExtensions>
>
>     <platformExecutionManager>
>
>          <extentionClasses>
>
>                 <className>org.wso2.carbon.integration.common.extensions.
> usermgt.UserPopulateExtension</className>
>
>                ....................................................
>
>             </extentionClasses>
>
>
>         </platformExecutionManager>
>
> After registering this pluggable module , test framework will populate all
> the tenant users which you have mentioned in the automation.xml under
> userManagement section and  you can use those tenant users for your tests.
>
> Ex: TestUserMode.TENANT_ADMIN represents the admin user of the first
> tenant of the tenant list we have populated. So y
> .
>
>
> On Sun, Jul 27, 2014 at 12:40 PM, Isuru Udana <isu...@wso2.com> wrote:
>
>> Hi Automation Team,
>>
>> I am trying to write a automation test for ESB in tenant mode.
>> As per offline information I got from NuwanW, we only have to use the
>> following
>>
>> init(TestUserMode.TENANT_ADMIN);
>>
>
> If we have populated the tenants correctly, we can prepare the test
> environment for tenant user as above and proceed with our test without any
> further change.
>
>>
>> instead of
>>
>> init();
>>
>> to run the test case in tenant mode.
>>
>> When I try that approach I saw that artifacts are getting deployed to the
>> super tenant even if we initialize the tenant mode. Reason for that is
>> Login method always logs into super tenant to deploy artifacts. So I did
>> the following change in the LoginLogoutClient.
>>
>>
>>      public String login() throws LoginAuthenticationExceptionException,
>> IOException, XMLStreamException,
>>              URISyntaxException, SAXException, XPathExpressionException {
>> -        String userName;
>> -        userName =
>> automationContext.getContextTenant().getContextUser().getUserName();
>> +
>> +        // Get the tenant
>> +        Tenant tenant = automationContext.getContextTenant();
>> +
>> +        String userName =
>> +
>>  
>> tenant.getContextUser().getUserName().concat("@").concat(tenant.getDomain());
>> +
>>          return loginClient.login(userName,
>> automationContext.getContextTenant().getContextUser().getPassword()
>>                  ,
>> automationContext.getInstance().getHosts().get("default"));
>>      }
>>
>> After making that modification now I am getting the following error.
>>
>> "Invalid domain or unactivated tenant login"
>>
>> Then I tried to manually log into the management console using the tenant
>> admin credentials defined in the automation.xml and it wasn't successful.
>>
>> What am I missing here ?
>>
>> Or else is this way of running tests in tenant mode is not tested and
>> still under development ?
>>
>> Thanks.
>>
>>
>>
>>
>> --
>> *Isuru Udana*
>> Senior
>> * Software Engineer*
>> WSO2 Inc.; http://wso2.com
>> email: isu...@wso2.com cell: +94 77 3791887
>> blog: http://mytecheye.blogspot.com/
>> twitter: http://twitter.com/isudana
>>
>
>
> Regards,
> Malintha Adikari
>
>
> --
> *Malintha Adikari*
>  Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> Mobile: +94 71 2312958
> Blog:    http://malinthas.blogspot.com
> Page:   http://about.me/malintha
>



-- 
*Isuru Udana*
Senior
* Software Engineer*
WSO2 Inc.; http://wso2.com
email: isu...@wso2.com cell: +94 77 3791887
blog: http://mytecheye.blogspot.com/
twitter: http://twitter.com/isudana
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to