You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.3 KiB
34 lines
1.3 KiB
/*
|
|
* Copyright (c) 2023 - 2024. KeyWare.Co.Ltd All rights reserved.
|
|
* 项目名称:28所 C++ 信息安全性设计准则
|
|
* 项目描述:用于检查C++源代码的安全性设计准则的Sonarqube插件
|
|
* 版权说明:本软件属北京关键科技股份有限公司所有,在未获得北京关键科技股份有限公司正式授权情况下,任何企业和个人,不能获取、阅读、安装、传播本软件涉及的任何受知识产权保护的内容。
|
|
*/
|
|
package com.keyware.sonar.cxx;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
import org.sonar.api.Plugin;
|
|
import org.sonar.api.SonarEdition;
|
|
import org.sonar.api.SonarQubeSide;
|
|
import org.sonar.api.SonarRuntime;
|
|
import org.sonar.api.internal.SonarRuntimeImpl;
|
|
import org.sonar.api.utils.Version;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
class CxxPluginTest {
|
|
|
|
@Test
|
|
void testGetExtensions() throws Exception {
|
|
SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(
|
|
Version.create(8, 6),
|
|
SonarQubeSide.SCANNER,
|
|
SonarEdition.COMMUNITY
|
|
);
|
|
var context = new Plugin.Context(runtime);
|
|
var plugin = new CxxPlugin();
|
|
plugin.define(context);
|
|
assertThat(context.getExtensions()).hasSize(89);
|
|
}
|
|
|
|
}
|
|
|