gerrithudsontrigger/src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/spec/SpecGerritTriggerHudsonTest.java
/**
     * Tests that there are no duplicated listeners when a project is renamed.
     *
     * @throws Exception if so.
     */
Tests that there are no duplicated listeners when a project is renamed.
@throws Exception if so.
Tests that there are no duplicated listeners when a project is renamed . @throws Exception if so .
@LocalData
    public void testProjectRename() throws Exception {
        QueueDecisionHandlerImpl h = QueueDecisionHandlerImpl.all().get(QueueDecisionHandlerImpl.class);
        FreeStyleProject project = DuplicatesUtil.createGerritTriggeredJob(this, "projectX");
        project.renameTo("anotherName");
        configRoundtrip((Item)project);
        assertEquals(0, h.countTrigger);
        PluginImpl p = PluginImpl.getInstance();
        p.triggerEvent(Setup.createPatchsetCreated());
        Thread.sleep(3000); 
        assertEquals(1, h.countTrigger);
    }
@ LocalData public void testProjectRename ( ) throws Exception { QueueDecisionHandlerImpl h = QueueDecisionHandlerImpl . all ( ) . get ( QueueDecisionHandlerImpl . class ) ; FreeStyleProject project = DuplicatesUtil . createGerritTriggeredJob ( this , "projectX" ) ; project . renameTo ( "anotherName" ) ; configRoundtrip ( ( Item ) project ) ; assertEquals ( 0 , h . countTrigger ) ; PluginImpl p = PluginImpl . getInstance ( ) ; p . triggerEvent ( Setup . createPatchsetCreated ( ) ) ; Thread . sleep ( 3000 ) ; assertEquals ( 1 , h . countTrigger ) ; }
Tests that there are no duplicated listeners when a project is renamed.
Tests that there are no duplicated listeners when a project is renamed .
// TODO: is there a better way to wait for the completion of asynchronous event processing?