Examples of PromotionStatus


Examples of org.jfrog.build.api.release.PromotionStatus

     */
    public void testBuilderAddMethod() {
        Module module = new Module();
        String propertyKey = "key";
        String propertyValue = "value";
        PromotionStatus promotionStatus = new PromotionStatusBuilder("momo").timestampDate(new Date()).build();

        Build build = new BuildInfoBuilder("test").number("4").started("test").addModule(module)
                .addProperty(propertyKey, propertyValue).addStatus(promotionStatus).build();
        List<Module> modules = build.getModules();
        assertFalse(modules.isEmpty(), "A build module should have been added.");
View Full Code Here

Examples of org.jfrog.build.api.release.PromotionStatus

    public void testStatusAddMethod() {
        Build build = new Build();
        assertNull(build.getStatuses(), "Default status list should be null.");

        PromotionStatus promotionStatus = new PromotionStatusBuilder(Promotion.RELEASED).repository("bla").
                timestamp("bla").user("bla").build();
        build.addStatus(promotionStatus);

        assertFalse(build.getStatuses().isEmpty(), "Status object should have been added.");
        assertEquals(build.getStatuses().get(0), promotionStatus, "Unexpected status object.");

        PromotionStatus anotherPromotionStatus = new PromotionStatusBuilder(Promotion.RELEASED).repository("bla").
                timestamp("bla").user("bla").build();
        build.addStatus(anotherPromotionStatus);

        assertEquals(build.getStatuses().size(), 2, "Second status object should have been added.");
        assertEquals(build.getStatuses().get(1), anotherPromotionStatus, "Unexpected status object.");
View Full Code Here

Examples of org.jfrog.build.api.release.PromotionStatus

*/
@Test
public class PromotionStatusTest {

    public void testConstructor() {
        PromotionStatus promotionStatus =
                new PromotionStatus(Promotion.ROLLED_BACK, "momo", "popo", "koko", "jojo", "bobo");
        assertEquals(promotionStatus.getStatus(), Promotion.ROLLED_BACK, "Unexpected status.");
        assertEquals(promotionStatus.getComment(), "momo", "Unexpected comment.");
        assertEquals(promotionStatus.getRepository(), "popo", "Unexpected repository.");
        assertEquals(promotionStatus.getTimestamp(), "koko", "Unexpected timestamp.");
        assertEquals(promotionStatus.getUser(), "jojo", "Unexpected user.");
        assertEquals(promotionStatus.getCiUser(), "bobo", "Unexpected user.");
    }
View Full Code Here

Examples of org.jfrog.build.api.release.PromotionStatus

*/
@Test
public class PromotionStatusBuilderTest {

    public void testDefaultValues() {
        PromotionStatus promotionStatus = new PromotionStatusBuilder(Promotion.RELEASED).timestamp("bla").build();
        assertEquals(promotionStatus.getStatus(), Promotion.RELEASED, "Unexpected status type.");
        assertNull(promotionStatus.getComment(), "Expected null comment by default.");
        assertNull(promotionStatus.getRepository(), "Expected null repository by default.");
        assertNull(promotionStatus.getUser(), "Expected null user by default.");
        assertNull(promotionStatus.getCiUser(), "Expected null CI user by default.");
        assertEquals(promotionStatus.getTimestamp(), "bla", "Unexpected status timestamp.");
    }
View Full Code Here

Examples of org.jfrog.build.api.release.PromotionStatus

    }

    public void testNormalValues() {
        PromotionStatusBuilder builderPromotion = new PromotionStatusBuilder(Promotion.ROLLED_BACK).comment("momo").
                repository("popo").timestamp("koko").user("jojo").ciUser("bobo");
        PromotionStatus promotionStatus = builderPromotion.build();
        assertEquals(promotionStatus.getStatus(), Promotion.ROLLED_BACK, "Unexpected status.");
        assertEquals(promotionStatus.getComment(), "momo", "Unexpected comment.");
        assertEquals(promotionStatus.getRepository(), "popo", "Unexpected repository.");
        assertEquals(promotionStatus.getTimestamp(), "koko", "Unexpected timestamp.");
        assertEquals(promotionStatus.getUser(), "jojo", "Unexpected user.");
        assertEquals(promotionStatus.getCiUser(), "bobo", "Unexpected ci user.");

        Date date = new Date();
        String expectedTimeStamp = new SimpleDateFormat(Build.STARTED_FORMAT).format(date);
        builderPromotion.timestampDate(date);
        promotionStatus = builderPromotion.build();
        assertEquals(promotionStatus.getTimestamp(), expectedTimeStamp, "Unexpected timestamp.");
    }
View Full Code Here

Examples of org.jfrog.build.api.release.PromotionStatus

     */
    public void testBuilderAddMethod() {
        Module module = new Module();
        String propertyKey = "key";
        String propertyValue = "value";
        PromotionStatus promotionStatus = new PromotionStatusBuilder("momo").timestampDate(new Date()).build();

        Build build = new BuildInfoBuilder("test").number("4").started("test").addModule(module)
                .addProperty(propertyKey, propertyValue).addStatus(promotionStatus).build();
        List<Module> modules = build.getModules();
        assertFalse(modules.isEmpty(), "A build module should have been added.");
View Full Code Here

Examples of org.jfrog.build.api.release.PromotionStatus

            throw new IllegalArgumentException("Status must have a type.");
        }
        if (timestamp == null) {
            throw new IllegalArgumentException("Status must have a timestamp.");
        }
        return new PromotionStatus(status, comment, repository, timestamp, user, ciUser);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.