|
|
@ -32,7 +32,7 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
|
|
|
import org.wso2.carbon.device.mgt.common.geo.service.Alert;
|
|
|
|
import org.wso2.carbon.device.mgt.common.geo.service.Alert;
|
|
|
|
import org.wso2.carbon.device.mgt.common.geo.service.GeoFence;
|
|
|
|
import org.wso2.carbon.device.mgt.common.geo.service.GeoFence;
|
|
|
|
import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationBasedServiceException;
|
|
|
|
import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationBasedServiceException;
|
|
|
|
import org.wso2.carbon.device.mgt.common.geo.service.AlertAlreadyExist;
|
|
|
|
import org.wso2.carbon.device.mgt.common.geo.service.AlertAlreadyExistException;
|
|
|
|
import org.wso2.carbon.device.mgt.core.TestDeviceManagementService;
|
|
|
|
import org.wso2.carbon.device.mgt.core.TestDeviceManagementService;
|
|
|
|
import org.wso2.carbon.device.mgt.core.common.TestDataHolder;
|
|
|
|
import org.wso2.carbon.device.mgt.core.common.TestDataHolder;
|
|
|
|
import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder;
|
|
|
|
import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder;
|
|
|
@ -67,42 +67,42 @@ public class GeoLocationProviderServiceTest {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test (description = "Create a sample geo exit-alert with relevant details.")
|
|
|
|
@Test (description = "Create a sample geo exit-alert with relevant details.")
|
|
|
|
public void createGeoExitAlert() throws GeoLocationBasedServiceException, AlertAlreadyExist {
|
|
|
|
public void createGeoExitAlert() throws GeoLocationBasedServiceException, AlertAlreadyExistException {
|
|
|
|
Boolean result = geoLocationProviderServiceImpl.
|
|
|
|
Boolean result = geoLocationProviderServiceImpl.
|
|
|
|
createGeoAlert(getExitAlert(), getDeviceIdentifier(), DeviceManagementConstants.GeoServices.ALERT_TYPE_EXIT);
|
|
|
|
createGeoAlert(getExitAlert(), getDeviceIdentifier(), DeviceManagementConstants.GeoServices.ALERT_TYPE_EXIT);
|
|
|
|
Assert.assertEquals(result, Boolean.TRUE);
|
|
|
|
Assert.assertEquals(result, Boolean.TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test (description = "Create a sample geo within-alert with relevant details.")
|
|
|
|
@Test (description = "Create a sample geo within-alert with relevant details.")
|
|
|
|
public void createGeoWithinAlert() throws GeoLocationBasedServiceException, AlertAlreadyExist {
|
|
|
|
public void createGeoWithinAlert() throws GeoLocationBasedServiceException, AlertAlreadyExistException {
|
|
|
|
Boolean result = geoLocationProviderServiceImpl.
|
|
|
|
Boolean result = geoLocationProviderServiceImpl.
|
|
|
|
createGeoAlert(getWithinAlert(), getDeviceIdentifier(), DeviceManagementConstants.GeoServices.ALERT_TYPE_WITHIN);
|
|
|
|
createGeoAlert(getWithinAlert(), getDeviceIdentifier(), DeviceManagementConstants.GeoServices.ALERT_TYPE_WITHIN);
|
|
|
|
Assert.assertEquals(result, Boolean.TRUE);
|
|
|
|
Assert.assertEquals(result, Boolean.TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test (description = "Create a sample geo proximity-alert with relevant details.")
|
|
|
|
@Test (description = "Create a sample geo proximity-alert with relevant details.")
|
|
|
|
public void createGeoProximityAlert() throws GeoLocationBasedServiceException, AlertAlreadyExist {
|
|
|
|
public void createGeoProximityAlert() throws GeoLocationBasedServiceException, AlertAlreadyExistException {
|
|
|
|
Boolean result = geoLocationProviderServiceImpl.
|
|
|
|
Boolean result = geoLocationProviderServiceImpl.
|
|
|
|
createGeoAlert(getProximityAlert(), getDeviceIdentifier(), DeviceManagementConstants.GeoServices.ALERT_TYPE_PROXIMITY);
|
|
|
|
createGeoAlert(getProximityAlert(), getDeviceIdentifier(), DeviceManagementConstants.GeoServices.ALERT_TYPE_PROXIMITY);
|
|
|
|
Assert.assertEquals(result, Boolean.TRUE);
|
|
|
|
Assert.assertEquals(result, Boolean.TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test (description = "Create a sample geo speed-alert with relevant details.")
|
|
|
|
@Test (description = "Create a sample geo speed-alert with relevant details.")
|
|
|
|
public void createGeoSpeedAlert() throws GeoLocationBasedServiceException, AlertAlreadyExist {
|
|
|
|
public void createGeoSpeedAlert() throws GeoLocationBasedServiceException, AlertAlreadyExistException {
|
|
|
|
Boolean result = geoLocationProviderServiceImpl.
|
|
|
|
Boolean result = geoLocationProviderServiceImpl.
|
|
|
|
createGeoAlert(getSpeedAlert(), getDeviceIdentifier(), DeviceManagementConstants.GeoServices.ALERT_TYPE_SPEED);
|
|
|
|
createGeoAlert(getSpeedAlert(), getDeviceIdentifier(), DeviceManagementConstants.GeoServices.ALERT_TYPE_SPEED);
|
|
|
|
Assert.assertEquals(result, Boolean.TRUE);
|
|
|
|
Assert.assertEquals(result, Boolean.TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test (description = "Create a sample geo stationary-alert with relevant details.")
|
|
|
|
@Test (description = "Create a sample geo stationary-alert with relevant details.")
|
|
|
|
public void createGeoStationaryAlert() throws GeoLocationBasedServiceException, AlertAlreadyExist {
|
|
|
|
public void createGeoStationaryAlert() throws GeoLocationBasedServiceException, AlertAlreadyExistException {
|
|
|
|
Boolean result = geoLocationProviderServiceImpl.
|
|
|
|
Boolean result = geoLocationProviderServiceImpl.
|
|
|
|
createGeoAlert(getStationaryAlert(), getDeviceIdentifier(), DeviceManagementConstants.GeoServices.ALERT_TYPE_STATIONARY);
|
|
|
|
createGeoAlert(getStationaryAlert(), getDeviceIdentifier(), DeviceManagementConstants.GeoServices.ALERT_TYPE_STATIONARY);
|
|
|
|
Assert.assertEquals(result, Boolean.TRUE);
|
|
|
|
Assert.assertEquals(result, Boolean.TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test (description = "Create a sample geo traffic-alert with relevant details.")
|
|
|
|
@Test (description = "Create a sample geo traffic-alert with relevant details.")
|
|
|
|
public void createGeoTrafficAlert() throws GeoLocationBasedServiceException, AlertAlreadyExist {
|
|
|
|
public void createGeoTrafficAlert() throws GeoLocationBasedServiceException, AlertAlreadyExistException {
|
|
|
|
Boolean result = geoLocationProviderServiceImpl.
|
|
|
|
Boolean result = geoLocationProviderServiceImpl.
|
|
|
|
createGeoAlert(getTrafficAlert(), getDeviceIdentifier(), DeviceManagementConstants.GeoServices.ALERT_TYPE_TRAFFIC);
|
|
|
|
createGeoAlert(getTrafficAlert(), getDeviceIdentifier(), DeviceManagementConstants.GeoServices.ALERT_TYPE_TRAFFIC);
|
|
|
|
Assert.assertEquals(result, Boolean.TRUE);
|
|
|
|
Assert.assertEquals(result, Boolean.TRUE);
|
|
|
|