Java Code Examples for org.wso2.carbon.automation.engine.context.TestUserMode#SUPER_TENANT_USER

The following examples show how to use org.wso2.carbon.automation.engine.context.TestUserMode#SUPER_TENANT_USER . 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: EagerLoadingTestCase.java    From product-ei with Apache License 2.0 6 votes vote down vote up
@BeforeClass(alwaysRun = true)
protected void startServerWithEagerLoading() throws Exception {
    super.init(TestUserMode.SUPER_TENANT_USER);
    serverManager = new ServerConfigurationManager(context);
    AutomationContext autoContext = new AutomationContext();
    // upload a faulty sequence which refer registry resource doesn't exists
    FileUtils.copyFileToDirectory(new File(FrameworkPathUtil.getSystemResourceLocation() +
                                           "/artifacts/ESB/eager/loading/ESBJAVA3602-FaultySeq.xml"),
                                  getSynapseDeploymentDir());

    File carbonXml = new File(FrameworkPathUtil.getSystemResourceLocation() +
                              "/artifacts/ESB/eager/loading/ESBJAVA3602Carbon.xml");
    serverManager.applyConfiguration(carbonXml, getCarbonXmlFile());
    super.init(TestUserMode.TENANT_ADMIN);
    logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie());

}
 
Example 2
Source File: IOTServerExtension.java    From product-iots with Apache License 2.0 5 votes vote down vote up
@Override
public void initiate() {
    try {
        automationContext = new AutomationContext("IOT", TestUserMode.SUPER_TENANT_USER);
        if (getParameters().get(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND) == null) {
            getParameters().put(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND, IOT_CORE_PORT_OFFSET);
        }
        serverManager = new CustomTestServerManager(getAutomationContext(), null, getParameters());
        executionEnvironment =
                automationContext.getConfigurationValue(ContextXpathConstants.EXECUTION_ENVIRONMENT);

    } catch (XPathExpressionException e) {
        throw new RuntimeException("Error while initiating test environment", e);
    }
}
 
Example 3
Source File: TenantDeadLetterChannelTestCase.java    From product-ei with Apache License 2.0 5 votes vote down vote up
/**
 * Initializes the test case.
 *
 * @throws XPathExpressionException
 * @throws java.rmi.RemoteException
 * @throws org.wso2.carbon.user.mgt.stub.UserAdminUserAdminException
 */
@BeforeClass(alwaysRun = true)
public void init() throws XPathExpressionException, RemoteException,
                          UserAdminUserAdminException {
    super.init(TestUserMode.SUPER_TENANT_USER);

    // 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, "0");

}
 
Example 4
Source File: MultiTenantDurableTopicTestCase.java    From product-ei with Apache License 2.0 5 votes vote down vote up
/**
 * Initializing test
 *
 * @throws XPathExpressionException
 * @throws RemoteException
 * @throws UserAdminUserAdminException
 */
@BeforeClass(alwaysRun = true)
public void init() throws XPathExpressionException, RemoteException, UserAdminUserAdminException {
    super.init(TestUserMode.SUPER_TENANT_USER);

    // Logging into user management as admin and adding a new role to give permission for publishing/subscribe
    userManagementClient = new UserManagementClient(backendURL, "[email protected]",
            "admin");

    String[] publishers = {"topictenantuser1"};
    userManagementClient.addRole(PUBLISHER_ROLE, publishers, new String[]{});
}
 
Example 5
Source File: ESBPOXSecurityPostRequestTestCase.java    From product-ei with Apache License 2.0 5 votes vote down vote up
@Test(groups = {"wso2.esb"}, description = "POST request by user/tenant", dependsOnMethods = "testPOSTRequestBySuperAdmin")
public void testPOSTRequestByUser() throws Exception {
    super.init(TestUserMode.SUPER_TENANT_USER);
    applySecurity("1", "Axis2ServiceProxy", getUserRole()[0]);
    String securedRestURL = getProxyServiceURLHttps("Axis2ServiceProxy") + "/echoString";
    HttpsResponse response = HttpsURLConnectionClient.postWithBasicAuth(securedRestURL, "s=TestAutomation",
                                                                        userInfo.getUserName(), userInfo.getPassword());
    assertTrue(response.getData().contains("<ns:echoStringResponse xmlns:ns=\"http://service.carbon.wso2.org\">" +
                                           "<ns:return>TestAutomation</ns:return></ns:echoStringResponse>")
            , "response doesn't contain the expected output");
}
 
Example 6
Source File: MetricsTestCase.java    From product-ei with Apache License 2.0 5 votes vote down vote up
/**
 * Initializing test case
 *
 * @throws XPathExpressionException
 */
@BeforeClass(alwaysRun = true) public void init()
		throws XPathExpressionException, MalformedURLException, AutomationUtilException,
		       MetricsConfigException, MetricsLevelConfigException, RemoteException,
		       LoginAuthenticationExceptionException {
	super.init(TestUserMode.SUPER_TENANT_USER);

	LoginLogoutClient loginLogoutClientForAdmin =
			new LoginLogoutClient(super.automationContext);
	sessionCookie = loginLogoutClientForAdmin.login();
}
 
Example 7
Source File: QueueMessageRedeliveryWithAckTimeOutTestCase.java    From product-ei with Apache License 2.0 4 votes vote down vote up
/**
 * Initializing test case
 * @throws XPathExpressionException
 */
@BeforeClass
public void prepare() throws XPathExpressionException {
    super.init(TestUserMode.SUPER_TENANT_USER);
}
 
Example 8
Source File: JMSSubscriberTransactionsSessionCommitRollbackTestCase.java    From product-ei with Apache License 2.0 4 votes vote down vote up
@BeforeClass
public void prepare() throws Exception {
    super.init(TestUserMode.SUPER_TENANT_USER);
}
 
Example 9
Source File: ESPublisherSubscriptionTestCase.java    From product-es with Apache License 2.0 4 votes vote down vote up
@DataProvider(name = "userMode")
private static Object[][] userModeProvider() {
    return new Object[][]{{TestUserMode.SUPER_TENANT_ADMIN, "Notification asset - SuperAdmin"},
            {TestUserMode.SUPER_TENANT_USER, "Notification asset - SuperUser"}};
}
 
Example 10
Source File: MultiThreadedTopicTestCase.java    From product-ei with Apache License 2.0 2 votes vote down vote up
/**
 * Initialize the test as super tenant user.
 *
 * @throws javax.xml.xpath.XPathExpressionException
 */
@BeforeClass(alwaysRun = true)
public void init() throws XPathExpressionException {
    super.init(TestUserMode.SUPER_TENANT_USER);
}
 
Example 11
Source File: MultiThreadedMultipleTopicTestCase.java    From product-ei with Apache License 2.0 2 votes vote down vote up
/**
 * Initialize the test as super tenant user.
 *
 * @throws javax.xml.xpath.XPathExpressionException
 */
@BeforeClass(alwaysRun = true)
public void init() throws XPathExpressionException {
    super.init(TestUserMode.SUPER_TENANT_USER);
}
 
Example 12
Source File: TopicMessageExpiryTestCase.java    From product-ei with Apache License 2.0 2 votes vote down vote up
/**
 * Initializing test case
 *
 * @throws XPathExpressionException
 */
@BeforeClass(alwaysRun = true)
public void init() throws XPathExpressionException {
    super.init(TestUserMode.SUPER_TENANT_USER);
}
 
Example 13
Source File: DiscardAllowedMsgDeliveryStrategyTestCase.java    From product-ei with Apache License 2.0 2 votes vote down vote up
/**
 * Initializes test case
 *
 * @throws javax.xml.xpath.XPathExpressionException
 */
@BeforeClass()
public void init() throws XPathExpressionException, MalformedURLException {
	super.init(TestUserMode.SUPER_TENANT_USER);
}
 
Example 14
Source File: SelectorsTestCase.java    From product-ei with Apache License 2.0 2 votes vote down vote up
/**
 * Initializes test case
 *
 * @throws XPathExpressionException
 */
@BeforeClass(alwaysRun = true)
public void init() throws XPathExpressionException {
    super.init(TestUserMode.SUPER_TENANT_USER);
}
 
Example 15
Source File: MultiTenantTopicTestCase.java    From product-ei with Apache License 2.0 2 votes vote down vote up
/**
 * Initializes test case
 *
 * @throws XPathExpressionException
 */
@BeforeClass(alwaysRun = true)
public void init() throws XPathExpressionException {
    super.init(TestUserMode.SUPER_TENANT_USER);
}
 
Example 16
Source File: TransactedAcknowledgementsTestCase.java    From product-ei with Apache License 2.0 2 votes vote down vote up
/**
 * Prepare environment for tests
 *
 * @throws XPathExpressionException
 */
@BeforeClass
public void prepare() throws XPathExpressionException {
    super.init(TestUserMode.SUPER_TENANT_USER);
}
 
Example 17
Source File: AutoAcknowledgementsTestCase.java    From product-ei with Apache License 2.0 2 votes vote down vote up
/**
 * Prepare environment for tests
 *
 * @throws XPathExpressionException
 */
@BeforeClass
public void prepare() throws XPathExpressionException {
    super.init(TestUserMode.SUPER_TENANT_USER);
}
 
Example 18
Source File: AMQPSessionRecoverTestCase.java    From product-ei with Apache License 2.0 2 votes vote down vote up
/**
 * Initializes test case
 *
 * @throws XPathExpressionException on an issue reading XPATH elements in config
 */
@BeforeClass()
public void init() throws XPathExpressionException, MalformedURLException {
    super.init(TestUserMode.SUPER_TENANT_USER);
}
 
Example 19
Source File: DtxCommitNegativeTestCase.java    From product-ei with Apache License 2.0 2 votes vote down vote up
/**
 * Initializing test case
 *
 * @throws XPathExpressionException if the test initialization fails
 */
@BeforeClass
public void prepare() throws XPathExpressionException {
    super.init(TestUserMode.SUPER_TENANT_USER);
}
 
Example 20
Source File: ManySubscribersTestCase.java    From product-ei with Apache License 2.0 2 votes vote down vote up
/**
 * Initialize the test as super tenant user.
 *
 * @throws XPathExpressionException
 */
@BeforeClass(alwaysRun = true)
public void init() throws XPathExpressionException {
    super.init(TestUserMode.SUPER_TENANT_USER);
}