org.wso2.carbon.authenticator.stub.LogoutAuthenticationExceptionException Java Examples

The following examples show how to use org.wso2.carbon.authenticator.stub.LogoutAuthenticationExceptionException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PerMessageAcknowledgementsTestCase.java    From product-ei with Apache License 2.0 6 votes vote down vote up
/**
 * This method will restore all the configurations back. Following configurations will be restored. 1.
 * AndesAckWaitTimeOut system property. 2. Delete all destination created in the test case. 3. Restore default
 * broker.xml and restart server.
 *
 * @throws IOException
 * @throws AutomationUtilException
 * @throws AndesAdminServiceBrokerManagerAdminException
 * @throws LogoutAuthenticationExceptionException
 */
@AfterClass()
public void tearDown() throws IOException, AutomationUtilException, AndesAdminServiceBrokerManagerAdminException,
        LogoutAuthenticationExceptionException {
    if (StringUtils.isBlank(defaultAndesAckWaitTimeOut)) {
        System.clearProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY);
    } else {
        System.setProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY, defaultAndesAckWaitTimeOut);
    }

    LoginLogoutClient loginLogoutClientForAdmin = new LoginLogoutClient(super.automationContext);
    String sessionCookie = loginLogoutClientForAdmin.login();
    AndesAdminClient andesAdminClient = new AndesAdminClient(super.backendURL, sessionCookie);

    andesAdminClient.deleteQueue("firstMessageInvalidOnlyPerAckQueue");
    andesAdminClient.deleteQueue("allUnacknowledgePerAckQueue");
    andesAdminClient.deleteQueue("oneByOneUnacknowledgePerAckQueue");
    andesAdminClient.deleteQueue("firstFewUnacknowledgePerAckQueue");
    andesAdminClient.deleteQueue("unacknowledgeMiddleMessagePerAckQueue");
    andesAdminClient.deleteQueue("oneByOneUnacknowledgeQueuePerAckMultiple");
    andesAdminClient.deleteQueue("allAcknowledgeMultiplePerAckQueue");
    loginLogoutClientForAdmin.logout();

    //Revert back to original configuration.
    super.serverManager.restoreToLastConfiguration(true);
}
 
Example #2
Source File: QueueUserAuthorizationTestCase.java    From product-ei with Apache License 2.0 6 votes vote down vote up
/**
 * Assigning consuming publishing permissions of a queue to a role.
 *
 * @param queueName   The queue name
 * @param permissions New permissions for the role. can be publish, consume.
 * @throws XPathExpressionException
 * @throws IOException
 * @throws URISyntaxException
 * @throws SAXException
 * @throws XMLStreamException
 * @throws LoginAuthenticationExceptionException
 * @throws AndesAdminServiceBrokerManagerAdminException
 * @throws LogoutAuthenticationExceptionException
 * @throws UserAdminUserAdminException
 */
public void updateQueueRoleConsumePublishPermission(String queueName,
                                                    QueueRolePermission permissions)
        throws XPathExpressionException, IOException, URISyntaxException, SAXException,
        XMLStreamException, LoginAuthenticationExceptionException,
        AndesAdminServiceBrokerManagerAdminException,
        LogoutAuthenticationExceptionException,
        UserAdminUserAdminException, AutomationUtilException {

    LoginLogoutClient loginLogoutClientForAdmin = new LoginLogoutClient(super.automationContext);
    String sessionCookie = loginLogoutClientForAdmin.login();
    AndesAdminClient andesAdminClient =
            new AndesAdminClient(super.backendURL, sessionCookie);
    andesAdminClient.updatePermissionForQueue(queueName, permissions);
    loginLogoutClientForAdmin.logout();
}
 
Example #3
Source File: QueueUserAuthorizationTestCase.java    From product-ei with Apache License 2.0 6 votes vote down vote up
/**
 * Deleting the queues that were created.
 *
 * @throws IOException
 * @throws XPathExpressionException
 * @throws LogoutAuthenticationExceptionException
 * @throws URISyntaxException
 * @throws SAXException
 * @throws XMLStreamException
 * @throws LoginAuthenticationExceptionException
 * @throws AndesAdminServiceBrokerManagerAdminException
 */
@AfterClass()
public void cleanUpQueues()
        throws IOException, XPathExpressionException,
        LogoutAuthenticationExceptionException, URISyntaxException, SAXException,
        XMLStreamException, LoginAuthenticationExceptionException,
        AndesAdminServiceBrokerManagerAdminException, AutomationUtilException {
    LoginLogoutClient loginLogoutClientForAdmin = new LoginLogoutClient(super.automationContext);
    String sessionCookie = loginLogoutClientForAdmin.login();
    AndesAdminClient andesAdminClient =
            new AndesAdminClient(super.backendURL, sessionCookie);

    andesAdminClient.deleteQueue("authQueue1");
    andesAdminClient.deleteQueue("authQueue2");
    andesAdminClient.deleteQueue("authQueue3");
    andesAdminClient.deleteQueue("authQueue4");
    andesAdminClient.deleteQueue("authQueue5");
    andesAdminClient.deleteQueue("authQueue6");
    andesAdminClient.deleteQueue("authQueue7");
    andesAdminClient.deleteQueue("authQueue8");
    andesAdminClient.deleteQueue("authQueue9");

    loginLogoutClientForAdmin.logout();
}
 
Example #4
Source File: QueueUserAuthorizationTestCase.java    From product-ei with Apache License 2.0 6 votes vote down vote up
/**
 * User1 is in Role1 where there are create queue permissions.
 * User3 is in Role2 where there are no create queue permissions.
 * Admin creates a queue and then publishes and consumes messages.
 * Admin assigns publishing and consuming permissions to Role2.
 * User1 tries to publish and consume messages. User1 fails.
 *
 * @throws IOException
 * @throws XPathExpressionException
 * @throws AndesAdminServiceBrokerManagerAdminException
 * @throws URISyntaxException
 * @throws SAXException
 * @throws XMLStreamException
 * @throws UserAdminUserAdminException
 * @throws LoginAuthenticationExceptionException
 * @throws LogoutAuthenticationExceptionException
 * @throws JMSException
 * @throws AndesClientConfigurationException
 * @throws AndesClientException
 * @throws NamingException
 */
@Test(groups = {"wso2.mb", "queue"}, expectedExceptions = JMSException.class, expectedExceptionsMessageRegExp = ".*Permission denied.*")
public void performQueuePermissionDifferentRolesNoPermissions()
        throws IOException, XPathExpressionException,
        AndesAdminServiceBrokerManagerAdminException, URISyntaxException, SAXException,
        XMLStreamException, UserAdminUserAdminException,
        LoginAuthenticationExceptionException, LogoutAuthenticationExceptionException,
        JMSException, AndesClientConfigurationException, AndesClientException,
        NamingException, AutomationUtilException {
    // "superAdmin" refers to the admin
    this.createPublishAndSubscribeFromUser("superAdmin", "authQueue9");

    // Adding publish subscribe permissions of 'authQueue9' to 'pub_sub_queue_role' role.
    QueueRolePermission queueRolePermission = new QueueRolePermission();
    queueRolePermission.setRoleName(PUB_SUB_QUEUE_ROLE);
    queueRolePermission.setAllowedToConsume(true);
    queueRolePermission.setAllowedToPublish(true);
    this.updateQueueRoleConsumePublishPermission("authQueue9", queueRolePermission);
    log.info("Consumer and publish permissions updated for " + PUB_SUB_QUEUE_ROLE);

    this.createPublishAndSubscribeFromUser("authUser1", "authQueue9");
}
 
Example #5
Source File: QueueUserAuthorizationTestCase.java    From product-ei with Apache License 2.0 6 votes vote down vote up
/**
 * User3 is in Role2 where there are no create queue permissions.
 * Admin creates a queue and then publishes and consumes messages.
 * Admin assigns publishing and consuming permissions to Role2.
 * User3 tries to publish and consume messages. User3 succeeds.
 *
 * @throws IOException
 * @throws XPathExpressionException
 * @throws AndesAdminServiceBrokerManagerAdminException
 * @throws URISyntaxException
 * @throws SAXException
 * @throws XMLStreamException
 * @throws UserAdminUserAdminException
 * @throws LoginAuthenticationExceptionException
 * @throws LogoutAuthenticationExceptionException
 * @throws JMSException
 * @throws AndesClientConfigurationException
 * @throws AndesClientException
 * @throws NamingException
 */
@Test(groups = {"wso2.mb", "queue"})
public void performQueuePermissionDifferentRolesAssignedPermissions()
        throws IOException, XPathExpressionException,
        AndesAdminServiceBrokerManagerAdminException, URISyntaxException, SAXException,
        XMLStreamException, UserAdminUserAdminException,
        LoginAuthenticationExceptionException, LogoutAuthenticationExceptionException,
        JMSException, AndesClientConfigurationException, AndesClientException,
        NamingException, AutomationUtilException {
    // "superAdmin" refers to the admin
    this.createPublishAndSubscribeFromUser("superAdmin", "authQueue7");

    // Adding publish subscribe permissions of 'authQueue7' to 'pub_sub_queue_role' role.
    QueueRolePermission queueRolePermission = new QueueRolePermission();
    queueRolePermission.setRoleName(PUB_SUB_QUEUE_ROLE);
    queueRolePermission.setAllowedToConsume(true);
    queueRolePermission.setAllowedToPublish(true);
    this.updateQueueRoleConsumePublishPermission("authQueue7", queueRolePermission);
    log.info("Consumer and publish permissions updated for " + PUB_SUB_QUEUE_ROLE);

    this.createPublishAndSubscribeFromUser("authUser3", "authQueue7");
}
 
Example #6
Source File: QueueUserAuthorizationTestCase.java    From product-ei with Apache License 2.0 6 votes vote down vote up
/**
 * User1 and User2 exists in the same role where create queue permission is assigned.
 * User1 creates a queue and then publishes and consumes messages.
 * Admin assigns publishing and consuming  permissions to the role in which User1 and User2 are
 * in.
 * User1 is removed from the role.
 * User2 tries to publish and consume messages. User2 succeeds.
 *
 * @throws IOException
 * @throws LoginAuthenticationExceptionException
 * @throws URISyntaxException
 * @throws LogoutAuthenticationExceptionException
 * @throws XMLStreamException
 * @throws AndesAdminServiceBrokerManagerAdminException
 * @throws SAXException
 * @throws XPathExpressionException
 * @throws UserAdminUserAdminException
 * @throws JMSException
 * @throws AndesClientConfigurationException
 * @throws AndesClientException
 * @throws NamingException
 */
@Test(groups = {"wso2.mb", "queue"})
public void performQueuePermissionSameRoleAssignedPermissions()
        throws IOException, LoginAuthenticationExceptionException, URISyntaxException,
        LogoutAuthenticationExceptionException, XMLStreamException,
        AndesAdminServiceBrokerManagerAdminException, SAXException,
        XPathExpressionException, UserAdminUserAdminException, JMSException,
        AndesClientConfigurationException, AndesClientException, NamingException, AutomationUtilException {
    this.createPublishAndSubscribeFromUser("authUser1", "authQueue6");

    // Adding publish subscribe permissions of 'authQueue6' to 'create_pub_sub_queue_role' role.
    QueueRolePermission queueRolePermission = new QueueRolePermission();
    queueRolePermission.setRoleName(CREATE_PUB_SUB_QUEUE_ROLE);
    queueRolePermission.setAllowedToConsume(true);
    queueRolePermission.setAllowedToPublish(true);
    this.updateQueueRoleConsumePublishPermission("authQueue6", queueRolePermission);
    log.info("Consumer and publish permissions updated for " + CREATE_PUB_SUB_QUEUE_ROLE);

    // Removing authUser1 from create_pub_sub_queue_role and Internal/Q_authQueue6
    userManagementClient
            .addRemoveRolesOfUser("authUser1", new String[]{NO_PERMISSION_QUEUE_ROLE},
                                  new String[]{CREATE_PUB_SUB_QUEUE_ROLE, "Internal/Q_authqueue6"});
    log.info("Removing authUser1 from " + CREATE_PUB_SUB_QUEUE_ROLE + " and Internal/Q_authqueue6");

    this.createPublishAndSubscribeFromUser("authUser2", "authQueue6");
}
 
Example #7
Source File: QueueUserAuthorizationTestCase.java    From product-ei with Apache License 2.0 6 votes vote down vote up
/**
 * User1 and User2 exists in the same role where create queue permission is assigned.
 * Admin(UI) creates a queue and then publishes and consumes messages.
 * Add publish and consume permissions to the role in which User1 and User2 exists.
 * User1 and User2 tries to publish and consume messages. User2 succeeds.
 *
 * @throws AndesClientConfigurationException
 * @throws NamingException
 * @throws IOException
 * @throws XPathExpressionException
 * @throws AndesClientException
 * @throws JMSException
 * @throws UserAdminUserAdminException
 * @throws LoginAuthenticationExceptionException
 * @throws XMLStreamException
 * @throws LogoutAuthenticationExceptionException
 * @throws URISyntaxException
 * @throws SAXException
 * @throws AndesAdminServiceBrokerManagerAdminException
 */
@Test(groups = {"wso2.mb", "queue"})
public void performQueuePermissionSameRoleUsersWithAdminCreated()
        throws AndesClientConfigurationException, NamingException, IOException,
        XPathExpressionException, AndesClientException, JMSException,
        UserAdminUserAdminException, LoginAuthenticationExceptionException,
        XMLStreamException, LogoutAuthenticationExceptionException, URISyntaxException,
        SAXException, AndesAdminServiceBrokerManagerAdminException, AutomationUtilException {
    // "superAdmin" refers to the admin
    this.createPublishAndSubscribeFromUser("superAdmin", "authQueue8");

    // Adding publish subscribe permissions of 'authQueue8' to 'create_pub_sub_queue_role' role.
    QueueRolePermission queueRolePermission = new QueueRolePermission();
    queueRolePermission.setRoleName(CREATE_PUB_SUB_QUEUE_ROLE);
    queueRolePermission.setAllowedToConsume(true);
    queueRolePermission.setAllowedToPublish(true);
    this.updateQueueRoleConsumePublishPermission("authQueue8", queueRolePermission);
    log.info("Consumer and publish permissions updated for " + CREATE_PUB_SUB_QUEUE_ROLE);

    this.createPublishAndSubscribeFromUser("authUser1", "authQueue8");
    this.createPublishAndSubscribeFromUser("authUser2", "authQueue8");
}
 
Example #8
Source File: SubTopicUserAuthorizationTestCase.java    From product-ei with Apache License 2.0 6 votes vote down vote up
/**
 * Deleting the topics that were created.
 *
 * @throws XPathExpressionException
 * @throws LoginAuthenticationExceptionException
 * @throws IOException
 * @throws XMLStreamException
 * @throws URISyntaxException
 * @throws SAXException
 * @throws AndesEventAdminServiceEventAdminException
 * @throws LogoutAuthenticationExceptionException
 */
@AfterClass()
public void cleanUpTopics()
        throws XPathExpressionException, LoginAuthenticationExceptionException, IOException,
        XMLStreamException, URISyntaxException, SAXException,
        AndesEventAdminServiceEventAdminException,
        LogoutAuthenticationExceptionException, AutomationUtilException {
    LoginLogoutClient loginLogoutClientForUser = new LoginLogoutClient(this.automationContext);
    String sessionCookie = loginLogoutClientForUser.login();
    TopicAdminClient topicAdminClient =
            new TopicAdminClient(this.backendURL, sessionCookie);
    topicAdminClient.removeTopic("authTopic1");
    topicAdminClient.removeTopic("authTopic2");
    topicAdminClient.removeTopic("authTopic3");

    loginLogoutClientForUser.logout();

}
 
Example #9
Source File: TopicUserAuthorizationTestCase.java    From product-ei with Apache License 2.0 6 votes vote down vote up
/**
 * Assigning consuming publishing permissions of a topic to a role.
 *
 * @param topicName   The topic name
 * @param permissions New permissions for the role. can be publish, consume.
 * @throws XPathExpressionException
 * @throws IOException
 * @throws URISyntaxException
 * @throws SAXException
 * @throws XMLStreamException
 * @throws LoginAuthenticationExceptionException
 * @throws AndesAdminServiceBrokerManagerAdminException
 * @throws LogoutAuthenticationExceptionException
 * @throws UserAdminUserAdminException
 */
public void updateTopicRoleConsumePublishPermission(String topicName,
                                                    TopicRolePermission permissions)
        throws XPathExpressionException, IOException, URISyntaxException, SAXException,
        XMLStreamException, LoginAuthenticationExceptionException,
        AndesAdminServiceBrokerManagerAdminException,
        LogoutAuthenticationExceptionException,
        UserAdminUserAdminException,
        AndesEventAdminServiceEventAdminException, AutomationUtilException {

    LoginLogoutClient loginLogoutClientForUser = new LoginLogoutClient(automationContext);
    String sessionCookie = loginLogoutClientForUser.login();
    TopicAdminClient topicAdminClient =
            new TopicAdminClient(backendURL, sessionCookie);
    topicAdminClient.updatePermissionForTopic(topicName, permissions);
    loginLogoutClientForUser.logout();
}
 
Example #10
Source File: TopicUserAuthorizationTestCase.java    From product-ei with Apache License 2.0 6 votes vote down vote up
/**
 * Deleting the topics that were created.
 *
 * @throws XPathExpressionException
 * @throws LoginAuthenticationExceptionException
 * @throws IOException
 * @throws XMLStreamException
 * @throws URISyntaxException
 * @throws SAXException
 * @throws AndesEventAdminServiceEventAdminException
 * @throws LogoutAuthenticationExceptionException
 */
@AfterClass()
public void cleanUpTopics()
        throws XPathExpressionException, LoginAuthenticationExceptionException, IOException,
        XMLStreamException, URISyntaxException, SAXException,
        AndesEventAdminServiceEventAdminException,
        LogoutAuthenticationExceptionException, AutomationUtilException {
    LoginLogoutClient loginLogoutClientForUser = new LoginLogoutClient(this.automationContext);
    String sessionCookie = loginLogoutClientForUser.login();
    TopicAdminClient topicAdminClient =
            new TopicAdminClient(this.backendURL, sessionCookie);
    topicAdminClient.removeTopic("authTopic1");
    topicAdminClient.removeTopic("authTopic2");
    topicAdminClient.removeTopic("authTopic3");
    topicAdminClient.removeTopic("authTopic4");
    topicAdminClient.removeTopic("authTopic5");
    topicAdminClient.removeTopic("authTopic6");
    topicAdminClient.removeTopic("authTopic7");
    topicAdminClient.removeTopic("authTopic8");
    topicAdminClient.removeTopic("authTopic9");

    loginLogoutClientForUser.logout();

}
 
Example #11
Source File: TopicUserAuthorizationTestCase.java    From product-ei with Apache License 2.0 6 votes vote down vote up
/**
 * User1 and User2 exists in the same role where create topic permission is assigned.
 * Admin(UI) creates a topic and then publishes and consumes messages.
 * Add publish and consume permissions to the role in which User1 and User2 exists.
 * User1 and User2 tries to publish and consume messages. User2 succeeds.
 *
 * @throws AndesClientConfigurationException
 * @throws NamingException
 * @throws IOException
 * @throws XPathExpressionException
 * @throws AndesClientException
 * @throws JMSException
 * @throws UserAdminUserAdminException
 * @throws LoginAuthenticationExceptionException
 * @throws AndesEventAdminServiceEventAdminException
 * @throws XMLStreamException
 * @throws LogoutAuthenticationExceptionException
 * @throws URISyntaxException
 * @throws SAXException
 * @throws AndesAdminServiceBrokerManagerAdminException
 */
@Test(groups = {"wso2.mb", "topic"})
public void performTopicPermissionSameRoleUsersWithAdminCreated()
        throws AndesClientConfigurationException, NamingException, IOException,
        XPathExpressionException, AndesClientException, JMSException,
        UserAdminUserAdminException, LoginAuthenticationExceptionException,
        AndesEventAdminServiceEventAdminException, XMLStreamException,
        LogoutAuthenticationExceptionException, URISyntaxException, SAXException,
        AndesAdminServiceBrokerManagerAdminException, AutomationUtilException {
    // "superAdmin" refers to the admin
    this.createPublishAndSubscribeFromUser("superAdmin", "authTopic8");

    // Adding publish subscribe permissions of 'authTopic8' to 'create_pub_sub_topic_role' role.
    TopicRolePermission topicRolePermission = new TopicRolePermission();
    topicRolePermission.setRoleName(CREATE_PUB_SUB_TOPIC_ROLE);
    topicRolePermission.setAllowedToSubscribe(true);
    topicRolePermission.setAllowedToPublish(true);
    this.updateTopicRoleConsumePublishPermission("authTopic8", topicRolePermission);
    log.info("Consumer and publish permissions updated for " + CREATE_PUB_SUB_TOPIC_ROLE);

    this.createPublishAndSubscribeFromUser("authUser1", "authTopic8");
    this.createPublishAndSubscribeFromUser("authUser2", "authTopic8");
}
 
Example #12
Source File: BPELDataHandlingTest.java    From product-ei with Apache License 2.0 6 votes vote down vote up
@AfterClass(alwaysRun = true)
public void removeArtifacts()
        throws PackageManagementException, InterruptedException, RemoteException,
        LogoutAuthenticationExceptionException {
    bpelPackageManagementClient.undeployBPEL("TestComposeUrl");
    bpelPackageManagementClient.undeployBPEL("FlexibleAssign");
    bpelPackageManagementClient.undeployBPEL("TestIgnoreMissingFromData");
    bpelPackageManagementClient.undeployBPEL("TestCombineUrl");
    bpelPackageManagementClient.undeployBPEL("TestExpandTemplate");
    bpelPackageManagementClient.undeployBPEL("TestAssignActivity1");
    bpelPackageManagementClient.undeployBPEL("TestAssignDate");
    bpelPackageManagementClient.undeployBPEL("TestXslTransform");
    bpelPackageManagementClient.undeployBPEL("TestCounter");
    bpelPackageManagementClient.undeployBPEL("TestSplit");
    bpelPackageManagementClient.undeployBPEL("TestXslTransform");
    bpelPackageManagementClient.undeployBPEL("XMLAttributeProcess");
    this.loginLogoutClient.logout();
}
 
Example #13
Source File: DLCQueueTestCase.java    From product-ei with Apache License 2.0 5 votes vote down vote up
/**
 * Gets the number of messages in the DLC queue.
 *
 * @return The number of messages.
 * @throws AutomationUtilException
 * @throws RemoteException
 * @throws LogoutAuthenticationExceptionException
 * @throws AndesAdminServiceBrokerManagerAdminException
 */
private long getDLCMessageCount() throws AutomationUtilException, RemoteException,
        LogoutAuthenticationExceptionException, AndesAdminServiceBrokerManagerAdminException {
    LoginLogoutClient loginLogoutClientForAdmin = new LoginLogoutClient(mbServer);
    String sessionCookie = loginLogoutClientForAdmin.login();
    AndesAdminClient andesAdminClient = new AndesAdminClient(backendURL, sessionCookie);
    long messageCount = andesAdminClient.getDlcQueue().getMessageCount();
    loginLogoutClientForAdmin.logout();

    return messageCount;
}
 
Example #14
Source File: BpelInstanceManagementTest.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void removeArtifacts()
        throws PackageManagementException, InterruptedException, RemoteException,
        LoginAuthenticationExceptionException, LogoutAuthenticationExceptionException {
    bpelPackageManagementClient.undeployBPEL("TestPickOneWay");
    this.loginLogoutClient.logout();
}
 
Example #15
Source File: RedeliveryDelayTestCase.java    From product-ei with Apache License 2.0 5 votes vote down vote up
/**
 * This method will restore all the configurations back.
 * Following configurations will be restored.
 * 1. AndesAckWaitTimeOut system property.
 * 2. AndesRedeliveryDelay system property.
 * 3. Deleted all destination created in this test class.
 * 4. Restore default broker.xml and restart server.
 *
 * @throws IOException
 * @throws AutomationUtilException
 */
@AfterClass()
public void tearDown()
        throws IOException, AutomationUtilException, LogoutAuthenticationExceptionException,
        AndesAdminServiceBrokerManagerAdminException {
    if (StringUtils.isBlank(defaultAndesAckWaitTimeOut)) {
        System.clearProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY);
    } else {
        System.setProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY, defaultAndesAckWaitTimeOut);
    }

    if (StringUtils.isBlank(defaultAndesRedeliveryDelay)) {
        System.clearProperty(AndesClientConstants.ANDES_REDELIVERY_DELAY_PROPERTY);
    } else {
        System.setProperty(AndesClientConstants.ANDES_REDELIVERY_DELAY_PROPERTY, defaultAndesRedeliveryDelay);
    }

    LoginLogoutClient loginLogoutClientForAdmin = new LoginLogoutClient(super.automationContext);
    String sessionCookie = loginLogoutClientForAdmin.login();
    AndesAdminClient andesAdminClient = new AndesAdminClient(super.backendURL, sessionCookie);

    andesAdminClient.deleteQueue("firstMessageInvalidOnlyQueue");
    andesAdminClient.deleteQueue("firstMessageInvalidOnlyReceiverQueue");
    andesAdminClient.deleteQueue("multipleUnacknowledgeQueue");
    andesAdminClient.deleteQueue("multipleUnacknowledgeReceiverQueue");
    andesAdminClient.deleteQueue("oneByOneUnacknowledgeQueue");
    andesAdminClient.deleteQueue("oneByOneUnacknowledgeReceiverQueue");
    andesAdminClient.deleteQueue("firstFewUnacknowledgeQueue");
    andesAdminClient.deleteQueue("firstFewUnacknowledgeReceiverQueue");
    andesAdminClient.deleteQueue("unacknowledgeMiddleMessageQueue");
    andesAdminClient.deleteQueue("unacknowledgeMiddleMessageReceiverQueue");
    andesAdminClient.deleteQueue("oneByOneUnacknowledgeMessageListenerForMultiple");
    andesAdminClient.deleteQueue("oneByOneUnacknowledgeMessageReceiverForMultipleQueue");
    loginLogoutClientForAdmin.logout();

    //Revert back to original configuration.
    super.serverManager.restoreToLastConfiguration(true);
}
 
Example #16
Source File: TopicUserAuthorizationTestCase.java    From product-ei with Apache License 2.0 5 votes vote down vote up
/**
 * User1 and User2 exists in the same role where create topic  permission is assigned.
 * User1 creates a topic  and then publishes and consumes messages.
 * Admin assigns publishing and consuming  permissions to the role in which User1 and User2 are in.
 * User1 is removed from the role.
 * User2 tries to publish and consume messages. User2 succeeds.
 *
 * @throws AndesClientConfigurationException
 * @throws NamingException
 * @throws IOException
 * @throws XPathExpressionException
 * @throws AndesClientException
 * @throws JMSException
 * @throws UserAdminUserAdminException
 * @throws LoginAuthenticationExceptionException
 * @throws AndesEventAdminServiceEventAdminException
 * @throws XMLStreamException
 * @throws LogoutAuthenticationExceptionException
 * @throws URISyntaxException
 * @throws SAXException
 * @throws AndesAdminServiceBrokerManagerAdminException
 */
@Test(groups = {"wso2.mb", "topic"})
public void performTopicPermissionSameRoleAssignedPermissions()
        throws AndesClientConfigurationException, NamingException, IOException,
        XPathExpressionException, AndesClientException, JMSException,
        UserAdminUserAdminException, LoginAuthenticationExceptionException,
        AndesEventAdminServiceEventAdminException, XMLStreamException,
        LogoutAuthenticationExceptionException, URISyntaxException, SAXException,
        AndesAdminServiceBrokerManagerAdminException, AutomationUtilException {
    this.createPublishAndSubscribeFromUser("authUser1", "authTopic6");

    // Adding publish subscribe permissions of 'authTopic6' to 'create_pub_sub_topic_role' role.
    TopicRolePermission topicRolePermission = new TopicRolePermission();
    topicRolePermission.setRoleName(CREATE_PUB_SUB_TOPIC_ROLE);
    topicRolePermission.setAllowedToSubscribe(true);
    topicRolePermission.setAllowedToPublish(true);
    updateTopicRoleConsumePublishPermission("authTopic6", topicRolePermission);
    log.info("Consumer and publish permissions updated for " + CREATE_PUB_SUB_TOPIC_ROLE);

    // Removing authUser1 from create_pub_sub_topic_role and Internal/T_authTopic6
    userManagementClient
            .addRemoveRolesOfUser("authUser1", new String[]{NO_PERMISSION_TOPIC_ROLE},
                              new String[]{CREATE_PUB_SUB_TOPIC_ROLE, "Internal/T_authtopic6"});

    this.createPublishAndSubscribeFromUser("authUser2", "authTopic6");

}
 
Example #17
Source File: GlobalThrottleEngineClientTestCase.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
@Test
public void testLogoutAuthenticationExceptionWhenDeployingExPlan() throws Exception{
    GlobalThrottleEngineClient globalThrottleEngineClient = new GlobalThrottleEngineClientWrapper(authenticationAdminStub, eventProcessorAdminServiceStub, policyDeployer);
    Mockito.doThrow(LogoutAuthenticationExceptionException.class).when(authenticationAdminStub).logout();
    globalThrottleEngineClient.deployExecutionPlan(EX_PLAN);
    Mockito.verify(authenticationAdminStub, Mockito.atLeastOnce()).login(USER_NAME, PASSWORD, HOST);
    Mockito.verify(eventProcessorAdminServiceStub, Mockito.times(1)).deployExecutionPlan(EX_PLAN);
}
 
Example #18
Source File: GlobalThrottleEngineClientTestCase.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
@Test
public void testLogoutAuthenticationExceptionWhenUpdatingExPlan() throws Exception{
    GlobalThrottleEngineClient globalThrottleEngineClient = new GlobalThrottleEngineClientWrapper(authenticationAdminStub, eventProcessorAdminServiceStub, policyDeployer);
    Mockito.doThrow(LogoutAuthenticationExceptionException.class).when(authenticationAdminStub).logout();
    globalThrottleEngineClient.updateExecutionPlan(EX_PLAN_NAME, EX_PLAN);
    Mockito.verify(authenticationAdminStub, Mockito.atLeastOnce()).login(USER_NAME, PASSWORD, HOST);
    Mockito.verify(eventProcessorAdminServiceStub, Mockito.times(1)).editActiveExecutionPlan(EX_PLAN, EX_PLAN_NAME);
}
 
Example #19
Source File: CARBON14841TenantHTTPHeadersTest.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void removeArtifacts()
        throws PackageManagementException, InterruptedException, RemoteException,
               LogoutAuthenticationExceptionException {
    bpelPackageManagementClient.undeployBPEL("AdminServiceInvoke");
    this.loginLogoutClient.logout();
}
 
Example #20
Source File: BpelInMemoryDeploymentTest.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void removeArtifacts()
        throws PackageManagementException, InterruptedException, RemoteException,
        LogoutAuthenticationExceptionException {
    bpelPackageManagementClient.undeployBPEL("CustomerInfo");
    this.loginLogoutClient.logout();
}
 
Example #21
Source File: BpelRedeployTest.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void removeArtifacts()
        throws PackageManagementException, InterruptedException, RemoteException,
        LogoutAuthenticationExceptionException {
    bpelPackageManagementClient.undeployBPEL("HelloWorld2");
    this.loginLogoutClient.logout();
}
 
Example #22
Source File: BPELMessageRoutingTest.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void removeArtifacts()
        throws PackageManagementException, InterruptedException, RemoteException,
        LogoutAuthenticationExceptionException {
    bpelPackageManagementClient.undeployBPEL("TestCorrelationUnique");
    bpelPackageManagementClient.undeployBPEL("MyRoleMexTestProcess");
    this.loginLogoutClient.logout();
}
 
Example #23
Source File: BPELFunctionalityTest.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void removeArtifacts()
        throws PackageManagementException, InterruptedException, RemoteException,
        LogoutAuthenticationExceptionException {
    bpelPackageManagementClient.undeployBPEL("TestAlarm");
    bpelPackageManagementClient.undeployBPEL("DynPartner");
    bpelPackageManagementClient.undeployBPEL("TestForEach");
    bpelPackageManagementClient.undeployBPEL("TestPickOneWay");
    this.loginLogoutClient.logout();
}
 
Example #24
Source File: BPELStructuredActivitiesTest.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void removeArtifacts()
        throws PackageManagementException, InterruptedException, RemoteException,
        LogoutAuthenticationExceptionException {
    bpelPackageManagementClient.undeployBPEL("TestFlowLinks");
    bpelPackageManagementClient.undeployBPEL("TestForEach");
    bpelPackageManagementClient.undeployBPEL("TestPickOneWay");
    this.loginLogoutClient.logout();
}
 
Example #25
Source File: BPELTestCaseMisc.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void removeArtifacts()
        throws PackageManagementException, InterruptedException, RemoteException,
        LogoutAuthenticationExceptionException {
    bpelPackageManagementClient.undeployBPEL("Async-Server");
    bpelPackageManagementClient.undeployBPEL("Async-Client");
    bpelPackageManagementClient.undeployBPEL("TestCorrelationWithAttribute");
    this.loginLogoutClient.logout();
}
 
Example #26
Source File: BPELBasicActivitiesTest.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void removeArtifacts()
        throws PackageManagementException, InterruptedException, RemoteException,
        LogoutAuthenticationExceptionException {
    bpelPackageManagementClient.undeployBPEL("TestIf");
    this.loginLogoutClient.logout();
}
 
Example #27
Source File: BPELPubSubTestCase.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void removeArtifacts()
        throws PackageManagementException, InterruptedException, RemoteException,
        LogoutAuthenticationExceptionException {
    bpelPackageManagementClient.undeployBPEL("TestPubSubInProc");
    this.loginLogoutClient.logout();
}
 
Example #28
Source File: BPELRestInvocationTest.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void removeArtifacts()
        throws PackageManagementException, InterruptedException, RemoteException,
        LogoutAuthenticationExceptionException {
    bpelPackageManagementClient.undeployBPEL("TestRESTProcess");
    this.loginLogoutClient.logout();
}
 
Example #29
Source File: BPELRPCPartnerInvocationTest.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void removeArtifacts()
        throws PackageManagementException, InterruptedException, RemoteException,
        LogoutAuthenticationExceptionException {
    bpelPackageManagementClient.undeployBPEL("RPCServiceProcess");
    bpelPackageManagementClient.undeployBPEL("RPCClientProcess");
    this.loginLogoutClient.logout();
}
 
Example #30
Source File: BPELExtensionTest.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void removeArtifacts()
        throws PackageManagementException, InterruptedException, RemoteException,
        LogoutAuthenticationExceptionException {
    bpelPackageManagementClient.undeployBPEL("TestProcessProperties");
    this.loginLogoutClient.logout();
}