Search in sources :

Example 6 with BuildDependency

use of org.jfrog.build.api.dependency.BuildDependency in project build-info by JFrogDev.

the class BuildDependencyBuilderTest method testBuilderSetters.

/**
 * Validates the build dependency values after using the builder setters
 */
public void testBuilderSetters() {
    String name = "foo";
    String number = "123";
    String url = "http://myhostA.com/artifactory/builds/foo/123/";
    BuildDependency buildDependency = new BuildDependencyBuilder().name(name).number(number).started(timestamp).url(url).build();
    assertEquals(buildDependency.getName(), name, "Unexpected name.");
    assertEquals(buildDependency.getNumber(), number, "Unexpected number.");
    assertEquals(buildDependency.getStarted(), timestamp, "Unexpected started.");
    assertEquals(buildDependency.getUrl(), url, "Unexpected url.");
}
Also used : BuildDependencyBuilder(org.jfrog.build.api.builder.dependency.BuildDependencyBuilder) BuildDependency(org.jfrog.build.api.dependency.BuildDependency)

Example 7 with BuildDependency

use of org.jfrog.build.api.dependency.BuildDependency in project build-info by JFrogDev.

the class BuildTest method testAddBuildDependencyMethod.

public void testAddBuildDependencyMethod() {
    Build build = new Build();
    assertNull(build.getBuildDependencies(), "Default buildDependencies list should be null.");
    BuildDependency buildDependency = new BuildDependencyBuilder().name("foo").number("123").startedDate(new Date()).build();
    build.addBuildDependency(buildDependency);
    assertFalse(build.getBuildDependencies().isEmpty(), "BuildDependency object should have been added.");
    assertEquals(getOnlyElement(build.getBuildDependencies()), buildDependency, "Unexpected build dependency object.");
    BuildDependency otherBuildDependency = new BuildDependencyBuilder().name("bar").number("456").startedDate(new Date()).build();
    build.addBuildDependency(otherBuildDependency);
    assertEquals(build.getBuildDependencies().size(), 2, "Second BuildDependency object should have been added.");
    assertEquals(getLast(build.getBuildDependencies()), otherBuildDependency, "Unexpected build dependency object.");
}
Also used : BuildDependencyBuilder(org.jfrog.build.api.builder.dependency.BuildDependencyBuilder) BuildDependency(org.jfrog.build.api.dependency.BuildDependency) Date(java.util.Date)

Aggregations

BuildDependency (org.jfrog.build.api.dependency.BuildDependency)7 BuildDependencyBuilder (org.jfrog.build.api.builder.dependency.BuildDependencyBuilder)4 Date (java.util.Date)3 SimpleDateFormat (java.text.SimpleDateFormat)1 Properties (java.util.Properties)1 PromotionStatus (org.jfrog.build.api.release.PromotionStatus)1