Package com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data

Examples of com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch


        assertThat(gerritProjects.size(), equalTo(1));
        GerritProject gerritProject = gerritProjects.get(0);
        assertThat(gerritProject.getPattern(), equalTo("project"));
        List<Branch> branches = gerritProject.getBranches();
        assertThat(branches.size(), equalTo(1));
        Branch branch = branches.get(0);
        assertThat(branch.getPattern(), equalTo("bra.*"));
        List<PluginGerritEvent> triggerOnEvents = trigger.getTriggerOnEvents();
        assertThat(triggerOnEvents.size(), equalTo(2));
        assertEquals(triggerOnEvents.get(0).getCorrespondingEventClass(), PatchsetCreated.class);
        assertEquals(triggerOnEvents.get(1).getCorrespondingEventClass(), DraftPublished.class);
    }
View Full Code Here


        assertThat(gerritProjects.size(), equalTo(1));
        GerritProject gerritProject = gerritProjects.get(0);
        assertThat(gerritProject.getPattern(), equalTo("project"));
        List<Branch> branches = gerritProject.getBranches();
        assertThat(branches.size(), equalTo(1));
        Branch branch = branches.get(0);
        assertThat(branch.getPattern(), equalTo(".*er"));
        List<PluginGerritEvent> triggerOnEvents = trigger.getTriggerOnEvents();
        assertThat(triggerOnEvents.size(), equalTo(2));
        assertEquals(triggerOnEvents.get(0).getCorrespondingEventClass(), PatchsetCreated.class);
        assertEquals(triggerOnEvents.get(1).getCorrespondingEventClass(), DraftPublished.class);
    }
View Full Code Here

     * @param compareType the type of the pattern.
     * @return GerritProject the created project.
     */
    private GerritProject createGerritProject(String pattern, CompareType compareType) {
        List<Branch> branches = new LinkedList<Branch>();
        Branch branch = new Branch(compareType, "master");
        branches.add(branch);
        GerritProject config = new GerritProject(CompareType.PLAIN, pattern, branches, null, null, null);
        return config;
    }
View Full Code Here

    public static FreeStyleProject createGerritTriggeredJob(JenkinsRule rule,
            String projectName, String serverName) throws Exception {
        FreeStyleProject p = rule.createFreeStyleProject(projectName);
        List<GerritProject> projects = new LinkedList<GerritProject>();
        projects.add(new GerritProject(CompareType.ANT, "**",
                Collections.singletonList(new Branch(CompareType.ANT, "**")), null, null, null));
        p.addTrigger(new GerritTrigger(projects, null,
                null, null, null, null, null, null, null, null, null, null,
                false, false, true, false, false, null, null, null, null, null, null, null,
                null, serverName, null, null, false, false, null, null));
        rule.submit(rule.createWebClient().getPage(p, "configure").getFormByName("config"));
View Full Code Here

            String name, String serverName)
            throws Exception {
        FreeStyleProject p = rule.createFreeStyleProject(name);
        List<GerritProject> projects = new LinkedList<GerritProject>();
        projects.add(new GerritProject(CompareType.ANT, "**",
                Collections.singletonList(new Branch(CompareType.ANT, "**")), null, null, null));
        PluginCommentAddedEvent event = new PluginCommentAddedEvent("CRVW", "1");
        List<PluginGerritEvent> list = new LinkedList<PluginGerritEvent>();
        list.add(event);
        p.addTrigger(new GerritTrigger(projects, null,
                null, null, null, null, null, null, null, null, null, null,
View Full Code Here

          dynamicGerritProject = new GerritProject(type, text, branches, topics, filePaths, forbiddenFilePaths);
        } else if (SHORTNAME_BRANCH.equals(item)) { // Branch
          if (branches == null) {
            throw new ParseException("Line " + lineNr + ": attempt to use 'Branch' before 'Project'", lineNr);
          }
          Branch branch = new Branch(type, text);
          branches.add(branch);
          dynamicGerritProject.setBranches(branches);
        } else if (SHORTNAME_TOPIC.equals(item)) { // Topic
            if (topics == null) {
                throw new ParseException("Line " + lineNr + ": attempt to use 'Topic' before 'Project'", lineNr);
View Full Code Here

        FreeStyleProject project = createFreeStyleProject();
        GerritTrigger trigger = Setup.createDefaultTrigger(project);
        trigger.setGerritProjects(Collections.singletonList(
                new GerritProject(CompareType.PLAIN, event.getChange().getProject(),
                        Collections.singletonList(new Branch(CompareType.PLAIN, event.getChange().getBranch())),
                        null, null, null)
        ));
        trigger.setSilentMode(false);
        trigger.setGerritBuildSuccessfulCodeReviewValue(1);
        trigger.setGerritBuildSuccessfulVerifiedValue(1);
View Full Code Here

TOP

Related Classes of com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.