• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Symbol类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jenkinsci.Symbol的典型用法代码示例。如果您正苦于以下问题:Java Symbol类的具体用法?Java Symbol怎么用?Java Symbol使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Symbol类属于org.jenkinsci包,在下文中一共展示了Symbol类的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);
        }
    }
 
开发者ID:jenkinsci,项目名称:pipeline-maven-plugin,代码行数:39,代码来源:WithMavenStepGlobalConfigurationTest.java


示例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);
        }
    }
 
开发者ID:jenkinsci,项目名称:pipeline-maven-plugin,代码行数:40,代码来源:WithMavenStepGlobalConfigurationTest.java


示例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);
        }
    }
 
开发者ID:jenkinsci,项目名称:pipeline-maven-plugin,代码行数:36,代码来源:WithMavenStepOnMasterTest.java


示例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);
}
 
开发者ID:jenkinsci,项目名称:pipeline-maven-plugin,代码行数:31,代码来源:WithMavenStepOnMasterTest.java



注:本文中的org.jenkinsci.Symbol类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ScheduledAction类代码示例发布时间:2022-05-21
下一篇:
Java QuitHandler类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap