Search in sources :

Example 11 with Script

use of org.wso2.siddhi.core.function.Script in project product-iots by wso2.

the class DeviceManagementAPINegativeTestCase method negativeTests.

@Test(description = "This test case tests the response when the APIs are called with invalid payloads and without" + " required parameters")
public void negativeTests() throws AutomationFrameworkException {
    URL url = Thread.currentThread().getContextClassLoader().getResource("jmeter-scripts" + File.separator + "AndroidDeviceManagementAPI_Negative_Tests.jmx");
    JMeterTest script = new JMeterTest(new File(url.getPath()));
    JMeterTestManager manager = new JMeterTestManager();
    manager.runTest(script);
}
Also used : JMeterTest(org.wso2.carbon.automation.extensions.jmeter.JMeterTest) File(java.io.File) URL(java.net.URL) JMeterTestManager(org.wso2.carbon.automation.extensions.jmeter.JMeterTestManager) JMeterTest(org.wso2.carbon.automation.extensions.jmeter.JMeterTest) Test(org.testng.annotations.Test)

Example 12 with Script

use of org.wso2.siddhi.core.function.Script in project product-iots by wso2.

the class GroupManagementJMeterTestCase method GroupManagementTest.

@Test(description = "This test case tests the Group Management APIs")
public void GroupManagementTest() throws AutomationFrameworkException {
    URL url = Thread.currentThread().getContextClassLoader().getResource("jmeter-scripts" + File.separator + "GroupManagementAPI.jmx");
    JMeterTest script = new JMeterTest(new File(url.getPath()));
    JMeterTestManager manager = new JMeterTestManager();
    log.info("Running group management api test cases using jmeter scripts");
    manager.runTest(script);
}
Also used : JMeterTest(org.wso2.carbon.automation.extensions.jmeter.JMeterTest) File(java.io.File) URL(java.net.URL) JMeterTestManager(org.wso2.carbon.automation.extensions.jmeter.JMeterTestManager) JMeterTest(org.wso2.carbon.automation.extensions.jmeter.JMeterTest) Test(org.testng.annotations.Test)

Example 13 with Script

use of org.wso2.siddhi.core.function.Script in project product-iots by wso2.

the class AppManagerJmeterTestCase method AppManagementTest.

@Test(description = "This test case tests the flow of App Manager mobile-app creation and lifecycle")
public void AppManagementTest() throws AutomationFrameworkException {
    URL url = Thread.currentThread().getContextClassLoader().getResource("jmeter-scripts" + File.separator + "AppManagerTest.jmx");
    JMeterTest script = new JMeterTest(new File(url.getPath()));
    JMeterTestManager manager = new JMeterTestManager();
    log.info("Running app manager mobile creation related test cases using jmeter scripts");
    manager.runTest(script);
}
Also used : JMeterTest(org.wso2.carbon.automation.extensions.jmeter.JMeterTest) File(java.io.File) URL(java.net.URL) JMeterTestManager(org.wso2.carbon.automation.extensions.jmeter.JMeterTestManager) JMeterTest(org.wso2.carbon.automation.extensions.jmeter.JMeterTest) Test(org.testng.annotations.Test)

Example 14 with Script

use of org.wso2.siddhi.core.function.Script in project product-iots by wso2.

the class MobileQSGTestCase method testMobileApp.

@Test(description = "This test case tests whether app-catalogue is created from qsg script", dependsOnMethods = { "executeQSGScript" })
public void testMobileApp() throws Exception {
    RestClient appManagerRestClient = new RestClient(automationContext.getContextUrls().getWebAppURLHttps(), Constants.APPLICATION_JSON, accessTokenString);
    HttpResponse response = appManagerRestClient.get(Constants.QSGManagement.GET_MOBILE_APPS_ENDPONT);
    Assert.assertEquals(response.getResponseCode(), HttpStatus.SC_OK);
    Assert.assertTrue(response.getData().contains("WSO2Con-Android"), "Con-App-Android addition through script is not successful");
}
Also used : RestClient(org.wso2.iot.integration.common.RestClient) HttpResponse(org.wso2.carbon.automation.test.utils.http.client.HttpResponse) Test(org.testng.annotations.Test)

Example 15 with Script

use of org.wso2.siddhi.core.function.Script in project product-iots by wso2.

the class MobileQSGTestCase method testUserRoleCreation.

@Test(description = "This test case tests whether user and roles are created as expected", dependsOnMethods = { "executeQSGScript" })
public void testUserRoleCreation() throws Exception {
    // Two users will be created with the quick start script, check whether those two users are created
    // successfully,
    String url = Constants.UserManagement.USER_ENDPOINT + "/" + username1;
    HttpResponse response = client.get(url);
    Assert.assertEquals(HttpStatus.SC_OK, response.getResponseCode());
    url = Constants.UserManagement.USER_ENDPOINT + "/" + username2;
    response = client.get(url);
    Assert.assertEquals(HttpStatus.SC_OK, response.getResponseCode());
    // A single role will be created with the quick start script, checking whether that role creation happens
    // without problem
    String rolename = "iotMobileUser";
    response = client.get(Constants.RoleManagement.ROLE_MANAGEMENT_END_POINT + "/" + rolename);
    Assert.assertEquals(HttpStatus.SC_OK, response.getResponseCode());
}
Also used : HttpResponse(org.wso2.carbon.automation.test.utils.http.client.HttpResponse) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)11 File (java.io.File)9 URL (java.net.URL)8 JMeterTest (org.wso2.carbon.automation.extensions.jmeter.JMeterTest)8 JMeterTestManager (org.wso2.carbon.automation.extensions.jmeter.JMeterTestManager)8 HttpResponse (org.wso2.carbon.automation.test.utils.http.client.HttpResponse)3 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 ArrayList (java.util.ArrayList)1 ProcessEngineConfigurationImpl (org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl)1 BeansResolverFactory (org.activiti.engine.impl.scripting.BeansResolverFactory)1 ResolverFactory (org.activiti.engine.impl.scripting.ResolverFactory)1 VariableScopeResolverFactory (org.activiti.engine.impl.scripting.VariableScopeResolverFactory)1 BPSGroupManagerFactory (org.wso2.carbon.bpmn.core.integration.BPSGroupManagerFactory)1 BPSUserManagerFactory (org.wso2.carbon.bpmn.core.integration.BPSUserManagerFactory)1 JsonAPIResolverFactory (org.wso2.carbon.bpmn.core.types.datatypes.json.JsonAPIResolverFactory)1 XmlAPIResolverFactory (org.wso2.carbon.bpmn.core.types.datatypes.xml.XmlAPIResolverFactory)1 SSOAgentConfig (org.wso2.carbon.identity.sso.agent.bean.SSOAgentConfig)1 RestClient (org.wso2.iot.integration.common.RestClient)1 Script (org.wso2.siddhi.core.function.Script)1