|
|
|
@ -32,6 +32,7 @@ import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
|
|
|
|
import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidDeviceMgtPluginException;
|
|
|
|
|
import org.wso2.carbon.device.mgt.mobile.android.core.impl.AndroidServiceImpl;
|
|
|
|
|
import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.DeviceManagementProviderServiceMock;
|
|
|
|
|
import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.utils.TestUtils;
|
|
|
|
@ -60,7 +61,7 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testConfigureDeviceLock() throws OperationManagementException {
|
|
|
|
|
public void testConfigureDeviceLock() throws OperationManagementException, AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.configureDeviceLock(TestUtils.getDeviceLockBeanWrapper());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -69,7 +70,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testConfigureDeviceUnlock()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.configureDeviceUnlock(TestUtils.getDeviceIds());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -78,7 +80,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testGetDeviceLocation()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.getDeviceLocation(TestUtils.getDeviceIds());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -87,7 +90,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testRemovePassword()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.removePassword(TestUtils.getDeviceIds());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -96,7 +100,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testConfigureCamera()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.configureCamera(TestUtils.getCamerabeanWrapper());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -105,7 +110,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testGetDeviceInformation()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.getDeviceInformation(TestUtils.getDeviceIds());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -114,7 +120,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testGetDeviceLogcat()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.getDeviceLogcat(TestUtils.getDeviceIds());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -122,8 +129,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testWipeDevice()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
public void testWipeDevice() throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.wipeDevice(TestUtils.getDeviceIds());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -131,8 +138,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testWipeData()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
public void testWipeData() throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.wipeData(TestUtils.getWipeDataBeanWrapper());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -141,7 +148,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testGetApplications()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.getApplications(TestUtils.getDeviceIds());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -149,8 +157,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testRingDevice()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
public void testRingDevice() throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.ringDevice(TestUtils.getDeviceIds());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -159,7 +167,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testRebootDevice()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.rebootDevice(TestUtils.getDeviceIds());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -168,7 +177,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testChangeLockTask()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.changeLockTask(TestUtils.getDeviceIds());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -176,8 +186,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testMuteDevice()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
public void testMuteDevice() throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.muteDevice(TestUtils.getDeviceIds());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -186,7 +196,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testInstallApplication()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService
|
|
|
|
|
.installApplication(TestUtils.getApplicationInstallationBeanWrapper());
|
|
|
|
@ -196,7 +207,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testUpdateApplication()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.updateApplication(TestUtils.getApplicationUpdateBeanWrapper());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -205,7 +217,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testUninstallApplicationPublic()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService
|
|
|
|
|
.uninstallApplication(TestUtils.getApplicationUninstallationBeanWrapperPublic());
|
|
|
|
@ -215,7 +228,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testUninstallApplicationWebApp()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService
|
|
|
|
|
.uninstallApplication(TestUtils.getApplicationUninstallationBeanWrapperWebApp());
|
|
|
|
@ -225,7 +239,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testBlacklistApplications()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService
|
|
|
|
|
.blacklistApplications(TestUtils.getBlacklistApplicationsBeanWrapper());
|
|
|
|
@ -235,7 +250,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testUpgradeFirmware()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.upgradeFirmware(TestUtils.getUpgradeFirmwareBeanWrapper());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -244,7 +260,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testConfigureVPN()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.configureVPN(TestUtils.getVpnBeanWrapper());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -253,7 +270,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testSendNotification()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.sendNotification(TestUtils.getNotificationBeanWrapper());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -262,7 +280,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testConfigureWifi()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.configureWifi(TestUtils.getWifiBeanWrapper());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -271,7 +290,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testEncryptStorage()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.encryptStorage(TestUtils.getEncryptionBeanWrapper());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -280,7 +300,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testChangeLockCode()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.changeLockCode(TestUtils.getLockCodeBeanWrapper());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -289,7 +310,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testSetPasswordPolicy()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.setPasswordPolicy(TestUtils.getPasswordPolicyBeanWrapper());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
@ -297,8 +319,8 @@ public class DeviceManagementAdminServiceTests {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testSetWebClip()
|
|
|
|
|
throws DeviceManagementException, OperationManagementException, InvalidDeviceException {
|
|
|
|
|
public void testSetWebClip() throws DeviceManagementException, OperationManagementException, InvalidDeviceException,
|
|
|
|
|
AndroidDeviceMgtPluginException {
|
|
|
|
|
mockDeviceManagementService();
|
|
|
|
|
Activity activity = androidService.setWebClip(TestUtils.getWebClipBeanWrapper());
|
|
|
|
|
Assert.assertNotNull(activity);
|
|
|
|
|