Package org.apache.ivy.core.module.descriptor

Examples of org.apache.ivy.core.module.descriptor.Artifact


        ArtifactDownloadReport[] dReports = report.getConfigurationReport("default")
                .getDownloadReports(ModuleRevisionId.newInstance("org15", "mod15.1", "1.1"));
        assertNotNull(dReports);
        assertEquals("number of downloaded artifacts not correct", 1, dReports.length);

        Artifact artifact = dReports[0].getArtifact();
        assertNotNull(artifact);

        String cachePath = getArchivePathInCache(artifact);
        assertTrue("artifact name has not been retained: " + cachePath,
            cachePath.endsWith("library.jar"));
View Full Code Here


        ArtifactDownloadReport[] dReports = report.getConfigurationReport("default")
                .getDownloadReports(ModuleRevisionId.newInstance("org15", "mod15.3", "1.1", extra));
        assertNotNull(dReports);
        assertEquals("number of downloaded artifacts not correct", 1, dReports.length);

        Artifact artifact = dReports[0].getArtifact();
        assertNotNull(artifact);

        String cachePath = getArchivePathInCache(artifact);
        assertTrue("artifact name has not been retained: " + cachePath,
            cachePath.endsWith("library.jar"));
View Full Code Here

        ArtifactDownloadReport[] dReports = report.getConfigurationReport("default")
                .getDownloadReports(ModuleRevisionId.newInstance("org1", "mod1.2", "2.0"));
        assertNotNull(dReports);
        assertEquals("number of downloaded artifacts not correct", 1, dReports.length);

        Artifact artifact = dReports[0].getArtifact();
        assertNotNull(artifact);

        String expectedLocation = new File("test/repositories/1/org1/mod1.2/jars/mod1.2-2.0.jar")
                .getAbsolutePath();
View Full Code Here

        assertEquals("number of downloaded artifacts not correct.", 1, dReports.length);
        assertEquals(
            "download status not correct: should not download the artifact in useOrigin mode.",
            DownloadStatus.NO, dReports[0].getDownloadStatus());

        Artifact artifact = dReports[0].getArtifact();
        assertNotNull(artifact);

        String expectedLocation = new File("test/repositories/1/org1/mod1.2/jars/mod1.2-2.0.jar")
                .getAbsolutePath();
View Full Code Here

    // helper methods to ease the tests
    // //////////////////////////////////////////////////////////

    private void assertContainsArtifact(String org, String module, String rev, String artName,
            String type, String ext, ConfigurationResolveReport conf) {
        Artifact art = getArtifact(org, module, rev, artName, type, ext);
        assertContainsArtifact(conf, art);
    }
View Full Code Here

        }
    }

    private void assertDoesntContainArtifact(String org, String module, String rev, String artName,
            String type, String ext, ConfigurationResolveReport conf) {
        Artifact art = getArtifact(org, module, rev, artName, type, ext);
        if (containsArtifact(art, conf.getDownloadedArtifactsReports())) {
            fail("artifact " + art + " should NOT be part of " + conf.getConfiguration() + " from "
                    + conf.getModuleDescriptor().getModuleRevisionId());
        }
    }
View Full Code Here

                artName, type, ext);
    }

    private boolean containsArtifact(Artifact art, ArtifactDownloadReport[] adr) {
        for (int i = 0; i < adr.length; i++) {
            Artifact artifact = adr[i].getArtifact();
            if (artifact.getModuleRevisionId().equals(art.getModuleRevisionId())
                    && artifact.getName().equals(art.getName())
                    && artifact.getType().equals(art.getType())
                    && artifact.getExt().equals(art.getExt())) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

        cacheManager.setSettings(settings);
        cacheManager.setBasedir(f);

        artifact = createArtifact("org", "module", "rev", "name", "type", "ext");

        Artifact originArtifact = createArtifact("org", "module", "rev", "name", "pom.original",
            "pom");
        origin = new ArtifactOrigin(originArtifact, true, "file:/some/where.pom");

        cacheManager.saveArtifactOrigin(originArtifact, origin);
        cacheManager.saveArtifactOrigin(artifact, origin);
View Full Code Here

            // test the proper sequence of events by comparing the number of pre-events,
            // post-events, and actual publications.
            assertTrue("event is of correct base type", event instanceof PublishEvent);

            PublishEvent pubEvent = (PublishEvent) event;
            Artifact expectedArtifact = test.currentTestCase.expectedArtifact;
            File expectedData = test.currentTestCase.expectedData;

            assertSameArtifact("event records correct artifact", expectedArtifact,
                pubEvent.getArtifact());
            try {
                assertEquals("event records correct file", expectedData.getCanonicalPath(),
                    pubEvent.getData().getCanonicalPath());

                assertEquals("event records correct overwrite setting", test.expectedOverwrite,
                    pubEvent.isOverwrite());
                assertSame("event presents correct resolver", resolver, pubEvent.getResolver());

                String[] attributes = {"organisation", "module", "revision", "artifact", "type",
                        "ext", "resolver", "overwrite"};
                String[] values = {"apache", "PublishEventsTest", "1.0-dev",
                        expectedArtifact.getName(), expectedArtifact.getType(),
                        expectedArtifact.getExt(), "default",
                        String.valueOf(test.expectedOverwrite)};

                for (int i = 0; i < attributes.length; ++i) {
                    assertEquals("event declares correct value for " + attributes[i], values[i],
                        event.getAttributes().get(attributes[i]));
View Full Code Here

            StartArtifactPublishEvent startEvent = (StartArtifactPublishEvent) event;

            // verify that the artifact being publish was in the expected set. set the
            // 'currentTestCase'
            // pointer so that the resolver and post-publish trigger can check against it.
            Artifact artifact = startEvent.getArtifact();
            assertNotNull("event defines artifact", artifact);

            PublishTestCase currentTestCase = (PublishTestCase) test.expectedPublications
                    .remove(artifact.getId());
            assertNotNull("artifact " + artifact.getId() + " was expected for publication",
                currentTestCase);
            assertFalse("current publication has not been visited yet",
                currentTestCase.preTriggerFired);
            assertFalse("current publication has not been visited yet", currentTestCase.published);
            assertFalse("current publication has not been visited yet",
View Full Code Here

TOP

Related Classes of org.apache.ivy.core.module.descriptor.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.