• 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 com.intellij.ui.components.JBCheckBox;
19 import com.intellij.ui.components.JBPanel;
20 import org.junit.Assert;
21 import org.junit.Test;
22 
23 import java.awt.event.MouseEvent;
24 import java.util.ArrayList;
25 
26 /**
27  * SystemConfigPanelTest
28  *
29  * @since 2021/5/19 16:39
30  */
31 public class SystemConfigPanelTest {
32 
33     /**
34      * get Instance addActionListenerTest
35      *
36      * @tc.name: addActionListenerTest
37      * @tc.number: OHOS_JAVA_layout_SystemConfigPanel_addActionListenerTest_0001
38      * @tc.desc: addActionListenerTest
39      * @tc.type: functional testing
40      * @tc.require: SR-010
41      */
42     @Test
addActionListenerTest01()43     public void addActionListenerTest01() {
44         new SystemConfigPanel(new TaskPanel()).addActionListener(new JBCheckBox());
45         Assert.assertTrue(true);
46     }
47 
48     /**
49      * get Instance addDeviceRefreshTest
50      *
51      * @tc.name: addDeviceRefreshTest
52      * @tc.number: OHOS_JAVA_layout_SystemConfigPanel_addDeviceRefreshTest_0001
53      * @tc.desc: addDeviceRefreshTest
54      * @tc.type: functional testing
55      * @tc.require: SR-010
56      */
57     @Test
addDeviceRefreshTest01()58     public void addDeviceRefreshTest01() {
59         new SystemConfigPanel(new TaskPanel()).addDeviceRefresh();
60         Assert.assertTrue(true);
61     }
62 
63     /**
64      * get Instance mouseReleasedTest
65      *
66      * @tc.name: mouseReleasedTest
67      * @tc.number: OHOS_JAVA_layout_SystemConfigPanel_mouseReleasedTest_0001
68      * @tc.desc: mouseReleasedTest
69      * @tc.type: functional testing
70      * @tc.require: SR-010
71      */
72     @Test
mouseReleasedTest01()73     public void mouseReleasedTest01() {
74         JBPanel jBPanel = new JBPanel();
75         MouseEvent mouseEvent = new MouseEvent(jBPanel, 1, 1, 1, 1, 1, 1, true, 1);
76         mouseEvent.getComponent().setName("Test");
77         new SystemConfigPanel(new TaskPanel()).mouseReleased(mouseEvent);
78         Assert.assertTrue(true);
79     }
80 
81     /**
82      * get Instance getClassificationSelectTest
83      *
84      * @tc.name: getClassificationSelectTest
85      * @tc.number: OHOS_JAVA_layout_SystemConfigPanel_getClassificationSelectTest_0001
86      * @tc.desc: getClassificationSelectTest
87      * @tc.type: functional testing
88      * @tc.require: SR-010
89      */
90     @Test
getClassificationSelectTest01()91     public void getClassificationSelectTest01() {
92         boolean flag = new SystemConfigPanel(new TaskPanel()).getClassificationSelect();
93         Assert.assertTrue(flag);
94     }
95 
96     /**
97      * get Instance getEventTest
98      *
99      * @tc.name: getEventTest
100      * @tc.number: OHOS_JAVA_layout_SystemConfigPanel_getEventTest_0001
101      * @tc.desc: getEventTest
102      * @tc.type: functional testing
103      * @tc.require: SR-010
104      */
105     @Test
getEventTest01()106     public void getEventTest01() {
107         new SystemConfigPanel(new TaskPanel()).getEvent(new ArrayList<>(), new ArrayList<>());
108         Assert.assertTrue(true);
109     }
110 
111     /**
112      * get Instance itemStateChangedTest
113      *
114      * @tc.name: itemStateChangedTest
115      * @tc.number: OHOS_JAVA_layout_SystemConfigPanel_itemStateChangedTest_0001
116      * @tc.desc: itemStateChangedTest
117      * @tc.type: functional testing
118      * @tc.require: SR-010
119      */
120     @Test
itemStateChangedTest01()121     public void itemStateChangedTest01() {
122         new SystemConfigPanel(new TaskPanel()).itemStateChanged(null);
123         Assert.assertTrue(true);
124     }
125 
126     /**
127      * get Instance itemStateChangedTest
128      *
129      * @tc.name: itemStateChangedTest
130      * @tc.number: OHOS_JAVA_layout_SystemConfigPanel_itemStateChangedTest_0002
131      * @tc.desc: itemStateChangedTest
132      * @tc.type: functional testing
133      * @tc.require: SR-010
134      */
135     @Test
itemStateChangedTest02()136     public void itemStateChangedTest02() {
137         new SystemConfigPanel(new TaskPanel()).addDeviceRefresh();
138         new SystemConfigPanel(new TaskPanel()).itemStateChanged(null);
139         Assert.assertTrue(true);
140     }
141 }
142