|
|
@ -1,3 +1,21 @@
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
|
|
|
|
|
|
* Version 2.0 (the "License"); you may not use this file except
|
|
|
|
|
|
|
|
* in compliance with the License.
|
|
|
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Unless required by applicable law or agreed to in writing,
|
|
|
|
|
|
|
|
* software distributed under the License is distributed on an
|
|
|
|
|
|
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
|
|
|
|
* KIND, either express or implied. See the License for the
|
|
|
|
|
|
|
|
* specific language governing permissions and limitations
|
|
|
|
|
|
|
|
* under the License.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
package org.wso2.carbon.device.mgt.extensions.device.type.template;
|
|
|
|
package org.wso2.carbon.device.mgt.extensions.device.type.template;
|
|
|
|
|
|
|
|
|
|
|
|
import org.testng.Assert;
|
|
|
|
import org.testng.Assert;
|
|
|
@ -72,8 +90,7 @@ public class HttpDeviceTypeManagerServiceAndDeviceTypeGeneratorServceTest {
|
|
|
|
@Test(description = "This test case tests the enrollment of newly added device type")
|
|
|
|
@Test(description = "This test case tests the enrollment of newly added device type")
|
|
|
|
public void testEnrollDevice() throws DeviceManagementException {
|
|
|
|
public void testEnrollDevice() throws DeviceManagementException {
|
|
|
|
String deviceId = "testdevice1";
|
|
|
|
String deviceId = "testdevice1";
|
|
|
|
Device sampleDevice1 = new Device(deviceId, androidSenseDeviceType, "test", "testdevice",
|
|
|
|
Device sampleDevice1 = new Device(deviceId, androidSenseDeviceType, "test", "testdevice", null, null, null);
|
|
|
|
null, null, null);
|
|
|
|
|
|
|
|
Assert.assertTrue(httpDeviceTypeManagerService.getDeviceManager().enrollDevice(sampleDevice1),
|
|
|
|
Assert.assertTrue(httpDeviceTypeManagerService.getDeviceManager().enrollDevice(sampleDevice1),
|
|
|
|
"Enrollment of " + androidSenseDeviceType + " device failed");
|
|
|
|
"Enrollment of " + androidSenseDeviceType + " device failed");
|
|
|
|
Assert.assertTrue(httpDeviceTypeManagerService.getDeviceManager()
|
|
|
|
Assert.assertTrue(httpDeviceTypeManagerService.getDeviceManager()
|
|
|
@ -83,10 +100,10 @@ public class HttpDeviceTypeManagerServiceAndDeviceTypeGeneratorServceTest {
|
|
|
|
|
|
|
|
|
|
|
|
@Test(description = "This test case tests the populate device management service method")
|
|
|
|
@Test(description = "This test case tests the populate device management service method")
|
|
|
|
public void testPopulateDeviceManagementService() {
|
|
|
|
public void testPopulateDeviceManagementService() {
|
|
|
|
DeviceManagementService deviceManagementService = deviceTypeGeneratorService.populateDeviceManagementService
|
|
|
|
DeviceManagementService deviceManagementService = deviceTypeGeneratorService
|
|
|
|
(sampleDeviceType, deviceTypeMetaDefinition);
|
|
|
|
.populateDeviceManagementService(sampleDeviceType, deviceTypeMetaDefinition);
|
|
|
|
Assert.assertEquals(deviceManagementService.getType(), sampleDeviceType, "DeviceTypeGeneration for the "
|
|
|
|
Assert.assertEquals(deviceManagementService.getType(), sampleDeviceType,
|
|
|
|
+ "sample device type failed");
|
|
|
|
"DeviceTypeGeneration for the " + "sample device type failed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -113,8 +130,8 @@ public class HttpDeviceTypeManagerServiceAndDeviceTypeGeneratorServceTest {
|
|
|
|
.getPushNotificationProvider();
|
|
|
|
.getPushNotificationProvider();
|
|
|
|
PushNotificationConfig pushNotificationConfig = new PushNotificationConfig(pushNotificationProvider.getType(),
|
|
|
|
PushNotificationConfig pushNotificationConfig = new PushNotificationConfig(pushNotificationProvider.getType(),
|
|
|
|
pushNotificationProvider.isScheduled(), null);
|
|
|
|
pushNotificationProvider.isScheduled(), null);
|
|
|
|
org.wso2.carbon.device.mgt.extensions.device.type.template.config.License license = androidSenseDeviceTypeConfiguration
|
|
|
|
org.wso2.carbon.device.mgt.extensions.device.type.template.config.License license =
|
|
|
|
.getLicense();
|
|
|
|
androidSenseDeviceTypeConfiguration.getLicense();
|
|
|
|
License androidSenseLicense = new License();
|
|
|
|
License androidSenseLicense = new License();
|
|
|
|
androidSenseLicense.setText(license.getText());
|
|
|
|
androidSenseLicense.setText(license.getText());
|
|
|
|
androidSenseLicense.setLanguage(license.getLanguage());
|
|
|
|
androidSenseLicense.setLanguage(license.getLanguage());
|
|
|
@ -138,4 +155,3 @@ public class HttpDeviceTypeManagerServiceAndDeviceTypeGeneratorServceTest {
|
|
|
|
deviceTypeMetaDefinition.setFeatures(features);
|
|
|
|
deviceTypeMetaDefinition.setFeatures(features);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|