Fixing issues as per the comments

revert-70aa11f8
megala21 7 years ago
parent 2c9369dae0
commit 22db015699

@ -23,6 +23,7 @@ import org.mockito.Mockito;
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.DeviceStatusTaskPluginConfig;
import org.wso2.carbon.device.mgt.common.InitialOperationConfig;
@ -158,13 +159,15 @@ public class DeviceTypeManagerServiceTest {
boolean isRasberryPiSharedWithTenants =
(rasberrypiDeviceConfiguration.getProvisioningConfig() != null) && rasberrypiDeviceConfiguration
.getProvisioningConfig().isSharedWithAllTenants();
setProvisioningConfig.invoke(androidDeviceTypeManagerService, "carbon.super", androidDeviceConfiguration);
setProvisioningConfig.invoke(androidDeviceTypeManagerService, MultitenantConstants.SUPER_TENANT_DOMAIN_NAME,
androidDeviceConfiguration);
ProvisioningConfig provisioningConfig = androidDeviceTypeManagerService.getProvisioningConfig();
Assert.assertEquals(provisioningConfig.isSharedWithAllTenants(),
androidDeviceConfiguration.getProvisioningConfig().isSharedWithAllTenants(),
"Provisioning configs " + "are not correctly set as per the configuration file provided");
setProvisioningConfig.invoke(rasberrypiDeviceTypeManagerService, "carbon.super", rasberrypiDeviceConfiguration);
setProvisioningConfig.invoke(rasberrypiDeviceTypeManagerService, MultitenantConstants.SUPER_TENANT_DOMAIN_NAME,
rasberrypiDeviceConfiguration);
provisioningConfig = rasberrypiDeviceTypeManagerService.getProvisioningConfig();
Assert.assertEquals(provisioningConfig.isSharedWithAllTenants(), isRasberryPiSharedWithTenants,
"Provisioning configs are not correctly set as per the configuration file provided.");

@ -1,3 +1,22 @@
/*
* 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.utils;
import org.w3c.dom.Document;
@ -16,6 +35,9 @@ import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.IOException;
/**
* This class handles the test utility tasks.
*/
public class Utils {
/**

Loading…
Cancel
Save