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
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to