Package com.sonyericsson.hudson.plugins.gerrit.trigger.events

Examples of com.sonyericsson.hudson.plugins.gerrit.trigger.events.ManualPatchsetCreated


     * @throws Exception if so.
     */
    @Test
    public void testOnStarted() throws Exception {
        AbstractBuild build = mockBuild("projectX", 2);
        ManualPatchsetCreated event = Setup.createManualPatchsetCreated();
        event = spy(event);
        GerritCause cause = new GerritCause(event, false);
        when(build.getCause(GerritCause.class)).thenReturn(cause);
        CauseAction causeAction = mock(CauseAction.class);
        when(causeAction.getCauses()).thenReturn(Collections.<Cause>singletonList(cause));
View Full Code Here


     * @throws Exception if so.
     */
    @Test
    public void testOnStartedSilentMode() throws Exception {
        AbstractBuild build = mockBuild("projectX", 2);
        ManualPatchsetCreated event = Setup.createManualPatchsetCreated();
        event = spy(event);
        GerritCause cause = new GerritCause(event, true);
        when(build.getCause(GerritCause.class)).thenReturn(cause);
        CauseAction causeAction = mock(CauseAction.class);
        when(causeAction.getCauses()).thenReturn(Collections.<Cause>singletonList(cause));
View Full Code Here

     * @throws Exception if so.
     */
    @Test
    public void testOnTriggered() throws Exception {
        AbstractProject project = mockProject("projectX");
        ManualPatchsetCreated event = Setup.createManualPatchsetCreated();
        event = spy(event);

        ToGerritRunListener toGerritRunListener = new ToGerritRunListener();

        toGerritRunListener.onTriggered(project, event);
View Full Code Here

     * @throws Exception if so.
     */
    @Test
    public void testOnRetriggered() throws Exception {
        AbstractProject project = mockProject("projectX");
        ManualPatchsetCreated event = Setup.createManualPatchsetCreated();
        event = spy(event);

        ToGerritRunListener toGerritRunListener = new ToGerritRunListener();

        toGerritRunListener.onRetriggered(project, event, null);
View Full Code Here

     * @throws Exception if so.
     */
    @Test
    public void testAdd() throws Exception {
        TriggerMonitor monitor = new TriggerMonitor();
        ManualPatchsetCreated patch = Setup.createManualPatchsetCreated();
        monitor.add(patch);
        assertEquals(1, monitor.getEvents().size());
        assertSame(patch, monitor.getEvents().get(0).getEvent());
    }
View Full Code Here

     * @throws Exception if so.
     */
    @Test
    public void testContains() throws Exception {
        TriggerMonitor monitor = new TriggerMonitor();
        ManualPatchsetCreated patch = Setup.createManualPatchsetCreated();
        monitor.add(patch);
        assertTrue(monitor.contains(patch));
    }
View Full Code Here

     */
    @SuppressWarnings({"deprecation" })
    @Test
    public void testContainsFalse() throws Exception {
        TriggerMonitor monitor = new TriggerMonitor();
        ManualPatchsetCreated patch = Setup.createManualPatchsetCreated();
        monitor.add(patch);
        ManualPatchsetCreated patch2 = Setup.createManualPatchsetCreated();
        patch2.getChange().setNumber("2");
        assertFalse(monitor.contains(patch2));
    }
View Full Code Here

     * @throws Exception if so.
     */
    @Test
    public void testTriggerScanStarting() throws Exception {
        TriggerMonitor monitor = new TriggerMonitor();
        ManualPatchsetCreated patch = Setup.createManualPatchsetCreated();
        monitor.add(patch);
        monitor.triggerScanStarting(patch);

        TriggerMonitor.EventState state = monitor.getEvents().get(0);

View Full Code Here

     * @throws Exception if so.
     */
    @Test
    public void testTriggerScanStartingFalse() throws Exception {
        TriggerMonitor monitor = new TriggerMonitor();
        ManualPatchsetCreated patch = Setup.createManualPatchsetCreated();
        monitor.add(patch);

        TriggerMonitor.EventState state = monitor.getEvents().get(0);

        assertFalse(state.isTriggerScanStarted());
View Full Code Here

     * @throws Exception if so.
     */
    @Test
    public void testTriggerScanDone() throws Exception {
        TriggerMonitor monitor = new TriggerMonitor();
        ManualPatchsetCreated patch = Setup.createManualPatchsetCreated();
        monitor.add(patch);
        monitor.triggerScanStarting(patch);
        monitor.triggerScanDone(patch);

        TriggerMonitor.EventState state = monitor.getEvents().get(0);
View Full Code Here

TOP

Related Classes of com.sonyericsson.hudson.plugins.gerrit.trigger.events.ManualPatchsetCreated

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.