Package org.jfrog.build.api.release

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


*/
@Test
public class PromotionTest {

    public void testDefaultValues() {
        Promotion promotion = new Promotion();
        assertNull(promotion.getStatus(), "Unexpected default status.");
        assertNull(promotion.getComment(), "Unexpected default comment.");
        assertNull(promotion.getCiUser(), "Unexpected default ci user.");
        assertNull(promotion.getTimestamp(), "Unexpected default timestamp.");
        assertFalse(promotion.isDryRun(), "Unexpected default dry run state.");
        assertNull(promotion.getTargetRepo(), "Unexpected default target repo.");
        assertFalse(promotion.isCopy(), "Unexpected default copy state.");
        assertTrue(promotion.isArtifacts(), "Unexpected default artifacts state.");
        assertFalse(promotion.isDependencies(), "Unexpected default dependencies state.");
        assertNull(promotion.getScopes(), "Unexpected default scopes.");
        assertNull(promotion.getProperties(), "Unexpected default properties.");
    }
View Full Code Here


    public void testConstructor() {
        Set<String> scopes = Sets.newHashSet();
        Map<String, Collection<String>> properties = Maps.newHashMap();

        Promotion promotion = new Promotion(Promotion.ROLLED_BACK, "comment", "ciUser", "timestamp",
                true, "targetRepo", false, true, false, scopes, properties, false);

        assertEquals(promotion.getStatus(), Promotion.ROLLED_BACK, "Unexpected status.");
        assertEquals(promotion.getComment(), "comment", "Unexpected comment.");
        assertEquals(promotion.getCiUser(), "ciUser", "Unexpected ci user.");
        assertEquals(promotion.getTimestamp(), "timestamp", "Unexpected timestamp.");
        assertTrue(promotion.isDryRun(), "Unexpected dry run state.");
        assertEquals(promotion.getTargetRepo(), "targetRepo", "Unexpected target repo.");
        assertFalse(promotion.isCopy(), "Unexpected copy state.");
        assertTrue(promotion.isArtifacts(), "Unexpected artifacts state.");
        assertFalse(promotion.isDependencies(), "Unexpected dependencies state.");
        assertEquals(promotion.getScopes(), scopes, "Unexpected scopes.");
        assertEquals(promotion.getProperties(), properties, "Unexpected properties.");
        assertFalse(promotion.isFailFast(), "Unexpected fail-fast state.");
    }
View Full Code Here

    public void testSetters() {
        Set<String> scopes = Sets.newHashSet();
        Map<String, Collection<String>> properties = Maps.newHashMap();

        Promotion promotion = new Promotion();
        promotion.setStatus(Promotion.ROLLED_BACK);
        promotion.setComment("comment");
        promotion.setCiUser("ciUser");
        promotion.setTimestamp("timestamp");
        promotion.setDryRun(true);
        promotion.setTargetRepo("targetRepo");
        promotion.setCopy(false);
        promotion.setArtifacts(true);
        promotion.setDependencies(false);
        promotion.setScopes(scopes);
        promotion.setProperties(properties);
        promotion.setFailFast(false);

        assertEquals(promotion.getStatus(), Promotion.ROLLED_BACK, "Unexpected status.");
        assertEquals(promotion.getComment(), "comment", "Unexpected comment.");
        assertEquals(promotion.getCiUser(), "ciUser", "Unexpected ci user.");
        assertEquals(promotion.getTimestamp(), "timestamp", "Unexpected timestamp.");
        assertTrue(promotion.isDryRun(), "Unexpected dry run state.");
        assertEquals(promotion.getTargetRepo(), "targetRepo", "Unexpected target repo.");
        assertFalse(promotion.isCopy(), "Unexpected copy state.");
        assertTrue(promotion.isArtifacts(), "Unexpected artifacts state.");
        assertFalse(promotion.isDependencies(), "Unexpected dependencies state.");
        assertEquals(promotion.getScopes(), scopes, "Unexpected scopes.");
        assertEquals(promotion.getProperties(), properties, "Unexpected properties.");
        assertFalse(promotion.isFailFast(), "Unexpected fail-fast state.");
    }
View Full Code Here

        assertEquals(promotion.getProperties(), properties, "Unexpected properties.");
        assertFalse(promotion.isFailFast(), "Unexpected fail-fast state.");
    }

    public void testNullTimestampDateGetter() {
        Promotion promotion = new Promotion(null, null, null, null, true, null, true, true, true, null, null, false);
        assertNull(promotion.getTimestampDate(), "No timestamp was set. Should have received null");
    }
View Full Code Here

    public void testTimestampDateGetters() {
        SimpleDateFormat format = new SimpleDateFormat(Build.STARTED_FORMAT);

        Date timestampDate = new Date();

        Promotion promotion = new Promotion(null, null, null, format.format(timestampDate), true, null, true, true,
                true, null, null, false);
        assertEquals(promotion.getTimestampDate(), timestampDate, "Unexpected timestamp date.");
    }
View Full Code Here

*/
@Test
public class PromotionBuilderTest {

    public void testDefaultValues() {
        Promotion promotion = new PromotionBuilder().build();
        assertNull(promotion.getStatus(), "Unexpected default status.");
        assertNull(promotion.getComment(), "Unexpected default comment.");
        assertNull(promotion.getCiUser(), "Unexpected default ci user.");
        assertNull(promotion.getTimestamp(), "Unexpected default timestamp.");
        assertFalse(promotion.isDryRun(), "Unexpected default dry run state.");
        assertNull(promotion.getTargetRepo(), "Unexpected default target repo.");
        assertFalse(promotion.isCopy(), "Unexpected default copy state.");
        assertTrue(promotion.isArtifacts(), "Unexpected default artifacts state.");
        assertFalse(promotion.isDependencies(), "Unexpected default dependencies state.");
        assertNull(promotion.getScopes(), "Unexpected default scopes.");
        assertNull(promotion.getProperties(), "Unexpected default properties.");
        assertTrue(promotion.isFailFast(), "Unexpected default fail-fast state.");
    }
View Full Code Here

    public void testNormalValues() {
        Set<String> scopes = Sets.newHashSet();
        Map<String, Collection<String>> properties = Maps.newHashMap();

        Promotion promotion = new PromotionBuilder().status(Promotion.ROLLED_BACK).comment("comment").ciUser("ciUser").
                timestamp("timestamp").dryRun(true).targetRepo("targetRepo").copy(false).artifacts(true).
                dependencies(false).scopes(scopes).properties(properties).failFast(false).build();

        assertEquals(promotion.getStatus(), Promotion.ROLLED_BACK, "Unexpected status.");
        assertEquals(promotion.getComment(), "comment", "Unexpected comment.");
        assertEquals(promotion.getCiUser(), "ciUser", "Unexpected ci user.");
        assertEquals(promotion.getTimestamp(), "timestamp", "Unexpected timestamp.");
        assertTrue(promotion.isDryRun(), "Unexpected dry run state.");
        assertEquals(promotion.getTargetRepo(), "targetRepo", "Unexpected target repo.");
        assertFalse(promotion.isCopy(), "Unexpected copy state.");
        assertTrue(promotion.isArtifacts(), "Unexpected artifacts state.");
        assertFalse(promotion.isDependencies(), "Unexpected dependencies state.");
        assertEquals(promotion.getScopes(), scopes, "Unexpected scopes.");
        assertEquals(promotion.getProperties(), properties, "Unexpected properties.");
        assertFalse(promotion.isFailFast(), "Unexpected fail-fast state.");
    }
View Full Code Here

        this.failFast = failFast;
        return this;
    }

    public Promotion build() {
        return new Promotion(status, comment, ciUser, timestamp, dryRun, targetRepo, copy, artifacts, dependencies,
                scopes, properties, failFast);
    }
View Full Code Here

        assertEquals(promotion.getProperties(), properties, "Unexpected properties.");
        assertFalse(promotion.isFailFast(), "Unexpected fail-fast state.");
    }

    public void testAddScopesAndPropertiesToEmptyDefaults() {
        Promotion build = new PromotionBuilder().addProperty("momo", "popo").addScope("koko").build();

        Map<String, Collection<String>> properties = build.getProperties();
        Set<String> scopes = build.getScopes();

        assertNotNull(properties, "Properties multimap should have been created.");
        assertNotNull(scopes, "Scope set should have been created.");

        assertFalse(properties.isEmpty(), "Added properties should have been added.");
View Full Code Here

    public void testAddScopesAndPropertiesToExistingCollections() {
        Set<String> initialScopes = Sets.newHashSet("koko");
        Map<String, Collection<String>> initialProperties = Maps.newHashMap();
        initialProperties.put("momo", Sets.<String>newHashSet("popo"));

        Promotion build = new PromotionBuilder().properties(initialProperties).addProperty("jojo", "lolo").
                scopes(initialScopes).addScope("bobo").build();

        Map<String, Collection<String>> properties = build.getProperties();
        Set<String> scopes = build.getScopes();

        assertNotNull(properties, "Properties multimap should have been created.");
        assertNotNull(scopes, "Scope set should have been created.");

        assertFalse(properties.isEmpty(), "Added properties should have been added.");
View Full Code Here

TOP

Related Classes of org.jfrog.build.api.release.Promotion

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.