From 91e1268ca89bb7420f6d19c773907b3b736dca02 Mon Sep 17 00:00:00 2001 From: sinthuja Date: Tue, 17 Oct 2017 18:33:27 +0530 Subject: [PATCH] updating the default configurations for test cases. --- .../mgt/core/common/BaseDeviceManagementTest.java | 4 ++-- .../service/DeviceManagementProviderServiceTest.java | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/common/BaseDeviceManagementTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/common/BaseDeviceManagementTest.java index fc24e38512..b5565814b4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/common/BaseDeviceManagementTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/common/BaseDeviceManagementTest.java @@ -69,8 +69,8 @@ public abstract class BaseDeviceManagementTest { @BeforeSuite @Parameters({"datasource", "isMock"}) - public void setupDataSource(@Optional("src/test/resources/config/datasource/mysql/data-source-config") String datasource, - @Optional("true") boolean isMock) + public void setupDataSource(@Optional("src/test/resources/config/datasource/data-source-config") String datasource, + @Optional("false") boolean isMock) throws Exception { datasourceLocation = datasource; mock = isMock; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceTest.java index a1cb8cd21e..a828447c80 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceTest.java @@ -500,12 +500,14 @@ public class DeviceManagementProviderServiceTest extends BaseDeviceManagementTes @Test(dependsOnMethods = {"testSuccessfulDeviceEnrollment"}) public void testUpdateDeviceInfo() throws DeviceManagementException, TransactionManagementException, DeviceDetailsMgtDAOException { - Device device = deviceMgtService.getDevice(new DeviceIdentifier(DEVICE_ID, - DEVICE_TYPE)); + if (!isMock()) { + Device device = deviceMgtService.getDevice(new DeviceIdentifier(DEVICE_ID, + DEVICE_TYPE)); - boolean status = deviceMgtService.updateDeviceInfo(new DeviceIdentifier(DEVICE_ID, - DEVICE_TYPE), device); - Assert.assertTrue(status); + boolean status = deviceMgtService.updateDeviceInfo(new DeviceIdentifier(DEVICE_ID, + DEVICE_TYPE), device); + Assert.assertTrue(status); + } } @Test(dependsOnMethods = {"testSuccessfulDeviceEnrollment"})