Package org.jfrog.build.api

Examples of org.jfrog.build.api.Artifact


        File artifactFile = new File(file);
        Map<String, String> checksums = calculateFileChecksum(artifactFile);
        String md5 = checksums.get(MD5);
        String sha1 = checksums.get(SHA1);
        artifactBuilder.md5(md5).sha1(sha1);
        Artifact artifact = artifactBuilder.build();
        if (excludeArtifactsFromBuild && PatternMatcher.pathConflicts(fullPath, patterns)) {
            module.getExcludedArtifacts().add(artifact);
        } else {
            module.getArtifacts().add(artifact);
        }
View Full Code Here


    /**
     * Validates the artifact values when using the defaults
     */
    public void testDefaultBuild() {
        Artifact artifact = new ArtifactBuilder("name").build();

        assertEquals(artifact.getName(), "name", "Unexpected artifact name.");
        assertNull(artifact.getType(), "Default artifact type.");
        assertNull(artifact.getSha1(), "Default artifact SHA1 checksum should be null.");
        assertNull(artifact.getMd5(), "Default artifact MD5 checksum should be null.");
        assertNull(artifact.getProperties(), "Default artifact properties should be null.");
    }
View Full Code Here

        String type = "bob";
        String sha1 = "pop";
        String md5 = "shmop";
        Properties properties = new Properties();

        Artifact artifact = new ArtifactBuilder(name).type(type).sha1(sha1).md5(md5).properties(properties).
                build();

        assertEquals(artifact.getName(), name, "Unexpected artifact ID.");
        assertEquals(artifact.getType(), type, "Unexpected artifact type.");
        assertEquals(artifact.getSha1(), sha1, "Unexpected artifact SHA1 checksum.");
        assertEquals(artifact.getMd5(), md5, "Unexpected artifact SHA1 checksum.");
        assertEquals(artifact.getProperties(), properties, "Unexpected artifact properties.");
        assertTrue(artifact.getProperties().isEmpty(), "Artifact properties list should not have been populated.");
    }
View Full Code Here

     */
    public void testBuilderAddMethods() {
        String propertyKey = "key";
        String propertyValue = "value";

        Artifact artifact = new ArtifactBuilder("name").addProperty(propertyKey, propertyValue).build();
        assertTrue(artifact.getProperties().containsKey(propertyKey), "An artifact property should have been added.");
        assertEquals(artifact.getProperties().get(propertyKey), propertyValue, "Unexpected artifact property value.");
    }
View Full Code Here

     */
    public Artifact build() {
        if (StringUtils.isBlank(name)) {
            throw new IllegalArgumentException("Artifact must have a name");
        }
        Artifact artifact = new Artifact();
        artifact.setName(name);
        artifact.setType(type);
        artifact.setSha1(sha1);
        artifact.setMd5(md5);
        artifact.setProperties(properties);
        return artifact;
    }
View Full Code Here

    /**
     * Validates the module values after using the builder add methods
     */
    public void testBuilderAddMethods() {
        Artifact artifact = new Artifact();
        Dependency dependency = new Dependency();
        String propertyKey = "key";
        String propertyValue = "value";

        Module module = new ModuleBuilder().id("test").addArtifact(artifact).addDependency(dependency).
View Full Code Here

TOP

Related Classes of org.jfrog.build.api.Artifact

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.