Hi Nuwan,

Yes that is there as well. Attaching the automation.xml.

Following gets printed on the console.

Jan 16, 2015 1:25:18 AM
org.wso2.carbon.integration.common.extensions.usermgt.UserPopulator
addTenantUsers
INFO: User - permissionUser created in tenant domain of  carbon.super

Regards,
Hemika

Hemika Kodikara
Software Engineer
WSO2 Inc.
lean . enterprise . middleware
http://wso2.com

Mobile : +94777688882

On Fri, Jan 16, 2015 at 6:53 AM, Nuwan Wimalasekara <nuw...@wso2.com> wrote:

> Hi
> Can you please check whether the user is created on the server. In order
> to create the user at the test execution time, you need to have the
> UserPopulateExtension  in automation.xml
>
> <platformExecutionManager>
> <extentionClasses>
> <class>
>
> <name>org.wso2.carbon.integration.common.extensions.usermgt.UserPopulateExtension</name>
> </class>
> </extentionClasses>
> </platformExecutionManager>
>
> Thanks,
> Nuwanw
>
> On Thu, Jan 15, 2015 at 11:41 AM, Hemika Kodikara <hem...@wso2.com> wrote:
>
>> Hi All,
>>
>> I am in the middle of writing a test case. I have a need to call a stub
>> through a user. But unable to login to LoginLogoutClient through a user.
>>
>> With Admin, I am able to call the stub as follows.
>>
>> AutomationContext automationContext = new AutomationContext("MB",
>> TestUserMode.SUPER_TENANT_ADMIN);
>> LoginLogoutClient loginLogoutClient = new
>> LoginLogoutClient(automationContext);
>> String loginSession = loginLogoutClient.login();
>> AndesAdminClient andesAdminClient = new AndesAdminClient(backendURL,
>> loginSession,
>> ConfigurationContextProvider.getInstance().getConfigurationContext());
>> String queueName = destination.replace("queue", StringUtils.EMPTY);
>> andesAdminClient.deleteQueue(queueName);
>>
>> But unable to connect through a user as follows.
>>
>> AutomationContext automationContext = new AutomationContext("MB",
>> "mb001", FrameworkConstants.SUPER_TENANT_KEY, "permissionUser");
>> LoginLogoutClient loginLogoutClient = new
>> LoginLogoutClient(automationContext);
>> String loginSession = loginLogoutClient.login();
>> AndesAdminClient andesAdminClient = new AndesAdminClient(backendURL,
>> loginSession,
>> ConfigurationContextProvider.getInstance().getConfigurationContext());
>> String queueName = destination.replace("queue", StringUtils.EMPTY);
>> andesAdminClient.deleteQueue(queueName);
>>
>>
>> Receiving the following error.
>>
>> performAllQueuePermissionCase(org.wso2.mb.integration.tests.amqp.functional.PermissionTreeTestCase)
>>  Time elapsed: 10.821 sec  <<< FAILURE!
>> org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException:
>> Login Unsuccessful. Return false as a login status by Server
>> at
>> org.wso2.carbon.integration.common.admin.client.AuthenticatorClient.login(AuthenticatorClient.java:61)
>> at
>> org.wso2.carbon.integration.common.utils.LoginLogoutClient.login(LoginLogoutClient.java:68)
>> at
>> org.wso2.mb.integration.tests.amqp.functional.PermissionTreeTestCase.performDelete(PermissionTreeTestCase.java:287)
>> at
>> org.wso2.mb.integration.tests.amqp.functional.PermissionTreeTestCase.performAllQueuePermissionCase(PermissionTreeTestCase.java:224)
>>
>>
>> Following are user information and platform information from
>> automation.xml
>>
>> <superTenant>
>>             <tenant domain="carbon.super" key="superTenant">
>>                 <admin>
>>                     <user key="superAdmin">
>>                         <userName>admin</userName>
>>                         <password>admin</password>
>>                     </user>
>>                 </admin>
>>                 <users>
>>                     <user key="user1">
>>                         <userName>testuser11</userName>
>>                         <password>testuser11</password>
>>                     </user>
>>                     <user key="user2">
>>                         <userName>testuser21</userName>
>>                         <password>testuser21</password>
>>                     </user>
>>                     <user key="permissionUser">
>>                         <userName>permissionUser</userName>
>>                         <password>permissionUser</password>
>>                     </user>
>>                 </users>
>>             </tenant>
>>         </superTenant>
>>
>>
>> <platform>
>>         <!--
>>         cluster instance details to be used to platform test execution
>>         -->
>>         <productGroup name="MB" clusteringEnabled="false" default="true">
>>
>>             <instance name="mb001" 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>
>>         </productGroup>
>>     </platform>
>>
>> Any help would be useful.
>>
>>
>> Regards,
>> Hemika
>>
>> Hemika Kodikara
>> Software Engineer
>> WSO2 Inc.
>> lean . enterprise . middleware
>> http://wso2.com
>>
>> Mobile : +94777688882
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Nuwan Wimalasekara
> Senior Software Engineer - Test Automation
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> phone: +94 71 668 4620
>
>
>
>
<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Copyright (c) 2005-2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~ WSO2 Inc. licenses this file to you under the Apache License,
  ~ Version 2.0 (the "License"); you may not use this file except
  ~ in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied. See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->
<automation xmlns="automationXMLSchema.xsd">
    <!--  =================================================  -->
    <!--                   Parameters                        -->
    <!--  =================================================  -->
    <configurations>
        <!--
         Change this to edit wait time for test artifact deployment
        -->
        <deploymentDelay>60000</deploymentDelay>
        <!--
         Change this to product|platform/cloud to execute test on specific environment
        -->
        <executionEnvironment>standalone</executionEnvironment>
        <!--
         Change this to true if you want to generate coverage statistics
        -->
        <coverage>true</coverage>
        <!--
         Change this to true if you want to enable framework dashboard
        -->
        <frameworkDashboard>false</frameworkDashboard>
        <!--
         Browser type with used by framework to execute UI test, supported types - chrome|firefox|opera|ie|htmlUnit
        -->
    </configurations>
    <tools>
        <selenium>
            <!-- Change to enable remote webDriver -->
            <!-- URL of remote webDriver server  -->
            <remoteDriverUrl enable="true">http://10.100.2.51:4444/wd/hub/</remoteDriverUrl>

            <!-- Type of the browser selenium tests are running" -->
            <browser>
                <browserType>firefox</browserType>
                <!-- path to webDriver executable - required only for chrome-->
                <webdriverPath enable="false">/home/test/name/webDriver</webdriverPath>
            </browser>
        </selenium>
    </tools>
    <!--
    Database configuration to be used for data service testing. DB configuration in dbs files will be replaced with
               below configuration at test run time
    -->
    <datasources>
        <datasource name="dataService">
            <url>jdbc:h2:testDB</url>
            <username>wso2carbon</username>
            <password>wso2carbon</password>
            <driverClassName>org.h2.Driver</driverClassName>
        </datasource>
        <datasource name="dataService1">
            <url>jdbc:h2:testDB</url>
            <username>wso2carbon</username>
            <password>wso2carbon</password>
            <driverClassName>org.h2.Driver</driverClassName>
        </datasource>
    </datasources>
    <security>
        <!--
                    KeyStore which will be used for encrypting/decrypting passwords
                    and other sensitive information.
        -->
        <keystore name="wso2">
            <!--  Keystore file location -->
            <fileName>keystores/products/wso2carbon.jks</fileName>
            <!--  Keystore type (JKS/PKCS12 etc.) -->
            <type>JKS</type>
            <!--  Keystore password -->
            <password>wso2carbon</password>
            <!--  Private Key alias -->
            <keyAlias>wso2carbon</keyAlias>
            <!--  Private Key password -->
            <keyPassword>wso2carbon</keyPassword>
        </keystore>
        <!--
                    System wide trust-store which is used to maintain the certificates of all
                    the trusted parties.
        -->
        <truststore name="wso2">
            <!--  trust-store file location  -->
            <fileName>client-truststore.jks</fileName>
            <!--  trust-store type (JKS/PKCS12 etc.)  -->
            <type>JKS</type>
            <!--  trust-store password  -->
            <password>wso2carbon</password>
        </truststore>
    </security>
    <featureManagement>
        <p2Repositories>
            <repository name="localDefault">
                <repository repo-id="online-repository">https://wso2.org/repo</repository>
                <repository repo-id="file-repository">file:///home/krishantha/test</repository>
            </repository>
        </p2Repositories>
    </featureManagement>
    <!--
               System wide users who to be registered at the test initiation
    -->
    <userManagement>
        <superTenant>
            <tenant domain="carbon.super" key="superTenant">
                <admin>
                    <user key="superAdmin">
                        <userName>admin</userName>
                        <password>admin</password>
                    </user>
                </admin>
                <users>
                    <user key="user1">
                        <userName>testuser11</userName>
                        <password>testuser11</password>
                    </user>
                    <user key="user2">
                        <userName>testuser21</userName>
                        <password>testuser21</password>
                    </user>
                    <user key="permissionUser">
                        <userName>permissionUser</userName>
                        <password>permissionUser</password>
                    </user>
                </users>
            </tenant>
        </superTenant>
        <tenants>
            <tenant domain="wso2.com" key="wso2">
                <admin>
                    <user key="admin">
                        <userName>admin</userName>
                        <password>admin</password>
                    </user>
                </admin>
                <users>
                    <user key="user1">
                        <userName>testuser11</userName>
                        <password>testuser11</password>
                    </user>
                    <user key="user2">
                        <userName>testuser21</userName>
                        <password>testuser21</password>
                    </user>
                </users>
            </tenant>
            <tenant domain="testtenant1.com" key="tenant1">
                <admin>
                    <user key="admin">
                        <userName>admin</userName>
                        <password>admin</password>
                    </user>
                </admin>
                <users>
                    <user key="tenant1user1">
                        <userName>tenant1user1</userName>
                        <password>tenant1user1</password>
                    </user>
                </users>
            </tenant>
            <tenant domain="testtenant2.com" key="tenant2">
                <admin>
                    <user key="admin">
                        <userName>admin</userName>
                        <password>admin</password>
                    </user>
                </admin>
                <users>
                    <user key="tenant2user1">
                        <userName>tenant2user1</userName>
                        <password>tenant2user1</password>
                    </user>
                </users>
            </tenant>
        </tenants>
    </userManagement>
    <!--
   This section will initiate the initial deployment of the platform required by
   the test suites.
-->
    <platform>
        <!--
        cluster instance details to be used to platform test execution
        -->
        <productGroup name="MB" clusteringEnabled="false" default="true">

            <instance name="mb001" 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>
        </productGroup>
    </platform>

    <listenerExtensions>

        <!--<className>org.wso2.carbon.automation.extentions.servers.wso2server.Wso2ServerExtention</className>-->
        <platformExecutionManager>
            <extentionClasses>
	<class>
		<name>org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerExtension</name>
		<!--<parameter name="-DportOffset" value="0" />-->
		<!--<parameter name="cmdArg" value="debug 5005" />-->
	</class>
	<class>
		<name>org.wso2.carbon.integration.common.extensions.usermgt.UserPopulateExtension</name>
		<!--<parameter name="-DportOffset" value="0" />-->
		<!--<parameter name="cmdArg" value="debug 5005" />-->
	</class>
            </extentionClasses>
        </platformExecutionManager>


        <PlatformSuiteManager>
            <extentionClasses>
                <!--<className>org.wso2.carbon.automation.extentions.servers.wso2server.Wso2ServerExtention</className>-->
            </extentionClasses>
        </PlatformSuiteManager>

        <PlatformAnnotationTransferManager>
            <extentionClasses>
                <!--<className>org.wso2.carbon.automation.extentions.servers.wso2server.Wso2ServerExtention</className>-->
            </extentionClasses>
        </PlatformAnnotationTransferManager>

        <PlatformTestManager>
            <extentionClasses>
            </extentionClasses>
        </PlatformTestManager>

        <PlatformReportManager>
            <extentionClasses>
            </extentionClasses>
        </PlatformReportManager>

    </listenerExtensions>
</automation>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to