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.charts; 17 18 import ohos.devtools.views.layout.chartview.ProfilerChartsView; 19 import ohos.devtools.views.layout.chartview.TaskScenePanelChart; 20 import org.junit.Assert; 21 import org.junit.Before; 22 import org.junit.Test; 23 24 import java.util.ArrayList; 25 26 /** 27 * Bar Chart Test 28 * 29 * @since 2021/2/1 9:31 30 */ 31 public class BarChartTest { 32 private TaskScenePanelChart taskScenePanelChart; 33 private ProfilerChartsView bottomPanel; 34 private BarChart bar; 35 36 /** 37 * init 38 * 39 * @tc.name: init 40 * @tc.number: OHOS_JAVA_View_BarChart_init_0001 41 * @tc.desc: init 42 * @tc.type: functional testing 43 * @tc.require: SR000FK5SL 44 */ 45 @Before init()46 public void init() { 47 taskScenePanelChart = new TaskScenePanelChart(); 48 bottomPanel = new ProfilerChartsView(1L, true, taskScenePanelChart); 49 bar = new BarChart(bottomPanel, "name", new ArrayList<>()); 50 } 51 52 /** 53 * Bar Chart Test 54 * 55 * @tc.name: BarChartTest 56 * @tc.number: OHOS_JAVA_View_BarChart_BarChartTest_0001 57 * @tc.desc: BarChartTest 58 * @tc.type: functional testing 59 * @tc.require: SR000FK5SL 60 */ 61 @Test barChartTest()62 public void barChartTest() { 63 BarChart barChart = new BarChart(bottomPanel, "name", new ArrayList<>()); 64 Assert.assertNotNull(barChart); 65 } 66 }