本文整理汇总了Java中org.jenkinsci.Symbol.value方法的典型用法代码示例。如果您正苦于以下问题:Java Symbol.value方法的具体用法?Java Symbol.value怎么用?Java Symbol.value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jenkinsci.Symbol
的用法示例。
在下文中一共展示了Symbol.value方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: maven_build_jar_project_on_master_with_globally_disabled_publisher_succeeds
import org.jenkinsci.Symbol; //导入方法依赖的package包/类
private void maven_build_jar_project_on_master_with_globally_disabled_publisher_succeeds(MavenPublisher.DescriptorImpl descriptor) throws Exception {
MavenPublisher publisher = descriptor.clazz.newInstance();
publisher.setDisabled(true);
GlobalPipelineMavenConfig globalPipelineMavenConfig = GlobalPipelineMavenConfig.get();
globalPipelineMavenConfig.setPublisherOptions(Collections.singletonList(publisher));
Logger logger = Logger.getLogger(MavenSpyLogProcessor.class.getName());
Level level = logger.getLevel();
logger.setLevel(Level.FINE);
try {
Symbol symbolAnnotation = descriptor.getClass().getAnnotation(Symbol.class);
String symbol = symbolAnnotation.value()[0];
String displayName = descriptor.getDisplayName();
loadMavenJarProjectInGitRepo(this.gitRepoRule);
String pipelineScript = "node('master') {\n" +
" git($/" + gitRepoRule.toString() + "/$)\n" +
" withMaven() {\n" +
" sh 'mvn package verify'\n" +
" }\n" +
"}";
WorkflowJob pipeline = jenkinsRule.createProject(WorkflowJob.class, "build-on-master-" + symbol + "-publisher-globally-disabled");
pipeline.setDefinition(new CpsFlowDefinition(pipelineScript, true));
WorkflowRun build = jenkinsRule.assertBuildStatus(Result.SUCCESS, pipeline.scheduleBuild2(0));
String message = "[withMaven] Skip '" + displayName + "' disabled by configuration";
jenkinsRule.assertLogContains(message, build);
} finally {
logger.setLevel(level);
globalPipelineMavenConfig.setPublisherOptions((List<MavenPublisher>) null);
}
}
示例2: loadMavenJarProjectInGitRepo
import org.jenkinsci.Symbol; //导入方法依赖的package包/类
private void maven_build_jar_project_on_master_with_publisher_configured_both_globally_and_on_the_pipeline_succeeds(MavenPublisher.DescriptorImpl descriptor) throws Exception {
MavenPublisher publisher = descriptor.clazz.newInstance();
publisher.setDisabled(true);
GlobalPipelineMavenConfig globalPipelineMavenConfig = GlobalPipelineMavenConfig.get();
globalPipelineMavenConfig.setPublisherOptions(Collections.singletonList(publisher));
Logger logger = Logger.getLogger(MavenSpyLogProcessor.class.getName());
Level level = logger.getLevel();
logger.setLevel(Level.FINE);
try {
Symbol symbolAnnotation = descriptor.getClass().getAnnotation(Symbol.class);
String symbol = symbolAnnotation.value()[0];
String displayName = descriptor.getDisplayName();
loadMavenJarProjectInGitRepo(this.gitRepoRule);
String pipelineScript = "node('master') {\n" +
" git($/" + gitRepoRule.toString() + "/$)\n" +
" withMaven(options:[" + symbol + "(disabled: true)]) {\n" +
" sh 'mvn package verify'\n" +
" }\n" +
"}";
WorkflowJob pipeline = jenkinsRule.createProject(WorkflowJob.class, "build-on-master-" + symbol + "-publisher-defined-globally-and-in-the-pipeline");
pipeline.setDefinition(new CpsFlowDefinition(pipelineScript, true));
WorkflowRun build = jenkinsRule.assertBuildStatus(Result.SUCCESS, pipeline.scheduleBuild2(0));
jenkinsRule.assertLogContains("[withMaven] WARNING merging publisher configuration defined in the 'Global Tool Configuration' and at the pipeline level is not yet supported. " +
"Use pipeline level configuration for '" + displayName + "'", build);
jenkinsRule.assertLogContains("[withMaven] Skip '" + displayName + "' disabled by configuration", build);
} finally {
logger.setLevel(level);
globalPipelineMavenConfig.setPublisherOptions((List<MavenPublisher>) null);
}
}
示例3: maven_build_jar_project_on_master_with_disabled_publisher_param_succeeds
import org.jenkinsci.Symbol; //导入方法依赖的package包/类
private void maven_build_jar_project_on_master_with_disabled_publisher_param_succeeds(MavenPublisher.DescriptorImpl descriptor, String symbol, boolean disabled) throws Exception {
Logger logger = Logger.getLogger(MavenSpyLogProcessor.class.getName());
Level level = logger.getLevel();
logger.setLevel(Level.FINE);
try {
String displayName = descriptor.getDisplayName();
Symbol symbolAnnotation = descriptor.getClass().getAnnotation(Symbol.class);
String[] symbols = symbolAnnotation.value();
assertThat(new String[]{symbol}, is(symbols));
loadMavenJarProjectInGitRepo(this.gitRepoRule);
String pipelineScript = "node('master') {\n" +
" git($/" + gitRepoRule.toString() + "/$)\n" +
" withMaven(options:[" + symbol + "(disabled:" + disabled + ")]) {\n" +
" sh 'mvn package verify'\n" +
" }\n" +
"}";
WorkflowJob pipeline = jenkinsRule.createProject(WorkflowJob.class, "build-on-master-" + symbol + "-publisher-disabled-" + disabled);
pipeline.setDefinition(new CpsFlowDefinition(pipelineScript, true));
WorkflowRun build = jenkinsRule.assertBuildStatus(Result.SUCCESS, pipeline.scheduleBuild2(0));
String message = "[withMaven] Skip '" + displayName + "' disabled by configuration";
if (disabled) {
jenkinsRule.assertLogContains(message, build);
} else {
jenkinsRule.assertLogNotContains(message, build);
}
} finally {
logger.setLevel(level);
}
}
示例4: maven_build_jar_project_on_master_with_open_task_scanner_config_succeeds
import org.jenkinsci.Symbol; //导入方法依赖的package包/类
@Test
public void maven_build_jar_project_on_master_with_open_task_scanner_config_succeeds() throws Exception {
MavenPublisher.DescriptorImpl descriptor = new TasksScannerPublisher.DescriptorImpl();
String displayName = descriptor.getDisplayName();
Symbol symbolAnnotation = descriptor.getClass().getAnnotation(Symbol.class);
String[] symbols = symbolAnnotation.value();
assertThat(new String[]{"openTasksPublisher"}, is(symbols));
loadMavenJarProjectInGitRepo(this.gitRepoRule);
String pipelineScript = "node('master') {\n" +
" git($/" + gitRepoRule.toString() + "/$)\n" +
" withMaven(options:[openTasksPublisher(" +
" disabled:false, " +
" pattern:'src/main/java', excludePattern:'a/path'," +
" ignoreCase:true, asRegexp:false, " +
" lowPriorityTaskIdentifiers:'minor', normalPriorityTaskIdentifiers:'todo', highPriorityTaskIdentifiers:'fixme')]) {\n" +
" sh 'mvn package verify'\n" +
" }\n" +
"}";
WorkflowJob pipeline = jenkinsRule.createProject(WorkflowJob.class, "build-on-master-openTasksPublisher-publisher-config");
pipeline.setDefinition(new CpsFlowDefinition(pipelineScript, true));
WorkflowRun build = jenkinsRule.assertBuildStatus(Result.SUCCESS, pipeline.scheduleBuild2(0));
String message = "[withMaven] Skip '" + displayName + "' disabled by configuration";
jenkinsRule.assertLogNotContains(message, build);
}