org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException Java Examples
The following examples show how to use
org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException.
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: DLCDurableTopicTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * This method will restore all the configurations back. * Following configurations will be restored. * 1. AndesAckWaitTimeOut system property. * 2. Restore default broker.xml and restart server. * * @throws IOException * @throws AutomationUtilException */ @AfterClass() public void tearDown() throws IOException, AutomationUtilException { // Setting system property "AndesAckWaitTimeOut" to default value. // This will set andes ack wait timeout to 0. To send messages to // DLC fast wait time has set to 0. if (StringUtils.isBlank(defaultAndesAckWaitTimeOut)) { System.clearProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY); } else { System.setProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY, defaultAndesAckWaitTimeOut); } restartInPreviousConfiguration(); driver.quit(); }
Example #2
Source File: SlowestSubscriptionRateMsgDeliveryStrategyTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * Set topicMessageDeliveryStrategy to SLOWEST_SUB_RATE_TOPIC so that broker will deliver the messages * * @throws XPathExpressionException * @throws java.io.IOException * @throws org.apache.commons.configuration.ConfigurationException * @throws org.xml.sax.SAXException * @throws javax.xml.stream.XMLStreamException * @throws org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException * @throws java.net.URISyntaxException * @throws org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException */ @BeforeClass public void setupConfiguration() throws XPathExpressionException, IOException, ConfigurationException, SAXException, XMLStreamException, LoginAuthenticationExceptionException, URISyntaxException, AutomationUtilException { super.serverManager = new ServerConfigurationManager(automationContext); String defaultMBConfigurationPath = ServerConfigurationManager.getCarbonHome() + File.separator + "wso2" + File.separator + "broker" + File.separator + "conf" + File.separator + "broker.xml"; ConfigurationEditor configurationEditor = new ConfigurationEditor(defaultMBConfigurationPath); configurationEditor.updateProperty(AndesConfiguration .PERFORMANCE_TUNING_TOPIC_MESSAGE_DELIVERY_STRATEGY, "SLOWEST_SUB_RATE"); //reduce this to 200 from default value (1000) so that delivery strategy is effective fast configurationEditor.updateProperty(AndesConfiguration.PERFORMANCE_TUNING_ACK_HANDLING_MAX_UNACKED_MESSAGES, "2"); configurationEditor.applyUpdatedConfigurationAndRestartServer(serverManager); }
Example #3
Source File: DurableTopicSubscriptionTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * Prepare environment for tests. * * @throws XPathExpressionException * @throws LoginAuthenticationExceptionException * @throws IOException * @throws XMLStreamException * @throws URISyntaxException * @throws SAXException * @throws AutomationUtilException */ @BeforeClass(alwaysRun = true) public void init() throws XPathExpressionException, LoginAuthenticationExceptionException, IOException, XMLStreamException, URISyntaxException, SAXException, AutomationUtilException { super.initCluster(TestUserMode.SUPER_TENANT_ADMIN); AutomationContext automationContext1 = getAutomationContextWithKey("mb002"); AutomationContext automationContext2 = getAutomationContextWithKey("mb003"); hostNode1 = automationContext1.getInstance().getHosts().get("default"); hostNode2 = automationContext2.getInstance().getHosts().get("default"); portInNode1 = Integer.parseInt(automationContext1.getInstance().getPorts().get("amqp")); portInNode2 = Integer.parseInt(automationContext2.getInstance().getPorts().get("amqp")); topicAdminClient = new TopicAdminClient(automationContext1.getContextUrls().getBackEndUrl(), super.login(automationContext1)); super.initAndesAdminClients(); }
Example #4
Source File: LZ4UITestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * Revert changed configuration, purge and delete the queue. * * @throws XPathExpressionException * @throws IOException * @throws AutomationUtilException */ @AfterClass() public void cleanup() throws XPathExpressionException, IOException, AutomationUtilException { // Delete test queue driver.get(getLoginURL()); HomePage homePage = new HomePage(driver); QueuesBrowsePage queuesBrowsePage = homePage.getQueuesBrowsePage(); Assert.assertTrue(queuesBrowsePage.deleteQueue(TEST_QUEUE_NAME), "Failed to delete queue : " + TEST_QUEUE_NAME); //Revert back to original configuration. super.serverManager.restoreToLastConfiguration(true); driver.quit(); }
Example #5
Source File: Axis2ServerStartupWithSecuredServices.java From product-ei with Apache License 2.0 | 6 votes |
@AfterTest(alwaysRun = true) public void unDeployServices() throws IOException, LoginAuthenticationExceptionException, ExceptionException, XPathExpressionException, URISyntaxException, SAXException, XMLStreamException, AutomationUtilException { if (TestConfigurationProvider.isIntegration() && axis2Server1 != null && axis2Server1.isStarted()) { axis2Server1.stop(); } else { AutomationContext asContext = new AutomationContext("AS", TestUserMode.SUPER_TENANT_ADMIN); int deploymentDelay = TestConfigurationProvider.getServiceDeploymentDelay(); String serviceName = "SecureStockQuoteServiceScenario"; ServiceDeploymentUtil deployer = new ServiceDeploymentUtil(); LoginLogoutClient loginLogoutClient = new LoginLogoutClient(asContext); for (int i = 1; i < 9; i++) { deployer.unDeployArrService(asContext.getContextUrls().getBackEndUrl(), loginLogoutClient.login() , serviceName + i, deploymentDelay); } } }
Example #6
Source File: Axis2ServerStartupWithSecuredServices.java From micro-integrator with Apache License 2.0 | 6 votes |
@AfterTest(alwaysRun = true) public void unDeployServices() throws IOException, LoginAuthenticationExceptionException, ExceptionException, XPathExpressionException, URISyntaxException, SAXException, XMLStreamException, AutomationUtilException { if (TestConfigurationProvider.isIntegration() && axis2Server1 != null && axis2Server1.isStarted()) { axis2Server1.stop(); } else { AutomationContext asContext = new AutomationContext("AS", TestUserMode.SUPER_TENANT_ADMIN); int deploymentDelay = TestConfigurationProvider.getServiceDeploymentDelay(); String serviceName = "SecureStockQuoteServiceScenario"; ServiceDeploymentUtil deployer = new ServiceDeploymentUtil(); LoginLogoutClient loginLogoutClient = new LoginLogoutClient(asContext); for (int i = 1; i < 9; i++) { deployer.unDeployArrService(asContext.getContextUrls().getBackEndUrl(), loginLogoutClient.login(), serviceName + i, deploymentDelay); } } }
Example #7
Source File: ViewMessageContentTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * Revert changed configuration, purge and delete the queue. * * @throws XPathExpressionException * @throws IOException * @throws AutomationUtilException */ @AfterClass() public void cleanup() throws XPathExpressionException, IOException, AutomationUtilException { // Delete test queue driver.get(getLoginURL()); HomePage homePage = new HomePage(driver); QueuesBrowsePage queuesBrowsePage = homePage.getQueuesBrowsePage(); Assert.assertTrue(queuesBrowsePage.deleteQueue(TEST_QUEUE_NAME), "Failed to delete queue : " + TEST_QUEUE_NAME); //Revert back to original configuration. super.serverManager.restoreToLastConfiguration(true); driver.quit(); }
Example #8
Source File: CAppDeactivateAndRestartTestCase.java From micro-integrator with Apache License 2.0 | 6 votes |
@Test(groups = "wso2.esb", enabled = true, description = "Test whether proxy service is inactive") public void testVFSProxyInactiveState() throws AutomationUtilException, IOException, InterruptedException { //create test file in the ftp server FileUtils.copyFile(new File( getESBResourceLocation() + File.separator + "synapseconfig" + File.separator + "vfsTransport" + File.separator + "test.xml"), new File(inputFolder.getPath() + File.separator + "test.xml")); //check the output directory File filePathToOutputFile = new File(outputFolder.getPath() + File.separator + "test.xml"); //wait and check till polling time get exceeded for ~15seconds for (int i = 0; i < 15; i++) { log.info("Wait and check output directory to verify service is deactivated successfully"); Assert.assertFalse(filePathToOutputFile.exists(), "File exists, hence the service :" + service + " deactivation is not persisted"); Thread.sleep(1000); } }
Example #9
Source File: QueueUserAuthorizationTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * 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 #10
Source File: DLCMessageExpiryTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * Set topicMessageDeliveryStrategy to DISCARD_ALLOWED so that broker will simulate an acknowledgement * if some subscribers are slow to acknowledge the message * * @throws XPathExpressionException * @throws IOException * @throws ConfigurationException * @throws SAXException * @throws XMLStreamException * @throws LoginAuthenticationExceptionException * @throws URISyntaxException * @throws AutomationUtilException */ @BeforeClass public void setupConfiguration() throws XPathExpressionException, IOException, ConfigurationException, SAXException, XMLStreamException, LoginAuthenticationExceptionException, URISyntaxException, AutomationUtilException { super.serverManager = new ServerConfigurationManager(automationContext); String defaultMBConfigurationPath = ServerConfigurationManager.getCarbonHome() + File.separator + "wso2" + File.separator + "broker" + File.separator + "conf" + File.separator + "broker.xml"; ConfigurationEditor configurationEditor = new ConfigurationEditor(defaultMBConfigurationPath); configurationEditor.updateProperty(AndesConfiguration.PERFORMANCE_TUNING_PRE_DELIVERY_EXPIRY_DELETION_INTERVAL, "60"); configurationEditor.updateProperty(AndesConfiguration .PERFORMANCE_TUNING_PERIODIC_EXPIRY_MESSAGE_DELETION_INTERVAL, "60"); configurationEditor.updateProperty(AndesConfiguration.TRANSPORTS_AMQP_MAXIMUM_REDELIVERY_ATTEMPTS, "1"); configurationEditor.applyUpdatedConfigurationAndRestartServer(serverManager); // Get current "AndesAckWaitTimeOut" system property. defaultAndesAckWaitTimeOut = System.getProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY); // Setting system property "AndesAckWaitTimeOut" for andes System.setProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY, "3000"); }
Example #11
Source File: MessageContentTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * Set allowCompression to false, so that broker won't compress messages * * @throws XPathExpressionException * @throws java.io.IOException * @throws org.apache.commons.configuration.ConfigurationException * @throws org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException */ @BeforeClass public void setupConfiguration() throws XPathExpressionException, IOException, ConfigurationException, AutomationUtilException { super.serverManager = new ServerConfigurationManager(automationContext); String defaultMBConfigurationPath = ServerConfigurationManager.getCarbonHome() + File.separator + "wso2" + File.separator + "broker" + File.separator + "conf" + File.separator + "broker.xml"; ConfigurationEditor configurationEditor = new ConfigurationEditor(defaultMBConfigurationPath); configurationEditor.updateProperty(AndesConfiguration.PERFORMANCE_TUNING_ALLOW_COMPRESSION, "false"); configurationEditor.applyUpdatedConfigurationAndRestartServer(serverManager); }
Example #12
Source File: QueueUserAuthorizationTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * 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 #13
Source File: TopicUserAuthorizationTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * Admin add subscription to topic and subscribe. * Admin unsubscribe from topic after receiving expected message count * Delete topic admin created * User1 create topic with the same name * * Expected results - User1 must be able to successfully create and subscribe to topic * * @throws AndesClientConfigurationException * @throws NamingException * @throws JMSException * @throws AndesClientException * @throws XPathExpressionException * @throws IOException */ @Test(groups = {"wso2.mb", "topic"}) public void performTopicPermissionWithAdminCreateAndUnscribe() throws AndesClientConfigurationException, NamingException, JMSException, AndesClientException, XPathExpressionException, IOException, AutomationUtilException, AndesEventAdminServiceEventAdminException { // "superAdmin" refers to the admin this.createPublishSubscribeAndUnsubscribeFromUser("superAdmin", "authTopic10"); // delete topic admin created LoginLogoutClient loginLogoutClientForUser = new LoginLogoutClient(this.automationContext); String sessionCookie = loginLogoutClientForUser.login(); TopicAdminClient topicAdminClient = new TopicAdminClient(this.backendURL, sessionCookie); topicAdminClient.removeTopic("authTopic10"); // user1 subscribe with same topic name where previously created, unsubscribe and deleted by admin this.createPublishSubscribeAndUnsubscribeFromUser("authUser1", "authTopic10"); }
Example #14
Source File: TopicUserAuthorizationTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * 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 #15
Source File: ServerConfigurationManager.java From micro-integrator with Apache License 2.0 | 6 votes |
/** * restore to a last configuration and restart the server */ public void restoreToLastMIConfiguration() throws IOException, AutomationUtilException { // shut down the server before applying configs to avoid file lock issues. CarbonServerExtension.shutdownServer(); for (ConfigData data : configData) { Files.move(data.getBackupConfig().toPath(), data.getOriginalConfig().toPath(), StandardCopyOption.REPLACE_EXISTING); if (data.getBackupConfig().exists()) { throw new IOException( "File rename from " + data.getBackupConfig() + "to " + data.getOriginalConfig() + "fails"); } } CarbonServerExtension.startServer(); }
Example #16
Source File: DLCReRouteAllTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * This method will restore all the configurations back. * Following configurations will be restored. * 1. AndesAckWaitTimeOut system property. * 2. Restore default broker.xml and restart server. * * @throws IOException * @throws AutomationUtilException */ @AfterClass() public void tearDown() throws IOException, AutomationUtilException { // Setting system property "AndesAckWaitTimeOut" to default value. // This will set andes ack wait timeout to 0. To send messages to // DLC fast wait time has set to 0. if (StringUtils.isBlank(defaultAndesAckWaitTimeOut)) { System.clearProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY); } else { System.setProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY, defaultAndesAckWaitTimeOut); } restartInPreviousConfiguration(); driver.quit(); }
Example #17
Source File: DLCQueueTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * Initializes the test case and changes the number of delivery attempts of a message to 1. * * @throws AutomationUtilException * @throws XPathExpressionException * @throws MalformedURLException */ @BeforeClass() public void initialize() throws AutomationUtilException, XPathExpressionException, IOException, ConfigurationException { super.init(); // Updating the redelivery attempts to 1 to speed up the test case. super.serverManager = new ServerConfigurationManager(mbServer); String defaultMBConfigurationPath = ServerConfigurationManager.getCarbonHome() + File.separator + "wso2" + File.separator + "broker" + File.separator + "conf" + File.separator + "broker.xml"; ConfigurationEditor configurationEditor = new ConfigurationEditor(defaultMBConfigurationPath); // Changing "maximumRedeliveryAttempts" value to "1" in broker.xml configurationEditor.updateProperty(AndesConfiguration.TRANSPORTS_AMQP_MAXIMUM_REDELIVERY_ATTEMPTS, "1"); // Restarting server configurationEditor.applyUpdatedConfigurationAndRestartServer(serverManager); }
Example #18
Source File: TopicClusterTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * Prepare environment for tests. * * @throws XPathExpressionException * @throws URISyntaxException * @throws SAXException * @throws XMLStreamException * @throws LoginAuthenticationExceptionException * @throws IOException */ @BeforeClass(alwaysRun = true) public void init() throws XPathExpressionException, URISyntaxException, SAXException, XMLStreamException, LoginAuthenticationExceptionException, IOException, AutomationUtilException { super.initCluster(TestUserMode.SUPER_TENANT_ADMIN); automationContextForMB2 = getAutomationContextWithKey("mb002"); automationContextForMB3 = getAutomationContextWithKey("mb003"); topicAdminClientForMB2 = new TopicAdminClient(automationContextForMB2.getContextUrls().getBackEndUrl(), super.login(automationContextForMB2)); topicAdminClientForMB3 = new TopicAdminClient(automationContextForMB3.getContextUrls().getBackEndUrl(), super.login(automationContextForMB3)); }
Example #19
Source File: PerMessageAcknowledgementsTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * Initializing test case * * @throws XPathExpressionException */ @BeforeClass(alwaysRun = true) public void init() throws XPathExpressionException, IOException, AutomationUtilException, ConfigurationException { super.init(TestUserMode.SUPER_TENANT_USER); // Updating the redelivery attempts to 1 to speed up the test case. super.serverManager = new ServerConfigurationManager(automationContext); String defaultMBConfigurationPath = ServerConfigurationManager.getCarbonHome() + File.separator + "wso2" + File.separator + "broker" + File.separator + "conf" + File.separator + "broker.xml"; ConfigurationEditor configurationEditor = new ConfigurationEditor(defaultMBConfigurationPath); // Changing "maximumRedeliveryAttempts" value to "1" in broker.xml configurationEditor.updateProperty(AndesConfiguration.TRANSPORTS_AMQP_MAXIMUM_REDELIVERY_ATTEMPTS, "1"); // Restarting server configurationEditor.applyUpdatedConfigurationAndRestartServer(serverManager); // Get current "AndesAckWaitTimeOut" system property. defaultAndesAckWaitTimeOut = System.getProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY); // Setting system property "AndesAckWaitTimeOut" for andes System.setProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY, "3000"); }
Example #20
Source File: PurgeMessagesTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * Set values TRANSPORTS_AMQP_MAXIMUM_REDELIVERY_ATTEMPTS = 1 and * ANDES_ACK_WAIT_TIMEOUT_PROPERTY = 1 * so that the time taken for the massages to get moved into DLC is at a minimum */ @BeforeClass public void setupConfiguration() throws XPathExpressionException, IOException, ConfigurationException, SAXException, XMLStreamException, LoginAuthenticationExceptionException, URISyntaxException, AutomationUtilException { ; super.serverManager = new ServerConfigurationManager(automationContext); String defaultMBConfigurationPath = ServerConfigurationManager.getCarbonHome() + File.separator + "wso2" + File.separator + "broker" + File.separator + "conf" + File.separator + "broker.xml"; ConfigurationEditor configurationEditor = new ConfigurationEditor(defaultMBConfigurationPath); //Set values TRANSPORTS_AMQP_MAXIMUM_REDELIVERY_ATTEMPTS = 1 and //ANDES_ACK_WAIT_TIMEOUT_PROPERTY = 1 //so that the time taken for the massages to get moved into DLC is at a minimum configurationEditor.updateProperty(AndesConfiguration .TRANSPORTS_AMQP_MAXIMUM_REDELIVERY_ATTEMPTS, "1"); System.setProperty(AndesClientConstants.ANDES_ACK_WAIT_TIMEOUT_PROPERTY, "1"); //andesAdminClient.deleteQueue(DLCQueueUtils.identifyTenantInformationAndGenerateDLCString(TEST_QUEUE_PURGE)); //We should restart the server witht he new configuration values configurationEditor.applyUpdatedConfigurationAndRestartServer(serverManager); }
Example #21
Source File: SubscriptionDeleteTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * Initialises the test case. * * @throws AutomationUtilException * @throws XPathExpressionException * @throws MalformedURLException */ @Override @BeforeClass() public void init() throws AutomationUtilException, XPathExpressionException, IOException { super.init(); //log into broker driver.get(getLoginURL()); LoginPage loginPage = new LoginPage(driver); homePage = loginPage.loginAs(getCurrentUserName(), getCurrentPassword()); }
Example #22
Source File: SubscriptionSearchTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * Initialises the test case. * * @throws org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException * @throws javax.xml.xpath.XPathExpressionException * @throws java.net.MalformedURLException */ @Override @BeforeClass() public void init() throws AutomationUtilException, XPathExpressionException, IOException { super.init(); //Log into broker driver.get(getLoginURL()); LoginPage loginPage = new LoginPage(driver); homePage = loginPage.loginAs(getCurrentUserName(), getCurrentPassword()); }
Example #23
Source File: DurableTopicMessageDeliveringTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * Prepare environment for tests. * * @throws XPathExpressionException * @throws URISyntaxException * @throws SAXException * @throws XMLStreamException * @throws LoginAuthenticationExceptionException * @throws IOException */ @BeforeClass(alwaysRun = true) public void init() throws XPathExpressionException, URISyntaxException, SAXException, XMLStreamException, LoginAuthenticationExceptionException, IOException, AutomationUtilException { super.initCluster(TestUserMode.SUPER_TENANT_ADMIN); automationContext = getAutomationContextWithKey("mb002"); topicAdminClient = new TopicAdminClient(automationContext.getContextUrls().getBackEndUrl(), super.login(automationContext)); }
Example #24
Source File: SharedDurableSubscriptionTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * Shuts down the selenium web driver. */ @AfterClass() public void tearDown() throws IOException, AutomationUtilException { //Revert back to original configuration. super.serverManager.restoreToLastConfiguration(true); driver.quit(); }
Example #25
Source File: ConfigurationEditor.java From product-ei with Apache License 2.0 | 5 votes |
/** * Apply modified configuration and restart server * * @param serverConfigurationManager Server configuration manager object from automation engine. * @return true if the update was successful. * @throws IOException * @throws AutomationUtilException * @throws ConfigurationException */ public boolean applyUpdatedConfigurationAndRestartServer(ServerConfigurationManager serverConfigurationManager) throws IOException, AutomationUtilException, ConfigurationException { //Rename original configuration file to original_broker.xml String originalConfigFileDirectory = originalConfigFilePath.substring(0,originalConfigFilePath.lastIndexOf(File.separator)); String originalConfigFileName = originalConfigFilePath.substring(originalConfigFilePath.lastIndexOf(File.separator)); updatedConfigFilePath = originalConfigFileDirectory + UPDATED_CONFIG_FILE_PREFIX + originalConfigFileName; configuration.save(updatedConfigFilePath); serverConfigurationManager.applyConfiguration(new File(updatedConfigFilePath), new File(originalConfigFilePath), true, true); return true; }
Example #26
Source File: DifferentAckModeTopicTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * Prepare environment for tests. * * @throws XPathExpressionException * @throws URISyntaxException * @throws SAXException * @throws XMLStreamException * @throws LoginAuthenticationExceptionException * @throws IOException */ @BeforeClass(alwaysRun = true) public void init() throws XPathExpressionException, URISyntaxException, SAXException, XMLStreamException, LoginAuthenticationExceptionException, IOException, AutomationUtilException { super.initCluster(TestUserMode.SUPER_TENANT_ADMIN); automationContext = getAutomationContextWithKey("mb002"); topicAdminClient = new TopicAdminClient(automationContext.getContextUrls().getBackEndUrl(), super.login(automationContext)); }
Example #27
Source File: RedeliveryDelayTestCase.java From product-ei with Apache License 2.0 | 5 votes |
/** * 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 #28
Source File: ServerConfigurationManager.java From product-ei with Apache License 2.0 | 5 votes |
/** * Create a ServerConfigurationManager * * @param productGroup product group name * @param userMode user mode */ public ServerConfigurationManager(String productGroup, TestUserMode userMode) throws AutomationUtilException, XPathExpressionException, MalformedURLException { this.autoCtx = new AutomationContext(productGroup, userMode); this.loginLogoutClient = new LoginLogoutClient(autoCtx); this.backEndUrl = autoCtx.getContextUrls().getBackEndUrl(); this.port = new URL(backEndUrl).getPort(); this.hostname = new URL(backEndUrl).getHost(); }
Example #29
Source File: MBPlatformBaseTest.java From product-ei with Apache License 2.0 | 5 votes |
/** * Create and login andes admin client to nodes in cluster * * @throws XPathExpressionException * @throws URISyntaxException * @throws SAXException * @throws XMLStreamException * @throws LoginAuthenticationExceptionException * @throws IOException */ protected void initAndesAdminClients() throws XPathExpressionException, URISyntaxException, SAXException, XMLStreamException, LoginAuthenticationExceptionException, IOException, AutomationUtilException { andesAdminClients = new HashMap<String, AndesAdminClient>(); if (contextMap != null && contextMap.size() > 0) { for (Map.Entry<String, AutomationContext> entry : contextMap.entrySet()) { AutomationContext tempContext = entry.getValue(); andesAdminClients.put(entry.getKey(), new AndesAdminClient(tempContext.getContextUrls().getBackEndUrl(), login(tempContext))); } } }
Example #30
Source File: MBIntegrationUiBaseTest.java From product-ei with Apache License 2.0 | 5 votes |
/** * Restart the testing MB server with WSO2 domain name set under user management * * @throws AutomationUtilException * @throws XPathExpressionException * @throws IOException */ protected void restartServerWithDomainName() throws AutomationUtilException, XPathExpressionException, IOException { serverManager = new ServerConfigurationManager(mbServer); // Replace the user-mgt.xml with the new configuration and restarts the server. serverManager.applyConfiguration(new File(FrameworkPathUtil.getSystemResourceLocation() + File.separator + "artifacts" + File.separator + "mb" + File.separator + "config" + File.separator + "user-mgt.xml"), new File(ServerConfigurationManager.getCarbonHome() + File.separator + "wso2" + File.separator + "broker" + File.separator + "conf" + File.separator + "user-mgt.xml"), true, true); }