Package com.sonymobile.tools.gerrit.gerritevents.dto.events

Examples of com.sonymobile.tools.gerrit.gerritevents.dto.events.PatchsetCreated


     * Tests the isBuilding method of the class {@link BuildMemory}.
     * With one started project in memory.
     */
    @Test
    public void testIsBuildingProjectTrue() {
        PatchsetCreated event = Setup.createPatchsetCreated();

        AbstractProject project = mock(AbstractProject.class);
        AbstractBuild build = mock(AbstractBuild.class);
        when(build.getProject()).thenReturn(project);

View Full Code Here


     * Tests the isBuilding method of the class {@link BuildMemory}.
     * With two events with started builds in memory.
     */
    @Test
    public void testIsBuildingProjectTrue2() {
        PatchsetCreated event = Setup.createPatchsetCreated();

        AbstractProject project = mock(AbstractProject.class);
        AbstractBuild build = mock(AbstractBuild.class);
        when(build.getProject()).thenReturn(project);

        BuildMemory instance = new BuildMemory();
        instance.started(event, build);

        PatchsetCreated event2 = Setup.createPatchsetCreated();
        event2.getChange().setNumber(event.getChange().getNumber() + 34);
        AbstractProject project2 = mock(AbstractProject.class);
        build = mock(AbstractBuild.class);
        when(build.getProject()).thenReturn(project2);
        instance.started(event2, build);

View Full Code Here

     * Tests the isBuilding method of the class {@link BuildMemory}.
     * With an empty memory.
     */
    @Test
    public void testIsBuildingProjectFalse() {
        PatchsetCreated event = Setup.createPatchsetCreated();
        BuildMemory instance = new BuildMemory();
        AbstractProject project = mock(AbstractProject.class);
        assertFalse(instance.isBuilding(event, project));
    }
View Full Code Here

     * Tests the isBuilding method of the class {@link BuildMemory}.
     * With a triggered build in memory.
     */
    @Test
    public void testIsBuildingProjectTriggeredTrue() {
        PatchsetCreated event = Setup.createPatchsetCreated();
        BuildMemory instance = new BuildMemory();
        AbstractProject project = mock(AbstractProject.class);
        instance.triggered(event, project);
        assertTrue(instance.isBuilding(event, project));
    }
View Full Code Here

     * Tests the isBuilding method of the class {@link BuildMemory}.
     * With a completed build in memory.
     */
    @Test
    public void testIsBuildingProjectCompletedFalse() {
        PatchsetCreated event = Setup.createPatchsetCreated();
        BuildMemory instance = new BuildMemory();
        AbstractProject project = mock(AbstractProject.class);
        AbstractBuild build = mock(AbstractBuild.class);
        when(build.getProject()).thenReturn(project);
        when(build.getResult()).thenReturn(Result.UNSTABLE);
View Full Code Here

     * Tests the retriggered method of the class {@link BuildMemory}.
     * With no previous memory and an empty list of "others".
     */
    @Test
    public void testRetriggeredNoMemoryOneProject() {
        PatchsetCreated event = Setup.createPatchsetCreated();
        BuildMemory instance = new BuildMemory();
        AbstractProject project = mock(AbstractProject.class);
        instance.retriggered(event, project, Collections.EMPTY_LIST);
        MemoryImprint memory = instance.getMemoryImprint(event);
        assertNotNull(memory);
View Full Code Here

     * Tests the retriggered method of the class {@link BuildMemory}.
     * With no previous memory and null list of "others".
     */
    @Test
    public void testRetriggeredNoMemoryOneProjectNullOthers() {
        PatchsetCreated event = Setup.createPatchsetCreated();
        BuildMemory instance = new BuildMemory();
        AbstractProject project = mock(AbstractProject.class);
        instance.retriggered(event, project, null);
        MemoryImprint memory = instance.getMemoryImprint(event);
        assertNotNull(memory);
View Full Code Here

     * Tests the retriggered method of the class {@link BuildMemory}.
     * With two started builds and the one to be retriggered as completed already in memory.
     */
    @Test
    public void testRetriggeredExistingMemory() {
        PatchsetCreated event = Setup.createPatchsetCreated();
        BuildMemory instance = new BuildMemory();

        AbstractProject project = mock(AbstractProject.class);
        AbstractBuild build = mock(AbstractBuild.class);
        when(build.getProject()).thenReturn(project);
View Full Code Here

     * Expected outcome is that
     * {@link BuildMemory.MemoryImprint#wereAllBuildsSuccessful()} will return true.
     */
    @Test
    public void testWereAllBuildsSuccessfulOneUnstableSkipped() {
        PatchsetCreated event = Setup.createPatchsetCreated();
        BuildMemory instance = new BuildMemory();

        AbstractProject project = mock(AbstractProject.class);
        SkipVote skipVote = new SkipVote(false, false, false, false);
        GerritTrigger trigger = mock(GerritTrigger.class);
View Full Code Here

     * Expected outcome is that
     * {@link BuildMemory.MemoryImprint#wereAllBuildsSuccessful()} will return true.
     */
    @Test
    public void testWereAllBuildsSuccessfulOneFailedSkipped() {
        PatchsetCreated event = Setup.createPatchsetCreated();
        BuildMemory instance = new BuildMemory();

        AbstractProject project = mock(AbstractProject.class);
        SkipVote skipVote = new SkipVote(false, false, false, false);
        GerritTrigger trigger = mock(GerritTrigger.class);
View Full Code Here

TOP

Related Classes of com.sonymobile.tools.gerrit.gerritevents.dto.events.PatchsetCreated

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.