Merge pull request #334 from sinthuja/test-merge

Fixing the integration test framework to work with new packaging structure
application-manager-new
Amal Gunatilake 8 years ago committed by GitHub
commit 2c3fcbc343

@ -32,9 +32,8 @@
<url>http://wso2.org</url>
<modules>
<module>tests-artifacts</module>
<module>tests-common</module>
<!--<module>tests-integration</module>-->
<module>tests-integration</module>
<module>tests-iot-web-ui</module>
</modules>

@ -1,33 +0,0 @@
<!--
~ Copyright (c) 2014, 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
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-integration</artifactId>
<version>3.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>tests-artifacts</artifactId>
<packaging>pom</packaging>
<name>WSO2 IoT - Integration Test Artifacts</name>
</project>

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2014, 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
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>tests-common</artifactId>
<version>3.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.iot.integration.common.clients</artifactId>
<packaging>jar</packaging>
<name>WSO2 IoT - Integration Test Common Admin Clients</name>
</project>

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>tests-common</artifactId>
<version>3.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.iot.integration.common</artifactId>
<packaging>jar</packaging>
<name>WSO2 IoT - Integration Common</name>
<dependencies>
<dependency>
<groupId>org.wso2.carbon.automationutils</groupId>
<artifactId>org.wso2.carbon.integration.common.admin.client</artifactId>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.user.mgt.stub</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging.view.stub</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.ndatasource.stub</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.server.admin.stub</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.throttle.stub</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.tenant.mgt.stub</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.application.mgt.stub</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.security.mgt.stub</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.identity.user.profile.stub</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.identity.user.profile.stub</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.utils</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.automation</groupId>
<artifactId>org.wso2.carbon.automation.extensions</artifactId>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-android-driver</artifactId>
</exclusion>
</exclusions>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.automation</groupId>
<artifactId>org.wso2.carbon.automation.test.utils</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.automation</groupId>
<artifactId>org.wso2.carbon.automation.engine</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.automationutils</groupId>
<artifactId>org.wso2.carbon.integration.common.extensions</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.automationutils</groupId>
<artifactId>org.wso2.carbon.integration.common.utils</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

@ -60,40 +60,35 @@ public final class Constants {
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 API_APP_REGISTRATION_PAYLOAD = dynamicClientPayloadBuffer.append("{ \n"
+ " \"applicationName\":\"app_12345\",\n" + " \"isAllowedToAllDomains\":false,\n"
+ " \"applicationName\":\"app_123456\",\n" + " \"isAllowedToAllDomains\":false,\n"
+ " \"tags\":[\"android\", \"device_management\"],\n" + " \"isMappingAnExistingOAuthApp\":false\n"
+ "}").toString();
public static final String PERMISSION_LIST = "default perm:admin-groups:count perm:admin-groups:view "
+ "perm:admin-users:view perm:admin:certificates:add perm:admin:certificates:delete "
+ "perm:admin:certificates:details perm:admin:certificates:verify perm:admin:certificates:view "
+ "perm:admin:devices:view perm:android:blacklist-applications perm:android:change-lock-code "
+ "perm:android:clear-password perm:android:configure-vpn perm:android:configure-wifi "
+ "perm:android:control-camera perm:android:disenroll perm:android:encrypt-storage "
+ "perm:android:enroll perm:android:enterprise-wipe perm:android:info "
+ "perm:android:install-application perm:android:location perm:android:lock-devices "
+ "perm:android:logcat perm:android:manage-configuration perm:android:mute perm:android:reboot "
+ "perm:android:ring perm:android:send-notification perm:android:set-password-policy "
+ "perm:android:set-webclip perm:android:uninstall-application perm:android:unlock-devices "
+ "perm:android:update-application perm:android:upgrade-firmware perm:android:view-configuration "
+ "perm:android:wipe perm:applications:install perm:applications:uninstall perm:dashboard:by-groups "
+ "perm:dashboard:count-overview perm:dashboard:details perm:dashboard:device-counts "
+ "perm:dashboard:feature-non-compliant perm:dashboard:filtered-count perm:dashboard:non-compliant "
+ "perm:dashboard:non-compliant-count perm:dashboard:vulnerabilities perm:device-types:features "
+ "perm:device-types:types perm:devices:applications perm:devices:compliance-data perm:devices:delete"
+ " perm:devices:details perm:devices:effective-policy perm:devices:features perm:devices:operations "
+ "perm:devices:search perm:devices:update perm:devices:view perm:get-activity perm:groups:add "
+ "perm:groups:assign perm:groups:count perm:groups:device perm:groups:devices "
+ "perm:groups:devices-add perm:groups:devices-count perm:groups:devices-remove perm:groups:groups "
+ "perm:groups:groups-view perm:groups:remove perm:groups:roles perm:groups:share perm:groups:update "
+ "perm:manage-configuration perm:notifications:mark-checked perm:notifications:view "
+ "perm:policies:activate perm:policies:changes perm:policies:deactivate perm:policies:get-details "
+ "perm:policies:get-policy-details perm:policies:manage perm:policies:priorities "
+ "perm:policies:remove perm:policies:update perm:roles:add perm:roles:add-users "
+ "perm:roles:create-combined-role perm:roles:delete perm:roles:details perm:roles:permissions "
+ "perm:roles:update perm:roles:view perm:users:add perm:users:count perm:users:credentials "
+ "perm:users:delete perm:users:details perm:users:is-exist perm:users:roles perm:users:search "
+ "perm:users:send-invitation perm:users:update perm:users:user-details perm:view-configuration "
+ "perm:devices:change-status";
public static final String PERMISSION_LIST = "default perm:admin-groups:count perm:admin-groups:view " +
"perm:admin-users:view perm:admin:certificates:add perm:admin:certificates:delete " +
"perm:admin:certificates:details perm:admin:certificates:verify perm:admin:certificates:view " +
"perm:admin:devices:view perm:android:blacklist-applications perm:android:change-lock-code " +
"perm:android:clear-password perm:android:configure-vpn perm:android:configure-wifi " +
"perm:android:control-camera perm:android:disenroll perm:android:encrypt-storage " +
"perm:android:enroll perm:android:enterprise-wipe perm:android:info perm:android:install-application " +
"perm:android:location perm:android:lock-devices perm:android:logcat perm:android:manage-configuration " +
"perm:android:mute perm:android:reboot perm:android:ring perm:android:send-notification " +
"perm:android:set-password-policy perm:android:set-webclip perm:android:uninstall-application " +
"perm:android:unlock-devices perm:android:update-application perm:android:upgrade-firmware " +
"perm:android:view-configuration perm:android:wipe perm:applications:install perm:applications:uninstall " +
"perm:device-types:features perm:device-types:types perm:devices:applications " +
"perm:devices:compliance-data perm:devices:delete perm:devices:details perm:devices:effective-policy " +
"perm:devices:features perm:devices:operations perm:devices:search perm:devices:update " +
"perm:devices:view perm:get-activity perm:groups:add perm:groups:assign perm:groups:count " +
"perm:groups:device perm:groups:devices perm:groups:devices-add perm:groups:devices-count " +
"perm:groups:devices-remove perm:groups:groups perm:groups:groups-view perm:groups:remove " +
"perm:groups:roles perm:groups:share perm:groups:update perm:manage-configuration " +
"perm:notifications:mark-checked perm:notifications:view perm:policies:activate " +
"perm:policies:changes perm:policies:deactivate perm:policies:get-details perm:policies:get-policy-details " +
"perm:policies:manage perm:policies:priorities perm:policies:remove perm:policies:update perm:roles:add" +
" perm:roles:add-users perm:roles:create-combined-role perm:roles:delete perm:roles:details " +
"perm:roles:permissions perm:roles:update perm:roles:view perm:users:add perm:users:count " +
"perm:users:credentials perm:users:delete perm:users:details perm:users:is-exist perm:users:roles " +
"perm:users:search perm:users:send-invitation perm:users:update perm:users:user-details perm:view-configuration";
private APIApplicationRegistration() {
throw new AssertionError();
@ -137,8 +132,8 @@ public final class Constants {
public static final String WS_STEP_FILE =
"windows" + File.separator + "enrollment" + File.separator + "wstep.xml";
public static final String BSD_PAYLOAD = "{\"credentials\" : {\"username\" : \"admin\", \"email\" : \"admin@wso2.com\", " +
"\"password\" : \"admin\", \"ownership\" : \"BYOD\", " +
"\"token\" : \"cbe53efd46ec612c456540f8dfef5428\"}}";
"\"password\" : \"admin\", \"ownership\" : \"BYOD\", " +
"\"token\" : \"cbe53efd46ec612c456540f8dfef5428\"}}";
private WindowsEnrollment() {
throw new AssertionError();
@ -146,14 +141,14 @@ public final class Constants {
}
public static final class AndroidOperations {
private static final String PAYLOAD_COMMON = "["+DEVICE_ID+"]";
private static final String PAYLOAD_COMMON = "[" + DEVICE_ID + "]";
public static final String OPERATION_PAYLOAD_FILE_NAME = "android-operation-payloads.json";
public static final String OPERATIONS_GROUP = "operations";
public static final String CAMERA_OPERATION = "control-camera";
public static final String CAMERA_OPERATION_PAYLOAD = "{\n" + " \"operation\": {\n"
+ " \"enabled\": false\n" + " },\n" + " \"deviceIDs\": [\n" + " \""+DEVICE_ID+"\" \n"
+ " \"enabled\": false\n" + " },\n" + " \"deviceIDs\": [\n" + " \"" + DEVICE_ID + "\" \n"
+ " ]\n" + "}";
public static final String WIPE_DATA_OPERATION = "wipe_data";
@ -171,7 +166,7 @@ public final class Constants {
public static final String UNLOCK_OPERATION_PAYLOAD = PAYLOAD_COMMON;
public static final String LOCK_ENDPOINT = "lock-devices";
public static final String LOCK_OPERATION_PAYLOAD = "{ \"deviceIDs\": [\""+DEVICE_ID+"\"],"
public static final String LOCK_OPERATION_PAYLOAD = "{ \"deviceIDs\": [\"" + DEVICE_ID + "\"],"
+ "\"operation\": { \"message\": \"string\", \"hardLockEnabled\": false }}";
public static final String LOCATION_ENDPOINT = "location";
@ -181,14 +176,14 @@ public final class Constants {
public static final String CLEAR_PASSWORD_PAYLOAD = PAYLOAD_COMMON;
public static final String DEVICE_INFO_ENDPOINT = "/info";
public static final String DEVICE_INFO_PAYLOAD = "[\""+DEVICE_ID+"\"]";
public static final String DEVICE_INFO_PAYLOAD = "[\"" + DEVICE_ID + "\"]";
public static final String ENTERPRISE_WIPE_ENDPOINT = "enterprise-wipe";
public static final String ENTERPRISE_WIPE_PAYLOAD = PAYLOAD_COMMON;
public static final String WIPE_DATA_ENDPOINT = "wipe";
public static final String WIPE_DATA_PAYLOAD = "{\n" + " \"operation\": {\n" + " \"pin\": \"string\"\n"
+ " },\n" + " \"deviceIDs\": [\n" + " \""+DEVICE_ID+"\"\n" + " ]\n" + "}";
+ " },\n" + " \"deviceIDs\": [\n" + " \"" + DEVICE_ID + "\"\n" + " ]\n" + "}";
public static final String APPLICATION_LIST_ENDPOINT = "applications";
public static final String APPLICATION_LIST_PAYLOAD = PAYLOAD_COMMON;
@ -200,50 +195,51 @@ public final class Constants {
public static final String MUTE_PAYLOAD = PAYLOAD_COMMON;
public static final String INSTALL_APPS_ENDPOINT = "install-application";
public static final String INSTALL_APPS_PAYLOAD = "{\n" + " \"deviceIDs\": [\n" + " \""+DEVICE_ID+"\"\n"
public static final String INSTALL_APPS_PAYLOAD = "{\n" + " \"deviceIDs\": [\n" + " \"" + DEVICE_ID + "\"\n"
+ " ],\n" + " \"operation\": {\n" + " \"appIdentifier\": \"string\",\n"
+ " \"type\": \"string\",\n" + " \"url\": \"string\"\n" + " }\n" + "}";
public static final String UNINSTALL_APPS_ENDPOINT = "uninstall-application";
public static final String UNINSTALL_APPS_PAYLOAD = "{\n" + " \"deviceIDs\": [\n"
+ " \""+DEVICE_ID+"\"\n" + " ],\n" + " \"operation\": {\n"
+ " \"" + DEVICE_ID + "\"\n" + " ],\n" + " \"operation\": {\n"
+ " \"appIdentifier\": \"string\",\n" + " \"type\": \"string\",\n" + " \"url\": \"string\",\n"
+ " \"name\": \"string\"\n" + " }\n" + "}";
public static final String BLACKLIST_APPS_ENDPOINT = "blacklist-applications";
public static final String NOTIFICATION_ENDPOINT = "send-notification";
public static final String NOTIFICATION_PAYLOAD = "{\n" + " \"deviceIDs\": [\n" + " \""+DEVICE_ID+"\"\n"
public static final String NOTIFICATION_PAYLOAD = "{\n" + " \"deviceIDs\": [\n" + " \"" + DEVICE_ID + "\"\n"
+ " ],\n" + " \"operation\": {\n" + " \"messageText\": \"string\",\n"
+ " \"messageTitle\": \"string\"\n" + " }\n" + "}";
public static final String WIFI_ENDPOINT = "configure-wifi";
public static final String WIFI_PAYLOAD = "{\n" + " \"operation\": {\n" + " \"ssid\": \"string\",\n"
+ " \"password\": \"string\"\n" + " },\n" + " \"deviceIDs\": [\n" + " \""+DEVICE_ID+"\"\n"
+ " \"password\": \"string\"\n" + " },\n" + " \"deviceIDs\": [\n" + " \"" + DEVICE_ID + "\"\n"
+ " ]\n" + "}";
public static final String ENCRYPT_ENDPOINT = "encrypt-storage";
public static final String ENCRYPT_PAYLOAD = "{\n" + " \"operation\": {\n" + " \"encrypted\": false\n"
+ " },\n" + " \"deviceIDs\": [\n" + " \""+DEVICE_ID+"\"\n" + " ]\n" + "}";
+ " },\n" + " \"deviceIDs\": [\n" + " \"" + DEVICE_ID + "\"\n" + " ]\n" + "}";
public static final String REBOOT_ENDPOINT = "reboot";
public static final String REBOOT_PAYLOAD = PAYLOAD_COMMON;;
public static final String REBOOT_PAYLOAD = PAYLOAD_COMMON;
;
public static final String CHANGE_LOCK_ENDPOINT = "change-lock-code";
public static final String CHANGE_LOCK_PAYLOAD = "{\n" + " \"operation\": {\n" + " \"lockCode\": \"0000\"\n"
+ " },\n" + " \"deviceIDs\": [\n" + " \""+DEVICE_ID+"\"\n" + " ]\n" + "}\n";
+ " },\n" + " \"deviceIDs\": [\n" + " \"" + DEVICE_ID + "\"\n" + " ]\n" + "}\n";
public static final String PASSWORD_POLICY_ENDPOINT = "set-password-policy";
public static final String PASSWORD_POLICY_PAYLOAD = "{\n" + " \"operation\": {\n"
+ " \"maxFailedAttempts\": 0,\n" + " \"minLength\": 0,\n" + " \"pinHistory\": 0,\n"
+ " \"minComplexChars\": 0,\n" + " \"maxPINAgeInDays\": 0,\n"
+ " \"requireAlphanumeric\": false,\n" + " \"allowSimple\": false\n" + " },\n"
+ " \"deviceIDs\": [\n" + " \""+DEVICE_ID+"\"\n" + " ]\n" + "}";
+ " \"deviceIDs\": [\n" + " \"" + DEVICE_ID + "\"\n" + " ]\n" + "}";
public static final String WEB_CLIP_ENDPOINT = "set-webclip";
public static final String WEB_CLIP_PAYLOAD = "{\n" + " \"operation\": {\n" + " \"identity\": \"string\",\n"
+ " \"title\": \"string\",\n" + " \"type\": \"string\"\n" + " },\n" + " \"deviceIDs\": [\n"
+ " \""+DEVICE_ID+"\"\n" + " ]\n" + "}";
+ " \"" + DEVICE_ID + "\"\n" + " ]\n" + "}";
private AndroidOperations() {
throw new AssertionError();
@ -258,12 +254,12 @@ public final class Constants {
public static final String LICENSE_SECTION = "This";
public static final String LICENSE_ENDPOINT = DEVICE_MGT_ENDPOINT + "license";
public static final String APP_LIST_ENDPOINT = DEVICE_MGT_ENDPOINT + "appList/" +
Constants.DEVICE_ID;
Constants.DEVICE_ID;
public static final String REQUEST_MODIFY_DEVICE_EXPECTED = "{\"responseMessage\":\"Device information " +
"has modified successfully.\"}";
"has modified successfully.\"}";
public static final String APPLIST_PAYLOAD = "{\"id\":\"1\"," +
"\"applicationIdentifier\": \"appid\",\"\"platform\": \"android\"," +
"\"name\": \"testapp\"}";
"\"applicationIdentifier\": \"appid\",\"\"platform\": \"android\"," +
"\"name\": \"testapp\"}";
public static final String RESPONSE_PAYLOAD_FILE_NAME = "android-device-mgt-response-payloads.json";
private AndroidDeviceManagement() {

@ -15,7 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.iot.integration.extensions;
package org.wso2.iot.integration.common.extensions;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@ -15,7 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.iot.integration.extensions;
package org.wso2.iot.integration.common.extensions;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@ -15,7 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.iot.integration.extensions;
package org.wso2.iot.integration.common.extensions;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -26,6 +26,7 @@ import org.wso2.carbon.automation.extensions.ExtensionConstants;
import org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerManager;
import javax.xml.xpath.XPathExpressionException;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@ -54,7 +55,7 @@ public class CustomTestServerManager {
}
public CustomTestServerManager(AutomationContext context, String carbonZip,
Map<String, String> commandMap) {
Map<String, String> commandMap) {
carbonServer = new CarbonServerManager(context);
this.carbonZip = carbonZip;
if (commandMap.get(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND) != null) {
@ -91,24 +92,40 @@ public class CustomTestServerManager {
* TestSuite
* <p/>
* Add the @BeforeSuite TestNG annotation in the method overriding this method
*
* @param server : The server which needs to be start.
* @return The CARBON_HOME
* @throws IOException If an error occurs while copying the deployment artifacts into the
* Carbon server
* Carbon server
*/
public String startServer(String server)
public synchronized String startServer(String server)
throws AutomationFrameworkException, IOException, XPathExpressionException {
if(carbonHome == null) {
if (carbonHome == null) {
if (carbonZip == null) {
carbonZip = System.getProperty(FrameworkConstants.SYSTEM_PROPERTY_CARBON_ZIP_LOCATION);
}
if (carbonZip == null) {
throw new IllegalArgumentException("carbon zip file cannot find in the given location");
}
carbonHome = carbonServer.setUpCarbonHome(carbonZip) + "/" + server;
String extractedDir = getExistingExtractedDir();
if (server.equalsIgnoreCase("core")) {
if (extractedDir == null) {
carbonHome = carbonServer.setUpCarbonHome(carbonZip);
} else {
carbonHome = extractedDir;
}
} else if (server.equalsIgnoreCase("analytics") || server.equalsIgnoreCase("broker")) {
if (extractedDir == null) {
carbonHome = carbonServer.setUpCarbonHome(carbonZip) + File.separator + "wso2" + File.separator + server;
} else {
carbonHome = extractedDir + File.separator + "wso2" + File.separator + server;
}
} else {
throw new IllegalArgumentException("Unsupported server type provided - " + server);
}
configureServer();
}
log.info("Carbon Home - " + carbonHome );
log.info("Carbon Home - " + carbonHome);
if (commandMap.get(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND) != null) {
this.portOffset = Integer.parseInt(commandMap.get(ExtensionConstants.SERVER_STARTUP_PORT_OFFSET_COMMAND));
} else {
@ -118,12 +135,33 @@ public class CustomTestServerManager {
return carbonHome;
}
private String getExistingExtractedDir() {
File zipDir = new File(System.getProperty("basedir", ".") + File.separator + "target");
File[] subFiles = zipDir.listFiles();
if (subFiles != null) {
for (File subFile : subFiles) {
if (subFile.getName().startsWith("carbontmp")) {
File[] carbonServerFiles = subFile.listFiles();
if (carbonServerFiles != null) {
for (File file : carbonServerFiles) {
if (file.getName().startsWith("wso2iot")) {
return file.getAbsolutePath();
}
}
}
}
}
}
return null;
}
/**
* Restarting server already started by the method startServer
*
* @throws AutomationFrameworkException
*/
public void restartGracefully() throws AutomationFrameworkException {
if(carbonHome == null) {
if (carbonHome == null) {
throw new AutomationFrameworkException("No Running Server found to restart. " +
"Please make sure whether server is started");
}
@ -142,6 +180,4 @@ public class CustomTestServerManager {
}
}

@ -15,7 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.iot.integration.extensions;
package org.wso2.iot.integration.common.extensions;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2014, 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
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>tests-common</artifactId>
<version>3.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.iot.integration.common.utils</artifactId>
<packaging>jar</packaging>
<name>WSO2 IoT - Integration Test Common Utils</name>
<licenses>
<license>
<name>Apache License Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
</license>
</licenses>
</project>

@ -31,8 +31,7 @@
<name>WSO2 IoT - Integration Test Common</name>
<modules>
<!--<module>admin-clients</module>-->
<!--<module>integration-test-utils</module>-->
<module>integration-common</module>
<module>web-ui-pages</module>
</modules>

@ -261,10 +261,14 @@
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.iot</groupId>
<artifactId>org.wso2.carbon.iot.integration.common</artifactId>
</dependency>
</dependencies>
<properties>
<skipTests>true</skipTests>
<skipTests>false</skipTests>
</properties>
</project>

@ -189,9 +189,9 @@
<platformExecutionManager>
<extentionClasses>
<class>
<!--<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.iot.integration.common.extensions.BrokerServerExtension</name>-->
<name>org.wso2.iot.integration.common.extensions.IOTServerExtension</name>
<!--<name>org.wso2.iot.integration.common.extensions.AnalyticsServerExtension</name>-->
<name>org.wso2.carbon.integration.common.extensions.usermgt.UserPopulateExtension</name>
</class>
</extentionClasses>

@ -1,33 +0,0 @@
<!--
~ Copyright (c) 2014, 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
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-integration</artifactId>
<version>3.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>tests-platform</artifactId>
<packaging>pom</packaging>
<name>WSO2 IoT - Integration Test Platform</name>
</project>

@ -879,6 +879,11 @@
<artifactId>gson</artifactId>
<version>${google.gson.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.iot</groupId>
<artifactId>org.wso2.carbon.iot.integration.common</artifactId>
<version>${product.iot.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@ -1513,7 +1518,7 @@
<!-- Carbon Device Management -->
<carbon.device.mgt.version>2.0.36</carbon.device.mgt.version>
<carbon.device.mgt.version>2.0.38</carbon.device.mgt.version>
<carbon.device.mgt.version.range>[2.0.0, 3.0.0)</carbon.device.mgt.version.range>
<!-- IOT Device Management -->

Loading…
Cancel
Save