Merge branch 'backend-integration'

# Conflicts:
#	modules/integration/tests-integration-old/src/test/java/org/wso2/mdm/integration/common/MDMHttpClient.java
#	modules/integration/tests-integration-old/src/test/java/org/wso2/mdm/integration/mobileDevice/MobileDeviceManagementWithNoDevices.java
#	modules/integration/tests-integration/src/test/resources/automation.xml
#	modules/integration/tests-integration/src/test/resources/testng.xml
merge-requests/1/head
Menaka Jayawardena 8 years ago
commit 5d41fe313b

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-parent</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-integration</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-integration</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>tests-common</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -27,7 +27,7 @@ public final class Constants {
public static final String DEVICE_ID = "1234";
public static final String NUMBER_NOT_EQUAL_TO_DEVICE_ID = "1111";
public static final String DEVICE_IMEI = "123123123";
public static final String AUTOMATION_CONTEXT = "MDM";
public static final String AUTOMATION_CONTEXT = "IOT";
public static final String APPLICATION_JSON = "application/json";
public static final String APPLICATION_URL_ENCODED = "application/x-www-form-urlencoded";
public static final String OAUTH_CLIENT_ID = "client_id";
@ -46,16 +46,23 @@ public final class Constants {
public static final String ZERO = "0";
public static final String NULL = "[]";
public static final class DynamicClientAuthentication {
public static final String REGISTRATION_ENDPOINT = "/dynamic-client-web/register";
public static final String TOKEN_ENDPOINT = "/oauth2/token";
public static final String OAUTH_TOKEN_PAYLOAD = "grant_type=password&username=admin&password=admin&scope=prod";
public static final String HTTPS = "https";
public static final String HTTP = "http";
public static final int HTTPS_GATEWAY_PORT = 8243;
public static final int HTTP_GATEWAY_PORT = 8280;
public static final class APIApplicationRegistration {
public static final String API_APP_REGISTRATION_ENDPOINT = "/api-application-registration/register";
public static final String TOKEN_ENDPOINT = "/token";
public static final String OAUTH_TOKEN_PAYLOAD = "username=admin&password=admin&grant_type=password&scope=perm:android:enroll perm:android:wipe perm:android:ring perm:android:lock-devices perm:android:configure-vpn perm:android:configure-wifi perm:android:enroll perm:android:uninstall-application perm:android:manage-configuration perm:android:location perm:android:install-application perm:android:mute perm:android:change-lock-code perm:android:blacklist-applications perm:android:set-password-policy perm:android:encrypt-storage perm:android:clear-password perm:android:enterprise-wipe perm:android:info perm:android:view-configuration perm:android:upgrade-firmware perm:android:set-webclip perm:android:send-notification perm:android:disenroll perm:android:update-application perm:android:unlock-devices perm:android:control-camera perm:android:reboot perm:android:logcat appm:subscribe perm:sign-csr perm:admin:devices:view perm:roles:add perm:roles:add-users perm:roles:update perm:roles:permissions perm:roles:details perm:roles:view perm:roles:create-combined-role perm:roles:delete perm:dashboard:vulnerabilities perm:dashboard:non-compliant-count perm:dashboard:non-compliant perm:dashboard:by-groups perm:dashboard:device-counts perm:dashboard:feature-non-compliant perm:dashboard:count-overview perm:dashboard:filtered-count perm:dashboard:details perm:get-activity perm:devices:delete perm:devices:applications perm:devices:effective-policy perm:devices:compliance-data perm:devices:features perm:devices:operations perm:devices:search perm:devices:details perm:devices:update perm:devices:view perm:view-configuration perm:manage-configuration perm:policies:remove perm:policies:priorities perm:policies:deactivate perm:policies:get-policy-details perm:policies:manage perm:policies:activate perm:policies:update perm:policies:changes perm:policies:get-details perm:users:add perm:users:details perm:users:count perm:users:delete perm:users:roles perm:users:user-details perm:users:credentials perm:users:search perm:users:is-exist perm:users:update perm:users:send-invitation perm:admin-users:view perm:groups:devices perm:groups:update perm:groups:add perm:groups:device perm:groups:devices-count perm:groups:remove perm:groups:groups perm:groups:groups-view perm:groups:share perm:groups:count perm:groups:roles perm:groups:devices-remove perm:groups:devices-add perm:groups:assign perm:device-types:features perm:device-types:types perm:applications:install perm:applications:uninstall perm:admin-groups:count perm:admin-groups:view perm:notifications:mark-checked perm:notifications:view perm:admin:certificates:delete perm:admin:certificates:details perm:admin:certificates:view perm:admin:certificates:add perm:admin:certificates:verify perm:ios:enroll perm:ios:view-device perm:ios:apn perm:ios:ldap perm:ios:enterprise-app perm:ios:store-application perm:ios:remove-application perm:ios:app-list perm:ios:profile-list perm:ios:lock perm:ios:enterprise-wipe perm:ios:device-info perm:ios:restriction perm:ios:email perm:ios:cellular perm:ios:applications perm:ios:wifi perm:ios:ring perm:ios:location perm:ios:notification perm:ios:airplay perm:ios:caldav perm:ios:cal-subscription perm:ios:passcode-policy perm:ios:webclip perm:ios:vpn perm:ios:per-app-vpn perm:ios:app-to-per-app-vpn perm:ios:app-lock perm:ios:clear-passcode perm:ios:remove-profile perm:ios:get-restrictions perm:ios:wipe-data perm:admin";
private static StringBuffer dynamicClientPayloadBuffer = new StringBuffer();
public static final String DYNAMIC_CLIENT_REGISTRATION_PAYLOAD = dynamicClientPayloadBuffer.append("{\"clientName\":").
append(" \"device\",\"owner\": \"admin\",\"grantType\": \"password\",\"callbackUrl\": \"www.google.lk\"," +
"\"saasApp\": \"" + true + "\"}").toString();
public static final String API_APP_REGISTRATION_PAYLOAD = dynamicClientPayloadBuffer.append("{ \n"
+ " \"applicationName\":\"app_12345\",\n" + " \"isAllowedToAllDomains\":false,\n"
+ " \"tags\":[\"android\", \"device_management\"],\n" + " \"isMappingAnExistingOAuthApp\":false\n"
+ "}").toString();
private DynamicClientAuthentication() {
private APIApplicationRegistration() {
throw new AssertionError();
}
}
@ -63,7 +70,7 @@ public final class Constants {
public static final class AndroidEnrollment {
public static final String ENROLLMENT_PAYLOAD_FILE_NAME = "android-enrollment-payloads.json";
public static final String ENROLLMENT_RESPONSE_PAYLOAD_FILE_NAME = "android-enrollment-response-payloads.json";
public static final String ENROLLMENT_ENDPOINT = "/mdm-android-agent/enrollment/";
public static final String ENROLLMENT_ENDPOINT = "/api/device-mgt/android/v1.0/devices";
public static final String ENROLLMENT_GROUP = "android-enrollment";
private AndroidEnrollment() {
@ -189,7 +196,7 @@ public final class Constants {
public static final class MobileDeviceManagement {
public static final String MOBILE_DEVICE_MANAGEMENT_GROUP = "mobile-device-mgt";
public static final String GET_DEVICE_COUNT_ENDPOINT = "/mdm-admin/devices/count";
public static final String GET_DEVICE_COUNT_ENDPOINT = "/api/device-mgt/v1.0/devices";
public static final String NO_OF_DEVICES = "1";
public static final String GET_ALL_DEVICES_ENDPOINT = "/mdm-admin/devices";
public static final String VIEW_DEVICE_TYPES_ENDPOINT = "/mdm-admin/devices/types";

@ -15,7 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.mdm.integration.common;
package org.wso2.iot.integration.common;
import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
@ -27,42 +27,39 @@ import org.apache.commons.httpclient.protocol.Protocol;
import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.automation.engine.context.AutomationContext;
import org.wso2.carbon.automation.engine.context.TestUserMode;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
* This class creates a customised Http Client Class
*/
public class MDMHttpClient {
public class IOTHttpClient {
private static final String AUTHORIZATION = "Authorization";
private static Log log = LogFactory.getLog(MDMHttpClient.class);
private static Log log = LogFactory.getLog(IOTHttpClient.class);
private String backEndUrl;
private String authrizationString;
private String authorizationString;
private Map<String, String> requestHeaders = new HashMap<String, String>();
public MDMHttpClient(String backEndUrl, String contentType, String authorization) {
public IOTHttpClient(String backEndUrl, String contentType, String authorization) {
this.backEndUrl = backEndUrl;
this.requestHeaders.put(Constants.CONTENT_TYPE, contentType);
if (authorization != null || !authorization.isEmpty()) {
this.authrizationString = authorization;
this.authorizationString = authorization;
this.requestHeaders.put(AUTHORIZATION, authorization);
}
}
public String getAuthrizationString() {
return authrizationString;
public String getAuthorizationString() {
return authorizationString;
}
public void setAuthrizationString(String authrizationString) {
this.authrizationString = authrizationString;
public void setAuthorizationString(String authorizationString) {
this.authorizationString = authorizationString;
}
public void setHttpHeader(String headerName, String value) {
@ -77,108 +74,108 @@ public class MDMHttpClient {
this.requestHeaders.remove(headerName);
}
public MDMResponse post(String endpoint, String body) {
public IOTResponse post(String endpoint, String body) {
HttpClient client = new HttpClient();
try {
ProtocolSocketFactory socketFactory = new EasySSLProtocolSocketFactory();
Protocol https = new Protocol("https", socketFactory, 9443);
Protocol.registerProtocol("https", https);
Protocol https = new Protocol(Constants.HTTPS, socketFactory, Constants.HTTPS_GATEWAY_PORT);
Protocol.registerProtocol(Constants.HTTPS, https);
String url = backEndUrl + endpoint;
PostMethod method = new PostMethod(url);
method.setRequestHeader(AUTHORIZATION, authrizationString);
method.setRequestHeader(AUTHORIZATION, authorizationString);
StringRequestEntity requestEntity = new StringRequestEntity(body,
requestHeaders.get(Constants.CONTENT_TYPE), Constants.UTF8);
method.setRequestEntity(requestEntity);
MDMResponse mdmResponse = new MDMResponse();
mdmResponse.setStatus(client.executeMethod(method));
mdmResponse.setBody(method.getResponseBodyAsString());
return mdmResponse;
IOTResponse iotResponse = new IOTResponse();
iotResponse.setStatus(client.executeMethod(method));
iotResponse.setBody(method.getResponseBodyAsString());
return iotResponse;
} catch (GeneralSecurityException e) {
log.error("Failure occurred at MDMResponse post for GeneralSecurityException", e);
log.error("Failure occurred at IOTResponse post for GeneralSecurityException", e);
} catch (IOException e) {
log.error("Failure occured at MDMResponse post for IOException", e);
log.error("Failure occurred at IOTResponse post for IOException", e);
}
return null;
}
public MDMResponse put(String endpoint, String body) {
public IOTResponse put(String endpoint, String body) {
HttpClient client = new HttpClient();
try {
ProtocolSocketFactory socketFactory = new EasySSLProtocolSocketFactory();
Protocol https = new Protocol("https", socketFactory, 9443);
Protocol.registerProtocol("https", https);
Protocol https = new Protocol(Constants.HTTPS, socketFactory, Constants.HTTPS_GATEWAY_PORT);
Protocol.registerProtocol(Constants.HTTPS, https);
String url = backEndUrl + endpoint;
PutMethod method = new PutMethod(url);
method.setRequestHeader(AUTHORIZATION, authrizationString);
method.setRequestHeader(AUTHORIZATION, authorizationString);
StringRequestEntity requestEntity = new StringRequestEntity(
body, requestHeaders.get(Constants.CONTENT_TYPE), Constants.UTF8);
method.setRequestEntity(requestEntity);
MDMResponse mdmResponse = new MDMResponse();
mdmResponse.setStatus(client.executeMethod(method));
mdmResponse.setBody(method.getResponseBodyAsString());
return mdmResponse;
IOTResponse iotResponse = new IOTResponse();
iotResponse.setStatus(client.executeMethod(method));
iotResponse.setBody(method.getResponseBodyAsString());
return iotResponse;
} catch (GeneralSecurityException e) {
log.error("Failure occurred at MDMResponse put for GeneralSecurityException", e);
log.error("Failure occurred at IOTResponse put for GeneralSecurityException", e);
} catch (IOException e) {
log.error("Failure occurred at MDMResponse put for IO Exception", e);
log.error("Failure occurred at IOTResponse put for IO Exception", e);
}
return null;
}
public MDMResponse get(String endpoint) {
public IOTResponse get(String endpoint) {
HttpClient client = new HttpClient();
try {
ProtocolSocketFactory socketFactory = new EasySSLProtocolSocketFactory();
Protocol https = new Protocol("https", socketFactory, 9443);
Protocol.registerProtocol("https", https);
Protocol https = new Protocol(Constants.HTTPS, socketFactory, Constants.HTTPS_GATEWAY_PORT);
Protocol.registerProtocol(Constants.HTTPS, https);
String url = backEndUrl + endpoint;
GetMethod method = new GetMethod(url);
method.setRequestHeader(AUTHORIZATION, authrizationString);
method.setRequestHeader(AUTHORIZATION, authorizationString);
method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
new DefaultHttpMethodRetryHandler(3, false));
MDMResponse mdmResponse = new MDMResponse();
mdmResponse.setStatus(client.executeMethod(method));
mdmResponse.setBody(new String(method.getResponseBody()));
return mdmResponse;
IOTResponse iotResponse = new IOTResponse();
iotResponse.setStatus(client.executeMethod(method));
iotResponse.setBody(new String(method.getResponseBody()));
return iotResponse;
} catch (GeneralSecurityException e) {
log.error("Failure occurred at MDMResponse get for GeneralSecurityException", e);
log.error("Failure occurred at IOTResponse get for GeneralSecurityException", e);
} catch (IOException e) {
log.error("Failure occurred at MDMResponse get for IOException", e);
log.error("Failure occurred at IOTResponse get for IOException", e);
}
return null;
}
public MDMResponse delete(String endpoint) {
public IOTResponse delete(String endpoint) {
HttpClient client = new HttpClient();
try {
ProtocolSocketFactory socketFactory = new EasySSLProtocolSocketFactory();
Protocol https = new Protocol("https", socketFactory, 9443);
Protocol.registerProtocol("https", https);
Protocol https = new Protocol(Constants.HTTPS, socketFactory, Constants.HTTPS_GATEWAY_PORT);
Protocol.registerProtocol(Constants.HTTPS, https);
String url = backEndUrl + endpoint;
DeleteMethod method = new DeleteMethod(url);
method.setRequestHeader(AUTHORIZATION, authrizationString);
method.setRequestHeader(AUTHORIZATION, authorizationString);
method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
new DefaultHttpMethodRetryHandler(3, false));
MDMResponse mdmResponse = new MDMResponse();
mdmResponse.setStatus(client.executeMethod(method));
mdmResponse.setBody(method.getResponseBodyAsString());
return mdmResponse;
IOTResponse iotResponse = new IOTResponse();
iotResponse.setStatus(client.executeMethod(method));
iotResponse.setBody(method.getResponseBodyAsString());
return iotResponse;
} catch (GeneralSecurityException e) {
log.error("Failure occurred at MDMResponse delete for GeneralSecurityException", e);
log.error("Failure occurred at IOTResponse delete for GeneralSecurityException", e);
} catch (IOException e) {
log.error("Failure occurred at MDMResponse delete for IOException", e);
log.error("Failure occurred at IOTResponse delete for IOException", e);
}
return null;
}

@ -30,8 +30,9 @@ public class OAuthUtil {
public static String getOAuthToken(String backendHTTPURL, String backendHTTPSURL)
throws Exception {
RestClient client = new RestClient(backendHTTPURL, Constants.APPLICATION_JSON);
HttpResponse oAuthData = client.post(Constants.DynamicClientAuthentication.REGISTRATION_ENDPOINT,
Constants.DynamicClientAuthentication.DYNAMIC_CLIENT_REGISTRATION_PAYLOAD);
client.setHttpHeader("Authorization", "Basic YWRtaW46YWRtaW4=");
HttpResponse oAuthData = client.post(Constants.APIApplicationRegistration.API_APP_REGISTRATION_ENDPOINT,
Constants.APIApplicationRegistration.API_APP_REGISTRATION_PAYLOAD);
JSONObject jsonObj = new JSONObject(oAuthData.getData());
String clientId = jsonObj.get(Constants.OAUTH_CLIENT_ID).toString();
String clientSecret = jsonObj.get(Constants.OAUTH_CLIENT_SECRET).toString();
@ -39,8 +40,9 @@ public class OAuthUtil {
String basicAuthString = "Basic " + new String(bytesEncoded);
//Initiate a RestClient to get OAuth token
client = new RestClient(backendHTTPSURL, Constants.APPLICATION_URL_ENCODED, basicAuthString);
oAuthData = client.post(Constants.DynamicClientAuthentication.TOKEN_ENDPOINT,
Constants.DynamicClientAuthentication.OAUTH_TOKEN_PAYLOAD);
oAuthData = client.post(Constants.APIApplicationRegistration.TOKEN_ENDPOINT,
Constants.APIApplicationRegistration.OAUTH_TOKEN_PAYLOAD);
System.out.println(oAuthData.getData());
jsonObj = new JSONObject(oAuthData.getData());
return jsonObj.get(Constants.OAUTH_ACCESS_TOKEN).toString();
}

@ -35,7 +35,7 @@ public class PayloadGenerator {
public static JsonObject getJsonPayload(String fileName, String method)
throws FileNotFoundException {
URL url = Thread.currentThread().getContextClassLoader().getResource(PAYLOAD_LOCATION + fileName);
URL url = PayloadGenerator.class.getClassLoader().getResource(PAYLOAD_LOCATION + fileName);
JsonObject jsonObject = parser.parse(new FileReader(url.getPath())).getAsJsonObject();
return jsonObject.get(method).getAsJsonObject();
}

@ -19,6 +19,7 @@ package org.wso2.mdm.integration.common;
import org.wso2.carbon.automation.engine.context.AutomationContext;
import org.wso2.carbon.automation.engine.context.TestUserMode;
import org.wso2.carbon.automation.engine.frameworkutils.CodeCoverageUtils;
import org.wso2.carbon.automation.engine.frameworkutils.FrameworkPathUtil;
import org.wso2.carbon.integration.common.utils.LoginLogoutClient;
@ -35,8 +36,10 @@ public class TestBase {
protected void init(TestUserMode userMode) throws Exception {
automationContext = new AutomationContext(Constants.AUTOMATION_CONTEXT, userMode);
backendHTTPSURL = automationContext.getContextUrls().getWebAppURLHttps();
backendHTTPURL = automationContext.getContextUrls().getWebAppURL();
backendHTTPSURL = automationContext.getContextUrls().getWebAppURLHttps().replace("9443", String.valueOf(Constants
.HTTPS_GATEWAY_PORT));
backendHTTPURL = automationContext.getContextUrls().getWebAppURL().replace("9763", String.valueOf(Constants
.HTTP_GATEWAY_PORT));
}
protected void initPublisher(String productGroupName, String instanceName,
@ -55,7 +58,7 @@ public class TestBase {
}
protected String getBackendHTTPSURL() throws XPathExpressionException {
return automationContext.getContextUrls().getBackEndUrl();
return backendHTTPSURL;
}
protected String getSessionCookie() throws Exception {

@ -42,15 +42,12 @@ public class AndroidEnrollment extends TestBase {
@Test(description = "Test an Android device enrollment.")
public void testEnrollment() throws Exception {
JsonObject enrollmentData = PayloadGenerator.getJsonPayload(
Constants.AndroidEnrollment.ENROLLMENT_PAYLOAD_FILE_NAME,
Constants.HTTP_METHOD_POST);
enrollmentData.addProperty(Constants.DEVICE_IDENTIFIER_KEY, Constants.DEVICE_ID);
HttpResponse response = client.post(Constants.AndroidEnrollment.ENROLLMENT_ENDPOINT, enrollmentData.toString());
String enrollmentData = PayloadGenerator.getJsonPayloadToString(Constants.AndroidEnrollment
.ENROLLMENT_PAYLOAD_FILE_NAME);
HttpResponse response = client.post(Constants.AndroidEnrollment.ENROLLMENT_ENDPOINT, enrollmentData);
Assert.assertEquals(HttpStatus.SC_OK, response.getResponseCode());
AssertUtil.jsonPayloadCompare(PayloadGenerator.getJsonPayload(
Constants.AndroidEnrollment.ENROLLMENT_RESPONSE_PAYLOAD_FILE_NAME,
Constants.HTTP_METHOD_POST).toString(), response.getData().toString(), true);
AssertUtil.jsonPayloadCompare(PayloadGenerator.getJsonPayloadToString(
Constants.AndroidEnrollment.ENROLLMENT_RESPONSE_PAYLOAD_FILE_NAME), response.getData(), true);
}
@Test(description = "Test an Android device is enrolled.", dependsOnMethods = {"testEnrollment"})
@ -59,7 +56,7 @@ public class AndroidEnrollment extends TestBase {
Assert.assertEquals(HttpStatus.SC_OK, response.getResponseCode());
AssertUtil.jsonPayloadCompare(PayloadGenerator.getJsonPayload(
Constants.AndroidEnrollment.ENROLLMENT_RESPONSE_PAYLOAD_FILE_NAME,
Constants.HTTP_METHOD_GET).toString(), response.getData().toString(), true);
Constants.HTTP_METHOD_GET).toString(), response.getData(), true);
}
@Test(description = "Test modify enrollment.", dependsOnMethods = {"testIsEnrolled"})
@ -72,7 +69,7 @@ public class AndroidEnrollment extends TestBase {
enrollmentData.toString());
AssertUtil.jsonPayloadCompare(PayloadGenerator.getJsonPayload(
Constants.AndroidEnrollment.ENROLLMENT_RESPONSE_PAYLOAD_FILE_NAME,
Constants.HTTP_METHOD_PUT).toString(), response.getData().toString(), true);
Constants.HTTP_METHOD_PUT).toString(), response.getData(), true);
}
@Test(description = "Test disenrollment.", dependsOnMethods = {"testModifyEnrollment"})
@ -82,6 +79,6 @@ public class AndroidEnrollment extends TestBase {
AssertUtil.jsonPayloadCompare(PayloadGenerator.getJsonPayload(
Constants.AndroidEnrollment.ENROLLMENT_RESPONSE_PAYLOAD_FILE_NAME,
Constants.HTTP_METHOD_DELETE).toString(),
response.getData().toString(), true);
response.getData(), true);
}
}

@ -1,45 +1,92 @@
{
"POST": {
"name": "milan",
"type": "android",
"description": "milan123",
"deviceIdentifier": "1234",
"enrolmentInfo": {
"ownership": "BYOD",
"status": "ACTIVE",
"owner": "admin"
"id": 101234,
"name": "androiddevice1234",
"type": "android",
"description": "this is an android device",
"deviceIdentifier": "d24f870f390352a41234",
"enrolmentInfo": {
"id": 101234,
"device": {
},
"properties": [
{
"name": "IMEI",
"value": "123123123"
},
{
"name": "IMSI",
"value": "123123123"
}
]
"dateOfEnrolment": 0,
"dateOfLastUpdate": 0,
"ownership": "BYOD",
"status": "CREATED",
"owner": "admin"
},
"PUT": {
"name": "milan123",
"type": "android",
"description": "updatedDescription",
"deviceIdentifier": "1234",
"enrolmentInfo": {
"ownership": "BYOD",
"status": "ACTIVE",
"owner": "admin",
"dateOfEnrolment": "1445438864650"
"features": [
{
"id": 10,
"code": "aaaa1111",
"name": "newfeature1",
"description": "this is the new feature 1",
"deviceType": "android",
"metadataEntries": [
{
"id": 10,
"value": {
}
}
]
}
],
"properties": [
{
"name": "property1",
"value": "value1"
}
],
"deviceInfo": {
"deviceModel": "S8",
"vendor": "SAMSUNG",
"osVersion": "5.1",
"batteryLevel": 1,
"internalTotalMemory": 32,
"internalAvailableMemory": 24,
"externalTotalMemory": 64,
"externalAvailableMemory": 60,
"operator": "dialog",
"connectionType": "GSM",
"mobileSignalStrength": 1,
"ssid": "picassowifi",
"cpuUsage": 0,
"totalRAMMemory": 2,
"availableRAMMemory": 1,
"pluggedIn": false,
"location": {
"deviceId": 0,
"deviceIdentifier": {
"id": "string",
"type": "string"
},
"latitude": 0,
"longitude": 0,
"street1": "string",
"street2": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"properties": [
{
"name": "IMEI",
"value": "123123123"
"deviceDetailsMap": {
},
"imei": "string",
"imsi": "string"
},
"applications": [
{
"id": 0,
"platform": "string",
"category": "string",
"name": "string",
"locationUrl": "string",
"imageUrl": "string",
"version": "string",
"type": "string",
"appProperties": {
},
{
"name": "IMSI",
"value": "123123123"
}
]
}
"applicationIdentifier": "string",
"memoryUsage": 0
}
]
}

@ -1,18 +1,4 @@
{
"POST": {
"responseCode": "Created",
"responseMessage": "Device enrollment succeeded."
},
"PUT": {
"responseCode": "Accepted",
"responseMessage": "Device enrollment has updated successfully"
},
"GET": {
"responseCode": "Accepted",
"responseMessage": "Device has already enrolled"
},
"DELETE": {
"responseCode": "Accepted",
"responseMessage": "Device has removed successfully"
}
"responseCode": "OK",
"responseMessage": "Android device, which carries the id \u0027d24f870f390352a41\u0027 has successfully been enrolled"
}

@ -0,0 +1,4 @@
package org.wso2.iot.integration.util;
public class ServerRestart {
}

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
@ -16,8 +16,7 @@
~ specific language governing permissions and limitations
~ under the License.
-->
<automation xmlns="automationSchema.xsd">
<automation xmlns="automationXMLSchema.xsd">
<!-- ================================================= -->
<!-- Parameters -->
<!-- ================================================= -->
@ -25,15 +24,11 @@
<!--
Change this to edit wait time for test artifact deployment
-->
<deploymentDelay>60000</deploymentDelay>
<deploymentDelay>300000</deploymentDelay>
<!--
Change this to product|platform/cloud to execute test on specific environment
Change this to standalone|platform|all to execute test on specific environment
-->
<executionEnvironment>standalone</executionEnvironment>
<!--
Change this to user/tenant to execute test with user mode or tenant mode
-->
<multiTenantMode>false</multiTenantMode>
<!--
Change this to true if you want to generate coverage statistics
-->
@ -50,7 +45,7 @@
<selenium>
<!-- Change to enable remote webDriver -->
<!-- URL of remote webDriver server -->
<remoteDriverUrl enable="true">http://10.100.2.51:4444/wd/hub/</remoteDriverUrl>
<remoteDriverUrl enable="false">http://10.100.2.51:4444/wd/hub/</remoteDriverUrl>
<!-- Type of the browser selenium tests are running" -->
<browser>
@ -169,39 +164,35 @@
<!--
cluster instance details to be used to platform test execution
-->
<productGroup name="MDM" clusteringEnabled="false" default="true">
<productGroup name="IOT" clusteringEnabled="false" default="true">
<instance name="mdm" type="standalone" nonBlockingTransportEnabled="false">
<instance name="iot001" type="standalone" nonBlockingTransportEnabled="false">
<hosts>
<host type="default">localhost</host>
</hosts>
<ports>
<port type="http">10863</port>
<port type="https">10543</port>
<port type="http">9763</port>
<!--<port type="https">9446</port>-->
<port type="https">9443</port>
<!--<port type="https">9445</port>-->
</ports>
<properties>
<properties>
<!--<property name="webContext">admin</property>-->
</properties>
</instance>
</productGroup>
</platform>
<listenerExtensions>
<!--<className>org.wso2.carbon.automation.extentions.servers.wso2server.Wso2ServerExtention</className>-->
<platformExecutionManager>
<extentionClasses>
<class>
<name>
org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerExtension
</name>
<parameter name="-DportOffset" value="1100"/>
<!--<parameter name="cmdArg" value="debug 5005" />-->
</class>
<class>
<name>
org.wso2.carbon.integration.common.extensions.usermgt.UserPopulateExtension
</name>
<!--<name>org.wso2.iot.integration.extensions.BrokerServerExtension</name>-->
<name>org.wso2.iot.integration.extensions.IOTServerExtension</name>
<!--<name>org.wso2.iot.integration.extensions.AnalyticsServerExtension</name>-->
<name>org.wso2.carbon.integration.common.extensions.usermgt.UserPopulateExtension</name>
</class>
</extentionClasses>
</platformExecutionManager>
@ -209,13 +200,13 @@
<PlatformSuiteManager>
<extentionClasses>
<!--<className>org.wso2.carbon.automation.extentions.servers.wso2server.Wso2ServerExtention</className>-->
<!--<className>org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerExtension</className>-->
</extentionClasses>
</PlatformSuiteManager>
<PlatformAnnotationTransferManager>
<extentionClasses>
<!--<className>org.wso2.carbon.automation.extentions.servers.wso2server.Wso2ServerExtention</className>-->
<!--<className>org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerExtension</className>-->
</extentionClasses>
</PlatformAnnotationTransferManager>

@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
@ -18,21 +18,95 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="DssTestSuite" parallel="false">
<suite name="mdm-suite-initializer">
<parameter name="useDefaultListeners" value="false"/>
<listeners>
<listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestExecutionListener"/>
<listener
class-name="org.wso2.carbon.automation.engine.testlisteners.TestExecutionListener"/>
<listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestManagerListener"/>
<listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestReportListener"/>
<listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestSuiteListener"/>
<listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestTransformerListener"/>
<listener
class-name="org.wso2.carbon.automation.engine.testlisteners.TestTransformerListener"/>
</listeners>
<test name="IOT-Integration-Test" parallel="false" verbose="2">
<test name="mobile-device-mgt-no-devices" preserve-order="true" parallel="false">
<classes>
<class name="org.wso2.iot.integration.mobileDevice.MobileDeviceManagementWithNoDevices"/>
</classes>
</test>
<test name="android-enrollment" preserve-order="true" parallel="false">
<classes>
<class name="org.wso2.iot.integration.device.enrollment.AndroidEnrollment"/>
</classes>
</test>
</suite>
<!--<test name="android-operation" preserve-order="false" parallel="true">-->
<!--<classes>-->
<!--<class name="org.wso2.iot.integration.device.operation.AndroidOperation"/>-->
<!--</classes>-->
<!--</test>-->
<!--<test name="windows-enrollment" preserve-order="true" parallel="false">-->
<!--<classes>-->
<!--<class name="org.wso2.iot.integration.device.enrollment.WindowsEnrollment"/>-->
<!--</classes>-->
<!--</test>-->
<!--<test name="android-device-mgt" preserve-order="false" parallel="true">-->
<!--<classes>-->
<!--<class name="org.wso2.iot.integration.device.mgt.AndroidDeviceManagement"/>-->
<!--</classes>-->
<!--</test>-->
<!--<test name="android-configuration" preserve-order="true" parallel="false">-->
<!--<classes>-->
<!--<class name="org.wso2.iot.integration.device.configuration.AndroidConfigurationManagement"/>-->
<!--</classes>-->
<!--</test>-->
<!--<test name="android-policy" preserve-order="true" parallel="false">-->
<!--<classes>-->
<!--<class name="org.wso2.iot.integration.device.policy.AndroidPolicy"/>-->
<!--</classes>-->
<!--</test>-->
<!--<test name="operation-mgt" preserve-order="true" parallel="false">-->
<!--<classes>-->
<!--<class name="org.wso2.iot.integration.operation.OperationManagement"/>-->
<!--</classes>-->
<!--</test>-->
<!--<test name="mobile-device-mgt" preserve-order="true" parallel="false">-->
<!--<classes>-->
<!--<class name="org.wso2.iot.integration.mobileDevice.MobileDeviceManagement"/>-->
<!--</classes>-->
<!--</test>-->
<!--<test name="user-mgt" preserve-order="true" parallel="false">-->
<!--<classes>-->
<!--<class name="org.wso2.iot.integration.user.UserManagement"/>-->
<!--</classes>-->
<!--</test>-->
<!--<test name="role-mgt" preserve-order="true" parallel="false">-->
<!--<classes>-->
<!--<class name="org.wso2.iot.integration.role.RoleManagement"/>-->
<!--</classes>-->
<!--</test>-->
<!--<test name="policy-mgt" preserve-order="true" parallel="false">-->
<!--<classes>-->
<!--<class name="org.wso2.iot.integration.policy.PolicyManagement"/>-->
<!--</classes>-->
<!--</test>-->
<!--<test name="feature-mgt" preserve-order="true" parallel="false">-->
<!--<classes>-->
<!--<class name="org.wso2.iot.integration.feature.FeatureManagement"/>-->
<!--</classes>-->
<!--</test>-->
<!--<test name="license-mgt" preserve-order="true" parallel="false">-->
<!--<classes>-->
<!--<class name="org.wso2.iot.integration.license.LicenseManagement"/>-->
<!--</classes>-->
<!--</test>-->
<!--<test name="configuration-mgt" preserve-order="true" parallel="false">-->
<!--<classes>-->
<!--<class name="org.wso2.iot.integration.configuration.ConfigurationManagement"/>-->
<!--</classes>-->
<!--</test>-->
<!--<test name="notification-mgt" preserve-order="true" parallel="false">-->
<!--<classes>-->
<!--<class name="org.wso2.iot.integration.notification.NotificationManagement"/>-->
<!--</classes>-->
<!--</test>-->
</suite>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-integration</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Loading…
Cancel
Save