diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml
index 46220b8dc..b3ad9b584 100644
--- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml
@@ -49,6 +49,44 @@
api#device-mgt#android#v1.0
+
+ org.jacoco
+ jacoco-maven-plugin
+
+ ${basedir}/target/coverage-reports/jacoco-unit.exec
+
+
+
+ jacoco-initialize
+
+ prepare-agent
+
+
+
+ jacoco-site
+ test
+
+ report
+
+
+ ${basedir}/target/coverage-reports/jacoco-unit.exec
+ ${basedir}/target/coverage-reports/site
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+ file:src/test/resources/log4j.properties
+
+
+ src/test/resources/testng.xml
+
+
+
@@ -262,5 +300,55 @@
javax.ws.rs
javax.ws.rs-api
+
+ org.testng
+ testng
+ test
+
+
+ org.powermock
+ powermock-module-testng
+ test
+
+
+ org.powermock
+ powermock-api-mockito
+ test
+
+
+ com.h2database.wso2
+ h2-database-engine
+ test
+
+
+ org.wso2.carbon
+ org.wso2.carbon.queuing
+ test
+
+
+ org.wso2.carbon
+ org.wso2.carbon.ndatasource.core
+ test
+
+
+ commons-dbcp.wso2
+ commons-dbcp
+ test
+
+
+ commons-pool.wso2
+ commons-pool
+ test
+
+
+ org.wso2.carbon
+ javax.cache.wso2
+ test
+
+
+ javassist
+ javassist
+ test
+
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementAdminServiceTests.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementAdminServiceTests.java
new file mode 100644
index 000000000..9d6ccc9b5
--- /dev/null
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementAdminServiceTests.java
@@ -0,0 +1,312 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+package org.wso2.carbon.mdm.services.android;
+
+import org.mockito.Matchers;
+import org.mockito.MockitoAnnotations;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PowerMockIgnore;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.testng.PowerMockObjectFactory;
+import org.testng.Assert;
+import org.testng.IObjectFactory;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.ObjectFactory;
+import org.testng.annotations.Test;
+import org.wso2.carbon.device.mgt.common.DeviceManagementException;
+import org.wso2.carbon.device.mgt.common.InvalidDeviceException;
+import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
+import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
+import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
+import org.wso2.carbon.mdm.services.android.services.impl.DeviceManagementAdminServiceImpl;
+import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils;
+import org.wso2.carbon.mdm.services.android.utils.TestUtils;
+
+import javax.ws.rs.core.Response;
+
+@PowerMockIgnore({"javax.ws.rs.*"})
+@PrepareForTest(AndroidAPIUtils.class)
+public class DeviceManagementAdminServiceTests {
+
+ private DeviceManagementAdminServiceImpl deviceManagementAdminService;
+
+ @ObjectFactory
+ public IObjectFactory getObjectFactory() {
+ return new PowerMockObjectFactory();
+ }
+
+ @BeforeClass
+ public void init() throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ MockitoAnnotations.initMocks(this);
+ deviceManagementAdminService = new DeviceManagementAdminServiceImpl();
+ }
+
+ private void mockAndroidAPIUtils()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ Activity activity = TestUtils.getActivity();
+ PowerMockito.mockStatic(AndroidAPIUtils.class);
+
+ try {
+ PowerMockito.when(AndroidAPIUtils.class, "getOperationResponse", Matchers.anyList(), Matchers.any(Operation.class))
+ .thenReturn(activity);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Test
+ public void testConfigureDeviceLock()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.configureDeviceLock(TestUtils.getDeviceLockBeanWrapper());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testConfigureDeviceUnlock()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.configureDeviceUnlock(TestUtils.getDeviceIds());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testGetDeviceLocation()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.getDeviceLocation(TestUtils.getDeviceIds());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testRemovePassword()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.removePassword(TestUtils.getDeviceIds());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testConfigureCamera()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.configureCamera(TestUtils.getCamerabeanWrapper());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testGetDeviceInformation()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.getDeviceInformation(TestUtils.getDeviceIds());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testGetDeviceLogcat()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.getDeviceLogcat(TestUtils.getDeviceIds());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testWipeDevice()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.wipeDevice(TestUtils.getDeviceIds());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testWipeData()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.wipeData(TestUtils.getWipeDataBeanWrapper());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testGetApplications()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.getApplications(TestUtils.getDeviceIds());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testRingDevice()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.ringDevice(TestUtils.getDeviceIds());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testRebootDevice()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.rebootDevice(TestUtils.getDeviceIds());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testMuteDevice()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.muteDevice(TestUtils.getDeviceIds());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testInstallApplication()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService
+ .installApplication(TestUtils.getApplicationInstallationBeanWrapper());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testUpdateApplication()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.updateApplication(TestUtils.getApplicationUpdateBeanWrapper());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testUninstallApplicationPublic()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService
+ .uninstallApplication(TestUtils.getApplicationUninstallationBeanWrapperPublic());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testUninstallApplicationWebApp()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService
+ .uninstallApplication(TestUtils.getApplicationUninstallationBeanWrapperWebApp());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testBlacklistApplications()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService
+ .blacklistApplications(TestUtils.getBlacklistApplicationsBeanWrapper());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testUpgradeFirmware()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.upgradeFirmware(TestUtils.getUpgradeFirmwareBeanWrapper());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testConfigureVPN()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.configureVPN(TestUtils.getVpnBeanWrapper());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testSendNotification()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.sendNotification(TestUtils.getNotificationBeanWrapper());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testConfigureWifi()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.configureWifi(TestUtils.getWifiBeanWrapper());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testEncryptStorage()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.encryptStorage(TestUtils.getEncryptionBeanWrapper());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testChangeLockCode()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.changeLockCode(TestUtils.getLockCodeBeanWrapper());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testSetPasswordPolicy()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.setPasswordPolicy(TestUtils.getPasswordPolicyBeanWrapper());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+ @Test
+ public void testSetWebClip()
+ throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
+ mockAndroidAPIUtils();
+ Response response = deviceManagementAdminService.setWebClip(TestUtils.getWebClipBeanWrapper());
+ Assert.assertNotNull(response);
+ Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
+ }
+
+}
+
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/utils/TestUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/utils/TestUtils.java
new file mode 100644
index 000000000..ce348f298
--- /dev/null
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/utils/TestUtils.java
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+package org.wso2.carbon.mdm.services.android.utils;
+
+import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
+import org.wso2.carbon.mdm.services.android.bean.ApplicationInstallation;
+import org.wso2.carbon.mdm.services.android.bean.ApplicationUninstallation;
+import org.wso2.carbon.mdm.services.android.bean.ApplicationUpdate;
+import org.wso2.carbon.mdm.services.android.bean.BlacklistApplications;
+import org.wso2.carbon.mdm.services.android.bean.Camera;
+import org.wso2.carbon.mdm.services.android.bean.DeviceEncryption;
+import org.wso2.carbon.mdm.services.android.bean.DeviceLock;
+import org.wso2.carbon.mdm.services.android.bean.LockCode;
+import org.wso2.carbon.mdm.services.android.bean.Notification;
+import org.wso2.carbon.mdm.services.android.bean.PasscodePolicy;
+import org.wso2.carbon.mdm.services.android.bean.UpgradeFirmware;
+import org.wso2.carbon.mdm.services.android.bean.Vpn;
+import org.wso2.carbon.mdm.services.android.bean.WebClip;
+import org.wso2.carbon.mdm.services.android.bean.Wifi;
+import org.wso2.carbon.mdm.services.android.bean.WipeData;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationInstallationBeanWrapper;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationUninstallationBeanWrapper;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationUpdateBeanWrapper;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.BlacklistApplicationsBeanWrapper;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.CameraBeanWrapper;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.DeviceLockBeanWrapper;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.EncryptionBeanWrapper;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.LockCodeBeanWrapper;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.NotificationBeanWrapper;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.PasswordPolicyBeanWrapper;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.UpgradeFirmwareBeanWrapper;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.VpnBeanWrapper;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.WebClipBeanWrapper;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.WifiBeanWrapper;
+import org.wso2.carbon.mdm.services.android.bean.wrapper.WipeDataBeanWrapper;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class TestUtils {
+
+ public static Activity getActivity() {
+ Activity activity = new Activity();
+ activity.setActivityId("ACTIVITY_1");
+ activity.setCode("CODE");
+ return activity;
+ }
+
+ public static List getDeviceIds() {
+ List deviceIds = new ArrayList<>();
+ deviceIds.add("1a2b3c4d5e");
+ return deviceIds;
+ }
+
+ public static DeviceLockBeanWrapper getDeviceLockBeanWrapper() {
+ DeviceLockBeanWrapper deviceLockBeanWrapper = new DeviceLockBeanWrapper();
+ deviceLockBeanWrapper.setDeviceIDs(getDeviceIds());
+ DeviceLock deviceLockOperation = new DeviceLock();
+ deviceLockOperation.setHardLockEnabled(true);
+ deviceLockOperation.setMessage("Test Operation");
+ deviceLockBeanWrapper.setOperation(deviceLockOperation);
+ return deviceLockBeanWrapper;
+ }
+
+ public static CameraBeanWrapper getCamerabeanWrapper() {
+ CameraBeanWrapper cameraBeanWrapper = new CameraBeanWrapper();
+ cameraBeanWrapper.setDeviceIDs(getDeviceIds());
+ Camera camera = new Camera();
+ camera.setEnabled(false);
+ cameraBeanWrapper.setOperation(camera);
+ return cameraBeanWrapper;
+ }
+
+ public static WipeDataBeanWrapper getWipeDataBeanWrapper() {
+ WipeDataBeanWrapper wipeDataBeanWrapper = new WipeDataBeanWrapper();
+ wipeDataBeanWrapper.setDeviceIDs(getDeviceIds());
+ WipeData wipeData = new WipeData();
+ wipeData.setPin("1234");
+ wipeDataBeanWrapper.setOperation(wipeData);
+ return wipeDataBeanWrapper;
+ }
+
+ public static ApplicationInstallationBeanWrapper getApplicationInstallationBeanWrapper() {
+ ApplicationInstallationBeanWrapper applicationInstallationBeanWrapper = new ApplicationInstallationBeanWrapper();
+ applicationInstallationBeanWrapper.setDeviceIDs(getDeviceIds());
+ ApplicationInstallation applicationInstallation = new ApplicationInstallation();
+ applicationInstallation.setAppIdentifier("org.wso2.iot.agent");
+ applicationInstallation.setUrl("https://github.com/wso2/cdmf-agent-android/releases/download/v3.1.21/client-standalone.apk");
+ applicationInstallation.setType("enterprise");
+ applicationInstallation.setSchedule("2017-10-11T18:46:19-0530");
+ applicationInstallationBeanWrapper.setOperation(applicationInstallation);
+ return applicationInstallationBeanWrapper;
+ }
+
+ public static ApplicationUpdateBeanWrapper getApplicationUpdateBeanWrapper() {
+ ApplicationUpdateBeanWrapper applicationUpdateBeanWrapper = new ApplicationUpdateBeanWrapper();
+ applicationUpdateBeanWrapper.setDeviceIDs(getDeviceIds());
+ ApplicationUpdate applicationUpdate = new ApplicationUpdate();
+ applicationUpdate.setAppIdentifier("org.wso2.iot.agent");
+ applicationUpdate.setUrl("https://github.com/wso2/cdmf-agent-android/releases/download/v3.1.21/client-standalone.apk");
+ applicationUpdate.setType("enterprise");
+ applicationUpdate.setSchedule("2017-10-11T18:46:19-0530");
+ applicationUpdateBeanWrapper.setOperation(applicationUpdate);
+ return applicationUpdateBeanWrapper;
+ }
+
+ public static ApplicationUninstallationBeanWrapper getApplicationUninstallationBeanWrapperPublic() {
+ ApplicationUninstallationBeanWrapper applicationUninstallationBeanWrapper = new ApplicationUninstallationBeanWrapper();
+ applicationUninstallationBeanWrapper.setDeviceIDs(getDeviceIds());
+ ApplicationUninstallation applicationUninstallation = new ApplicationUninstallation();
+ applicationUninstallation.setAppIdentifier("org.wso2.iot.agent");
+ applicationUninstallation.setType("public");
+ applicationUninstallationBeanWrapper.setOperation(applicationUninstallation);
+ return applicationUninstallationBeanWrapper;
+ }
+
+ public static ApplicationUninstallationBeanWrapper getApplicationUninstallationBeanWrapperWebApp() {
+ ApplicationUninstallationBeanWrapper applicationUninstallationBeanWrapper = new ApplicationUninstallationBeanWrapper();
+ applicationUninstallationBeanWrapper.setDeviceIDs(getDeviceIds());
+ ApplicationUninstallation applicationUninstallation = new ApplicationUninstallation();
+ applicationUninstallation.setAppIdentifier("org.wso2.iot.agent");
+ applicationUninstallation.setType("webapp");
+ applicationUninstallationBeanWrapper.setOperation(applicationUninstallation);
+ return applicationUninstallationBeanWrapper;
+ }
+
+ public static BlacklistApplicationsBeanWrapper getBlacklistApplicationsBeanWrapper() {
+ BlacklistApplicationsBeanWrapper blacklistApplicationsBeanWrapper = new BlacklistApplicationsBeanWrapper();
+ blacklistApplicationsBeanWrapper.setDeviceIDs(getDeviceIds());
+ BlacklistApplications blacklistApplications = new BlacklistApplications();
+ List appIds = new ArrayList<>();
+ appIds.add("org.wso2.iot.agent");
+ blacklistApplications.setAppIdentifier(appIds);
+ blacklistApplicationsBeanWrapper.setOperation(blacklistApplications);
+ return blacklistApplicationsBeanWrapper;
+ }
+
+ public static UpgradeFirmwareBeanWrapper getUpgradeFirmwareBeanWrapper() {
+ UpgradeFirmwareBeanWrapper upgradeFirmwareBeanWrapper = new UpgradeFirmwareBeanWrapper();
+ upgradeFirmwareBeanWrapper.setDeviceIDs(getDeviceIds());
+ UpgradeFirmware upgradeFirmware = new UpgradeFirmware();
+ upgradeFirmware.setServer("https://github.com/wso2/cdmf-agent-android/releases/download/");
+ upgradeFirmware.setSchedule("2017-10-11T18:46:19-0530");
+ upgradeFirmwareBeanWrapper.setOperation(upgradeFirmware);
+ return upgradeFirmwareBeanWrapper;
+ }
+
+ public static VpnBeanWrapper getVpnBeanWrapper() {
+ VpnBeanWrapper vpnBeanWrapper = new VpnBeanWrapper();
+ vpnBeanWrapper.setDeviceIDs(getDeviceIds());
+ Vpn vpn = new Vpn();
+ vpnBeanWrapper.setOperation(vpn);
+ return vpnBeanWrapper;
+ }
+
+ public static NotificationBeanWrapper getNotificationBeanWrapper() {
+ NotificationBeanWrapper notificationBeanWrapper = new NotificationBeanWrapper();
+ notificationBeanWrapper.setDeviceIDs(getDeviceIds());
+ Notification notification = new Notification();
+ notification.setMessageText("Message");
+ notification.setMessageTitle("Title");
+ notificationBeanWrapper.setOperation(notification);
+ return notificationBeanWrapper;
+ }
+
+ public static WifiBeanWrapper getWifiBeanWrapper() {
+ WifiBeanWrapper wifiBeanWrapper = new WifiBeanWrapper();
+ wifiBeanWrapper.setDeviceIDs(getDeviceIds());
+ Wifi wifi = new Wifi();
+ wifiBeanWrapper.setOperation(wifi);
+ return wifiBeanWrapper;
+ }
+
+ public static EncryptionBeanWrapper getEncryptionBeanWrapper() {
+ EncryptionBeanWrapper encryptionBeanWrapper = new EncryptionBeanWrapper();
+ encryptionBeanWrapper.setDeviceIDs(getDeviceIds());
+ DeviceEncryption deviceEncryption = new DeviceEncryption();
+ deviceEncryption.setEncrypted(true);
+ encryptionBeanWrapper.setOperation(deviceEncryption);
+ return encryptionBeanWrapper;
+ }
+
+ public static LockCodeBeanWrapper getLockCodeBeanWrapper() {
+ LockCodeBeanWrapper lockCodeBeanWrapper = new LockCodeBeanWrapper();
+ lockCodeBeanWrapper.setDeviceIDs(getDeviceIds());
+ LockCode lockCode = new LockCode();
+ lockCode.setLockCode("1234");
+ lockCodeBeanWrapper.setOperation(lockCode);
+ return lockCodeBeanWrapper;
+ }
+
+ public static PasswordPolicyBeanWrapper getPasswordPolicyBeanWrapper() {
+ PasswordPolicyBeanWrapper passwordPolicyBeanWrapper = new PasswordPolicyBeanWrapper();
+ passwordPolicyBeanWrapper.setDeviceIDs(getDeviceIds());
+ PasscodePolicy passcodePolicy = new PasscodePolicy();
+ passwordPolicyBeanWrapper.setOperation(passcodePolicy);
+ return passwordPolicyBeanWrapper;
+ }
+
+ public static WebClipBeanWrapper getWebClipBeanWrapper() {
+ WebClipBeanWrapper webClipBeanWrapper = new WebClipBeanWrapper();
+ webClipBeanWrapper.setDeviceIDs(getDeviceIds());
+ WebClip webClip = new WebClip();
+ webClipBeanWrapper.setOperation(webClip);
+ return webClipBeanWrapper;
+ }
+
+}
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/log4j.properties b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/log4j.properties
new file mode 100644
index 000000000..90c5d0edc
--- /dev/null
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/log4j.properties
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2017, 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.
+#
+
+#
+# This is the log4j configuration file used by WSO2 Carbon
+#
+# IMPORTANT : Please do not remove or change the names of any
+# of the Appender defined here. The layout pattern & log file
+# can be changed using the WSO2 Carbon Management Console, and those
+# settings will override the settings in this file.
+#
+
+log4j.rootLogger=DEBUG, STD_OUT
+
+# Redirect log messages to console
+log4j.appender.STD_OUT=org.apache.log4j.ConsoleAppender
+log4j.appender.STD_OUT.Target=System.out
+log4j.appender.STD_OUT.layout=org.apache.log4j.PatternLayout
+log4j.appender.STD_OUT.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/testng.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/testng.xml
new file mode 100644
index 000000000..8d8566769
--- /dev/null
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/testng.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/test-coverage/pom.xml b/components/test-coverage/pom.xml
index a4d071ce7..f63abc3df 100644
--- a/components/test-coverage/pom.xml
+++ b/components/test-coverage/pom.xml
@@ -147,6 +147,9 @@
+
+
+
diff --git a/pom.xml b/pom.xml
index 6a76dc5b2..4cd79e7b5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,6 +69,12 @@
io.swagger
swagger-jaxrs
${swagger.version}
+
+
+ org.javassist
+ javassist
+
+
javax.servlet
@@ -251,6 +257,12 @@
org.wso2.carbon.devicemgt
org.wso2.carbon.device.mgt.core
${carbon.devicemgt.version}
+
+
+ javassist
+ javassist
+
+
org.wso2.carbon.devicemgt
@@ -271,6 +283,12 @@
org.wso2.carbon.devicemgt
org.wso2.carbon.policy.mgt.core
${carbon.devicemgt.version}
+
+
+ org.mockito
+ mockito-core
+
+
org.wso2.carbon.devicemgt
@@ -293,6 +311,12 @@
org.wso2.carbon.devicemgt
org.wso2.carbon.device.mgt.analytics.data.publisher
${carbon.devicemgt.version}
+
+
+ jboss
+ javassist
+
+
org.wso2.carbon.devicemgt
@@ -1114,6 +1138,36 @@
${junit.version}
test
+
+ org.powermock
+ powermock-module-testng
+ ${powermock.version}
+ test
+
+
+ org.powermock
+ powermock-api-mockito
+ ${powermock.version}
+ test
+
+
+ org.wso2.carbon
+ org.wso2.carbon.queuing
+ ${carbon.kernel.version}
+ test
+
+
+ commons-dbcp.wso2
+ commons-dbcp
+ ${commons.dbcp.version}
+ test
+
+
+ javassist
+ javassist
+ ${javassist.version}
+ test
+
@@ -1293,6 +1347,9 @@
0.7.8
0.7.5.201505241946
1.0b3
+ 1.4.0.wso2v1
+ 3.12.1.GA
+ 1.7.0