From 47e569fa08b7d9e0950f2a97ebcb7ccc4c16dfff Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Wed, 4 Dec 2019 18:18:19 +0530 Subject: [PATCH] Fix android web app deploying issue --- .../pom.xml | 4 + .../addons}/AndroidAgentException.java | 2 +- .../mobile/android/addons}/ErrorHandler.java | 4 +- .../mobile/android/addons}/ErrorMessage.java | 2 +- .../addons}/GsonMessageBodyHandler.java | 2 +- .../pom.xml | 92 +++++++++++++++++-- .../api/DeviceTypeConfigurationAPI.java | 3 +- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 4 +- .../pom.xml | 5 - .../android/core/impl/AndroidServiceImpl.java | 4 - .../DeviceManagementAdminServiceTests.java | 86 ++++++++++------- .../core/DeviceManagementServiceTests.java | 7 +- pom.xml | 2 +- 13 files changed, 157 insertions(+), 60 deletions(-) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception => org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons}/AndroidAgentException.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common => org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons}/ErrorHandler.java (89%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common => org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons}/ErrorMessage.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common => org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons}/GsonMessageBodyHandler.java (98%) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/pom.xml index 3f658001d..cf5a51b2c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/pom.xml @@ -93,5 +93,9 @@ org.wso2.carbon org.wso2.carbon.logging + + com.google.code.gson + gson + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidAgentException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/AndroidAgentException.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidAgentException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/AndroidAgentException.java index 697fefa26..681c39f68 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidAgentException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/AndroidAgentException.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.common.exception; +package org.wso2.carbon.device.mgt.mobile.android.addons; /** * diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorHandler.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ErrorHandler.java similarity index 89% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorHandler.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ErrorHandler.java index 2bcbbed6f..1023bdef2 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorHandler.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ErrorHandler.java @@ -15,9 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.common; - -import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidAgentException; +package org.wso2.carbon.device.mgt.mobile.android.addons; import javax.ws.rs.Produces; import javax.ws.rs.core.Response; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorMessage.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ErrorMessage.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorMessage.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ErrorMessage.java index 793fb7291..a27c9b5ad 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorMessage.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ErrorMessage.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.common; +package org.wso2.carbon.device.mgt.mobile.android.addons; public class ErrorMessage { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GsonMessageBodyHandler.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/GsonMessageBodyHandler.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GsonMessageBodyHandler.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/GsonMessageBodyHandler.java index 9ffe273a4..bd6b7931f 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GsonMessageBodyHandler.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/GsonMessageBodyHandler.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.common; +package org.wso2.carbon.device.mgt.mobile.android.addons; import com.google.gson.Gson; import com.google.gson.GsonBuilder; 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 d902ed524..b0cb54e0c 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 @@ -90,6 +90,28 @@ org.apache.cxf cxf-rt-frontend-jaxws + + + asm + asm + + + neethi + org.apache.neethi + + + wsdl4j + wsdl4j + + + xml-resolver + xml-resolver + + + xmlschema-core + org.apache.ws.xmlschema + + org.apache.cxf @@ -108,6 +130,12 @@ org.wso2.carbon org.wso2.carbon.utils provided + + + commons-lang + commons-lang.wso2 + + org.wso2.carbon @@ -130,6 +158,12 @@ commons-httpclient.wso2 commons-httpclient provided + + + commons-logging + commons-logging + + com.google.code.gson @@ -144,12 +178,26 @@ org.slf4j slf4j-api + + commons-logging + commons-logging + + + neethi + org.wso2.orbit.org.apache.neethi + org.wso2.carbon.analytics org.wso2.carbon.analytics.api provided + + + asm + org.ow2.asm + + io.swagger @@ -183,21 +231,31 @@ javax.ws.rs javax.ws.rs-api + provided org.codehaus.jackson jackson-core-asl - - com.google.apis - google-api-services-androidenterprise - v1-rev186-1.25.0 - org.wso2.carbon.devicemgt org.wso2.carbon.device.application.mgt.common provided + + + commons-logging + commons-logging + + + neethi + org.apache.neethi.wso2 + + + wsdl4j + wsdl4j.wso2 + + org.apache.httpcomponents @@ -212,7 +270,6 @@ org.wso2.carbon.devicemgt-plugins org.wso2.carbon.device.mgt.mobile.android.addons - provided org.wso2.carbon.devicemgt-plugins @@ -227,6 +284,29 @@ org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.core + provided + + + commons-logging + commons-logging + + + axis2-client + org.apache.axis2.wso2 + + + neethi + org.wso2.orbit.org.apache.neethi + + + wsdl4j + wsdl4j.wso2 + + + XmlSchema + org.apache.ws.commons.schema.wso2 + + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceTypeConfigurationAPI.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceTypeConfigurationAPI.java index 6e8e324ea..e3cce4634 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceTypeConfigurationAPI.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceTypeConfigurationAPI.java @@ -34,7 +34,6 @@ import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; import org.wso2.carbon.device.mgt.mobile.android.common.bean.AndroidPlatformConfiguration; -import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidAgentException; import javax.validation.Valid; import javax.ws.rs.*; @@ -245,6 +244,6 @@ public interface DeviceTypeConfigurationAPI { value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + "Example: Mon, 05 Jan 2014 15:10:00 +0200.") - @HeaderParam("If-Modified-Since") String ifModifiedSince) throws AndroidAgentException; + @HeaderParam("If-Modified-Since") String ifModifiedSince); } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/cxf-servlet.xml index 290d6266b..581b918e0 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -65,8 +65,8 @@ - - + + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/pom.xml index ee22567e1..404950cb4 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/pom.xml @@ -162,11 +162,6 @@ org.wso2.carbon.devicemgt-plugins org.wso2.carbon.device.mgt.mobile.android.common - - org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.mobile.android.common - provided - org.wso2.carbon.devicemgt org.wso2.carbon.device.application.mgt.common diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidServiceImpl.java index 041d58442..3d4562abb 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidServiceImpl.java @@ -22,7 +22,6 @@ import com.google.api.services.androidenterprise.model.ProductsListResponse; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpStatus; import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; import org.wso2.carbon.base.ServerConfiguration; import org.wso2.carbon.context.CarbonContext; @@ -36,7 +35,6 @@ import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.device.details.DeviceLocation; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.exceptions.DeviceNotFoundException; import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException; @@ -66,7 +64,6 @@ import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidEnterpriseUtil import org.wso2.carbon.policy.mgt.common.PolicyManagementException; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; -import javax.ws.rs.InternalServerErrorException; import javax.ws.rs.core.Response; import java.io.IOException; import java.net.HttpURLConnection; @@ -87,7 +84,6 @@ public class AndroidServiceImpl implements AndroidService { private static final String OPERATION_ERROR_STATUS = "ERROR"; public static final String GOOGLE_AFW_EMM_ANDROID_ID = "googleEMMAndroidId"; public static final String GOOGLE_AFW_DEVICE_ID = "googleEMMDeviceId"; - private static final String EVENT_STREAM_DEFINITION = "org.wso2.iot.LocationStream"; @Override diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementAdminServiceTests.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementAdminServiceTests.java index d67ad8ab0..85a6f251f 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementAdminServiceTests.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementAdminServiceTests.java @@ -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); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementServiceTests.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementServiceTests.java index ead8db2d2..b8c749b63 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementServiceTests.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementServiceTests.java @@ -36,6 +36,7 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.mobile.android.common.Message; import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidDevice; +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.ApplicationManagementProviderServiceMock; import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.DeviceInformationManagerServiceMock; @@ -289,7 +290,8 @@ public class DeviceManagementServiceTests { @Test public void testModifyEnrollmentSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { + throws DeviceManagementException, OperationManagementException, InvalidDeviceException, + AndroidDeviceMgtPluginException { mockDeviceManagementService(); mockUser(); boolean status = androidService.modifyEnrollment(TestUtils.getDeviceId(), TestUtils.getBasicAndroidDevice()); @@ -298,7 +300,8 @@ public class DeviceManagementServiceTests { @Test public void testModifyEnrollmentUnSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { + throws DeviceManagementException, OperationManagementException, InvalidDeviceException, + AndroidDeviceMgtPluginException { mockDeviceManagementService(); mockUser(); AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice(); diff --git a/pom.xml b/pom.xml index 9633307cd..538938477 100644 --- a/pom.xml +++ b/pom.xml @@ -1360,7 +1360,7 @@ 7.0.85 1.0 - 2.0 + 2.0.1 github-scm