Refactoring

merge-requests/1/head
Menaka Jayawardena 7 years ago
parent 62d30cbf84
commit 6c0d0f89a4

@ -280,7 +280,10 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
try { try {
deviceInformationManager.addDeviceInfo(deviceIdentifier, device.getDeviceInfo()); deviceInformationManager.addDeviceInfo(deviceIdentifier, device.getDeviceInfo());
} catch (DeviceDetailsMgtException e) { } catch (DeviceDetailsMgtException e) {
e.printStackTrace(); String msg = "Error occurred while adding device info for the device " +
device.getDeviceIdentifier();
log.error(msg, e);
throw new DeviceManagementException(msg, e);
} }
} }

@ -43,12 +43,16 @@ import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
/**
* This class contains unit tests for the class SearchManagerService
* */
public class SearchManagementServiceTest extends BaseDeviceManagementTest { public class SearchManagementServiceTest extends BaseDeviceManagementTest {
private static final Log log = LogFactory.getLog(SearchManagementServiceTest.class); private static final Log log = LogFactory.getLog(SearchManagementServiceTest.class);
private static List<DeviceIdentifier> deviceIdentifiers = new ArrayList<>(); private static List<DeviceIdentifier> deviceIdentifiers = new ArrayList<>();
private static String DEVICE_ID_PREFIX = "SEARCH-DEVICE-ID-"; private static final String DEVICE_ID_PREFIX = "SEARCH-DEVICE-ID-";
private static String DEVICE_TYPE = "SEARCH_TYPE"; private static final String DEVICE_TYPE = "SEARCH_TYPE";
@BeforeClass @BeforeClass
public void init() throws Exception { public void init() throws Exception {
@ -133,7 +137,7 @@ public class SearchManagementServiceTest extends BaseDeviceManagementTest {
Assert.assertTrue(devices.size() == 0); Assert.assertTrue(devices.size() == 0);
} }
@Test @Test(description = "Search devices by string parameter.")
public void testStringSearch() throws Exception { public void testStringSearch() throws Exception {
SearchContext context = new SearchContext(); SearchContext context = new SearchContext();
List<Condition> conditions = new ArrayList<>(); List<Condition> conditions = new ArrayList<>();

@ -32,7 +32,6 @@
<class name="org.wso2.carbon.device.mgt.core.app.mgt.AppManagementConfigurationManagerTest"/> <class name="org.wso2.carbon.device.mgt.core.app.mgt.AppManagementConfigurationManagerTest"/>
<class name="org.wso2.carbon.device.mgt.core.dao.ApplicationPersistenceTests"/> <class name="org.wso2.carbon.device.mgt.core.dao.ApplicationPersistenceTests"/>
<class name="org.wso2.carbon.device.mgt.core.search.DeviceDetails"/> <class name="org.wso2.carbon.device.mgt.core.search.DeviceDetails"/>
<!--<class name="org.wso2.carbon.device.mgt.core.search.SearchDevice"/>-->
<class name="org.wso2.carbon.device.mgt.core.dao.GroupPersistTests"/> <class name="org.wso2.carbon.device.mgt.core.dao.GroupPersistTests"/>
</classes> </classes>
</test> </test>
@ -50,7 +49,6 @@
<class name="org.wso2.carbon.device.mgt.core.task.DeviceTaskManagerServiceTest"/> <class name="org.wso2.carbon.device.mgt.core.task.DeviceTaskManagerServiceTest"/>
<class name="org.wso2.carbon.device.mgt.core.task.DeviceTaskManagerTest"/> <class name="org.wso2.carbon.device.mgt.core.task.DeviceTaskManagerTest"/>
<class name="org.wso2.carbon.device.mgt.core.authorization.DeviceAccessAuthorizationServiceTest"/> <class name="org.wso2.carbon.device.mgt.core.authorization.DeviceAccessAuthorizationServiceTest"/>
<!--<class name="org.wso2.carbon.device.mgt.core.search.DeviceDetails"/>-->
<class name="org.wso2.carbon.device.mgt.core.search.SearchManagementServiceTest"/> <class name="org.wso2.carbon.device.mgt.core.search.SearchManagementServiceTest"/>
</classes> </classes>
</test> </test>

Loading…
Cancel
Save