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

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


                false), _data);
        assertNotNull(rmr);
        assertEquals(mrid, rmr.getId());
        assertEquals(2, rmr.getDescriptor().getDependencies().length);

        DefaultArtifact artifact = new DefaultArtifact(mrid, rmr.getPublicationDate(),
                "commons-cli", "jar", "jar");
        DownloadReport report = resolver.download(new Artifact[] {artifact}, new DownloadOptions(
                _settings, _cache));
        assertNotNull(report);
View Full Code Here


            moduleRevision.getAttributes());
    }

    public static String substitute(String pattern, ModuleRevisionId moduleRevision,
            String artifact, String type, String ext) {
        return substitute(pattern, moduleRevision, new DefaultArtifact(moduleRevision, null,
                artifact, type, ext), null);
    }
View Full Code Here

        // Called by substituteTokens only if the original artifact name is needed
        public String toString() {
            if (origin == null) {
                ModuleRevisionId revId = ModuleRevisionId.newInstance(org, moduleName, branch,
                    revision);
                Artifact artifact = new DefaultArtifact(revId, null, artifactName, artifactType,
                        artifactExt);

                CacheManager cacheManager = IvyContext.getContext().getCacheManager();

                origin = cacheManager.getSavedArtifactOrigin(artifact);
View Full Code Here

        assertEquals(mrid, rmr.getId());
        Date pubdate = new GregorianCalendar(2004, 10, 1, 11, 0, 0).getTime();
        assertEquals(pubdate, rmr.getPublicationDate());

        // test to ask to download
        DefaultArtifact artifact = new DefaultArtifact(mrid, pubdate, "mod1.1", "jar", "jar");
        DownloadReport report = resolver.download(new Artifact[] {artifact},
            getDownloadOptions(false));
        assertNotNull(report);

        assertEquals(1, report.getArtifactsReports().length);
View Full Code Here

        rmr = resolver.getDependency(new DefaultDependencyDescriptor(mrid, false), data);
        assertNull(rmr);
        resolver.setChecksums("none");
        rmr = resolver.getDependency(new DefaultDependencyDescriptor(mrid, false), data);
        assertNotNull(rmr);
        dr = resolver.download(new Artifact[] {new DefaultArtifact(mrid, rmr.getPublicationDate(),
                mrid.getName(), "jar", "jar")}, getDownloadOptions(false));
        assertEquals(1, dr.getArtifactsReports(DownloadStatus.SUCCESSFUL).length);

        resolver.setChecksums("md5");
        mrid = ModuleRevisionId.newInstance("test", "badartcs", "1.0");
        rmr = resolver.getDependency(new DefaultDependencyDescriptor(mrid, false), data);
        assertNotNull(rmr);
        dr = resolver.download(new Artifact[] {new DefaultArtifact(mrid, rmr.getPublicationDate(),
                mrid.getName(), "jar", "jar")}, getDownloadOptions(false));
        assertEquals(1, dr.getArtifactsReports(DownloadStatus.FAILED).length);

        resolver.setChecksums("");
        rmr = resolver.getDependency(new DefaultDependencyDescriptor(mrid, false), data);
        assertNotNull(rmr);
        dr = resolver.download(new Artifact[] {new DefaultArtifact(mrid, rmr.getPublicationDate(),
                mrid.getName(), "jar", "jar")}, getDownloadOptions(false));
        assertEquals(1, dr.getArtifactsReports(DownloadStatus.SUCCESSFUL).length);
    }
View Full Code Here

                    .addArtifactPattern(
                        "test/repositories/1/"
                        + "[organisation]/[module]/[type]s/[artifact]-[revision].[ext]");

            ModuleRevisionId mrid = ModuleRevisionId.newInstance("myorg", "mymodule", "myrevision");
            Artifact ivyArtifact = new DefaultArtifact(mrid, new Date(), "ivy", "ivy", "xml");
            Artifact artifact = new DefaultArtifact(mrid, new Date(), "myartifact", "mytype",
                    "myext");
            File src = new File("test/repositories/ivysettings.xml");
            resolver.publish(ivyArtifact, src, false);
            resolver.publish(artifact, src, false);
View Full Code Here

        assertEquals(mrid, rmr.getId());
        Date pubdate = new GregorianCalendar(2004, 10, 1, 11, 0, 0).getTime();
        assertEquals(pubdate, rmr.getPublicationDate());

        // test to ask to download
        DefaultArtifact artifact = new DefaultArtifact(mrid, pubdate, "mod1.1", "jar", "jar");
        DownloadReport report = resolver.download(new Artifact[] {artifact},
            getDownloadOptions(true));
        assertNotNull(report);

        assertEquals(1, report.getArtifactsReports().length);
View Full Code Here

        }
    }

    private Artifact getArtifact(String org, String module, String rev, String artName,
            String type, String ext) {
        return new DefaultArtifact(ModuleRevisionId.newInstance(org, module, rev), new Date(),
                artName, type, ext);
    }
View Full Code Here

                            return;
                        }
                        String artifactName = attributes.getValue("name");
                        String type = attributes.getValue("type");
                        String ext = attributes.getValue("ext");
                        Artifact artifact = new DefaultArtifact(_mrid, _pubdate, artifactName,
                                type, ext, ExtendableItemHelper.getExtraAttributes(attributes,
                                    "extra-"));
                        _revisionArtifacts.add(artifact);
                    } else if ("info".equals(qName)) {
                        String organisation = attributes.getValue("organisation");
View Full Code Here

                                if (eventManager != null) {
                                    eventManager.fireIvyEvent(new StartArtifactDownloadEvent(this,
                                            artifacts[i], origin));
                                }

                                File tmp = cacheManager.getArchiveFileInCache(new DefaultArtifact(
                                        artifacts[i].getModuleRevisionId(), artifacts[i]
                                                .getPublicationDate(), artifacts[i].getName(),
                                        artifacts[i].getType(), artifacts[i].getExt() + ".part",
                                        artifacts[i].getExtraAttributes()), origin, useOrigin);
View Full Code Here

TOP

Related Classes of org.apache.ivy.core.module.descriptor.DefaultArtifact

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.