• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 package ohos.devtools.views.layout;
17 
18 import ohos.devtools.datasources.utils.device.entity.DeviceIPPortInfo;
19 import ohos.devtools.datasources.utils.device.entity.DeviceType;
20 import org.junit.Assert;
21 import org.junit.Test;
22 
23 import java.util.Vector;
24 
25 /**
26  * Distributed Device Process Panel Test
27  *
28  * @since 2021/2/1 9:31
29  */
30 public class DistributedDeviceProcessPanelTest {
31     /**
32      * get Instance getDistributedConfigPanel
33      *
34      * @tc.name: refreshDeviceItemTest
35      * @tc.number: OHOS_JAVA_layout_DistributedDeviceProcessPanel_refreshDeviceItemTest_0001
36      * @tc.desc: refreshDeviceItemTest
37      * @tc.type: functional testing
38      * @tc.require: SR-010
39      */
40     @Test
refreshDeviceItemTest01()41     public void refreshDeviceItemTest01() {
42         Vector<DeviceIPPortInfo> deviceIPPortInfos = new Vector<>();
43         DeviceIPPortInfo deviceIPPortInfo = new DeviceIPPortInfo();
44         deviceIPPortInfo.setPort(1);
45         deviceIPPortInfo.setIp("");
46         deviceIPPortInfo.setDeviceName("");
47         deviceIPPortInfo.setDeviceID("");
48         deviceIPPortInfo.setDeviceType(DeviceType.FULL_HOS_DEVICE);
49         deviceIPPortInfos.add(deviceIPPortInfo);
50         new DistributedDeviceProcessPanel(10, false).refreshDeviceItem(deviceIPPortInfos);
51         Assert.assertTrue(true);
52     }
53 
54     /**
55      * get Instance getVectorTest
56      *
57      * @tc.name: getVectorTest
58      * @tc.number: OHOS_JAVA_layout_DistributedDeviceProcessPanel_getVectorTest_0001
59      * @tc.desc: getVectorTest
60      * @tc.type: functional testing
61      * @tc.require: SR-010
62      */
63     @Test
getVectorTest01()64     public void getVectorTest01() {
65         Vector<DeviceIPPortInfo> list = new DistributedDeviceProcessPanel(10, false).getVector();
66         int num = list.size();
67         Assert.assertEquals(0, num);
68     }
69 }
70