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);
}
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);
}
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);
}
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");
}
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());
}
Aggregations