gerrithudsontrigger/src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/spec/SpecGerritTriggerHudsonTest.java
/**
     * Tests that a comment added triggers a build correctly.
     *
     * @throws Exception if so.
     */
Tests that a comment added triggers a build correctly.
@throws Exception if so.
Tests that a comment added triggers a build correctly . @throws Exception if so .
@LocalData
    public void testTriggerOnCommentAdded() throws Exception {
        PluginImpl.getInstance().getConfig().setCategories(Setup.createCodeReviewVerdictCategoryList());
        FreeStyleProject project = DuplicatesUtil.createGerritTriggeredJobForCommentAdded(this, "projectX");
        project.getBuildersList().add(new SleepBuilder(2000));
        server.waitForCommand(GERRIT_STREAM_EVENTS, 2000);
        CommentAdded firstEvent = Setup.createCommentAdded();
        PluginImpl.getInstance().triggerEvent(firstEvent);
        RunList<FreeStyleBuild> builds = DuplicatesUtil.waitForBuilds(project, 1, 10000);
        assertEquals(1, builds.size());
        assertSame(Result.SUCCESS, builds.getLastBuild().getResult());
    }
@ LocalData public void testTriggerOnCommentAdded ( ) throws Exception { PluginImpl . getInstance ( ) . getConfig ( ) . setCategories ( Setup . createCodeReviewVerdictCategoryList ( ) ) ; FreeStyleProject project = DuplicatesUtil . createGerritTriggeredJobForCommentAdded ( this , "projectX" ) ; project . getBuildersList ( ) . add ( new SleepBuilder ( 2000 ) ) ; server . waitForCommand ( GERRIT_STREAM_EVENTS , 2000 ) ; CommentAdded firstEvent = Setup . createCommentAdded ( ) ; PluginImpl . getInstance ( ) . triggerEvent ( firstEvent ) ; RunList < FreeStyleBuild > builds = DuplicatesUtil . waitForBuilds ( project , 1 , 10000 ) ; assertEquals ( 1 , builds . size ( ) ) ; assertSame ( Result . SUCCESS , builds . getLastBuild ( ) . getResult ( ) ) ; }
Tests that a comment added triggers a build correctly.
Tests that a comment added triggers a build correctly .