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

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


        }
    }

    @Test
    public void testResolveAndRethrowFailureWithNoMissingDependenciesShouldDoNothing() throws IOException, ParseException {
        ModuleDescriptor moduleDescriptor = createAnonymousModuleDescriptor();
        prepareTestsThatRetrieveDependencies(moduleDescriptor);
        prepareResolveReport();
        context.checking(new Expectations() {{
            allowing(ivyReportConverterStub).convertReport(resolveReportMock, configurationStub);
        }});
View Full Code Here


    public void testResolveAndGetReport() throws IOException, ParseException {
        prepareResolveReport();
        context.checking(new Expectations() {{
            allowing(ivyReportConverterStub).convertReport(resolveReportMock, configurationStub);
        }});
        ModuleDescriptor moduleDescriptor = createAnonymousModuleDescriptor();
        prepareTestsThatRetrieveDependencies(moduleDescriptor);
        assertEquals(false, ivyDependencyResolver.resolve(configurationStub, ivyStub, moduleDescriptor).hasError());
    }
View Full Code Here

    }

    @Test
    public void testResolveAndGetReportWithMissingDependenciesAndFailFalse() throws IOException, ParseException {
        prepareResolveReportWithError();
        ModuleDescriptor moduleDescriptor = createAnonymousModuleDescriptor();
        prepareTestsThatRetrieveDependencies(moduleDescriptor);
        assertEquals(true, ivyDependencyResolver.resolve(configurationStub, ivyStub, moduleDescriptor).hasError());
    }
View Full Code Here

    @Test
    public void testResolve() {
        final Configuration configurationDummy = context.mock(Configuration.class);
        final Set<Configuration> configurations = WrapUtil.toSet(configurationDummy);
        final ResolvedConfiguration resolvedConfiguration = context.mock(ResolvedConfiguration.class);
        final ModuleDescriptor moduleDescriptorDummy = HelperUtil.createModuleDescriptor(WrapUtil.toSet("someConf"));
        final IvyFactory ivyFactoryStub = context.mock(IvyFactory.class);
        final Ivy ivyStub = context.mock(Ivy.class);
        final IvySettings ivySettingsDummy = new IvySettings();

        context.checking(new Expectations() {{
View Full Code Here

        DefaultDependencyDescriptor dependencyDescriptor = new DefaultDependencyDescriptor(parent,
                moduleRevisionId, getClientModule(dependency).isForce(),
                false, getClientModule(dependency).isTransitive());
        addExcludesArtifactsAndDependencies(configuration, getClientModule(dependency), dependencyDescriptor);

        ModuleDescriptor moduleDescriptor = moduleDescriptorFactoryForClientModule.createModuleDescriptor(
                dependencyDescriptor.getDependencyRevisionId(), getClientModule(dependency).getDependencies());
        clientModuleRegistry.put(getClientModule(dependency).getId(), moduleDescriptor);

        return dependencyDescriptor;
    }
View Full Code Here

        final ModuleRevisionId testModuleRevisionId = IvyUtil.createModuleRevisionId(
                clientModule, WrapUtil.toMap(ClientModule.CLIENT_MODULE_KEY, clientModule.getId()));

        setUpDependency(clientModule);
        clientModule.addDependency(dependencyDependency);
        final ModuleDescriptor moduleDescriptorForClientModule = context.mock(ModuleDescriptor.class);
        context.checking(new Expectations() {{
            allowing(moduleDescriptorFactoryForClientModule).createModuleDescriptor(
                    testModuleRevisionId,
                    WrapUtil.toSet(dependencyDependency)
            );
View Full Code Here

            ISigilBundle pb = ModelElementFactory.getInstance().newModelElement(
                ISigilBundle.class);
            pb.setBundleInfo(info);

            Map<Object, Object> meta = new HashMap<Object, Object>();
            ModuleDescriptor md = SigilParser.instance().parseDescriptor(uri.toURL());
            if (!bb.getId().equals(md.getModuleRevisionId().getName()))
            { // non-default artifact
                for (Artifact a : md.getAllArtifacts())
                {
                    if (a.getName().equals(bb.getId()))
                    {
                        meta.put(Artifact.class, a);
                        break;
View Full Code Here

                    Log.debug("overriding variable " + name + "=" + value);
                    ivySettings.setVariable(name, value);
                }
            }

            ModuleDescriptor md = null;
            if (delegate == null || !delegate.accept(res))
            {
                md = super.parseDescriptor(settings, xmlURL, res, validate);
            }
            else
View Full Code Here

                    // e.g. SystemProvider with framework=null
                    Log.verbose("Discarding system bundle");
                    continue;
                }

                ModuleDescriptor bmd = (ModuleDescriptor) bundle.getMeta().get(
                    ModuleDescriptor.class);
                if (bmd != null)
                {
                    ModuleRevisionId bmrid = bmd.getModuleRevisionId();
                    String org = bmrid.getOrganisation();
                    if (org == null)
                        org = masterMrid.getOrganisation();
                    String module = bmrid.getName();
                    String rev = "latest." + bmd.getStatus();

                    mrid = ModuleRevisionId.newInstance(org, module, rev);

                    dd = new SigilDependencyDescriptor(md, mrid, force, changing,
                        transitive);
View Full Code Here

        File dest = new File("build/testFixDeps/testTransitivity.xml");
        fixDeps.setToFile(dest);
        fixDeps.execute();

        assertTrue(dest.exists());
        ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(
            new IvySettings(), dest.toURI().toURL(), true);
        assertEquals("apache", md.getModuleRevisionId().getOrganisation());
        assertEquals("resolve-simple", md.getModuleRevisionId().getName());
        assertEquals("1.0", md.getModuleRevisionId().getRevision());
        assertEquals("release", md.getStatus());

        assertEquals(2, md.getConfigurations().length);
        assertEquals("default", md.getConfigurations()[0].getName());
        assertEquals(0, md.getConfigurations()[0].getExtends().length);
        assertEquals("compile", md.getConfigurations()[1].getName());
        assertEquals(0, md.getConfigurations()[1].getExtends().length);

        assertEquals(3, md.getDependencies().length);

        assertEquals("org1", md.getDependencies()[0].getDependencyId().getOrganisation());
        assertEquals("mod1.2", md.getDependencies()[0].getDependencyId().getName());
        assertEquals(false, md.getDependencies()[0].isChanging());
        assertEquals(true, md.getDependencies()[0].isForce());
        assertEquals(false, md.getDependencies()[0].isTransitive());
        assertEquals("2.0", md.getDependencies()[0].getDependencyRevisionId().getRevision());
        assertEquals(1, md.getDependencies()[0].getModuleConfigurations().length);
        assertEquals("default", md.getDependencies()[0].getModuleConfigurations()[0]);
        assertEquals(1, md.getDependencies()[0].getDependencyConfigurations("default").length);
        assertEquals("default", md.getDependencies()[0].getDependencyConfigurations("default")[0]);

        assertEquals("org1", md.getDependencies()[1].getDependencyId().getOrganisation());
        assertEquals("mod1.1", md.getDependencies()[1].getDependencyId().getName());
        assertEquals(false, md.getDependencies()[1].isChanging());
        assertEquals(true, md.getDependencies()[1].isForce());
        assertEquals(false, md.getDependencies()[1].isTransitive());
        assertEquals("2.0", md.getDependencies()[1].getDependencyRevisionId().getRevision());
        assertEquals(1, md.getDependencies()[1].getModuleConfigurations().length);
        assertEquals("compile", md.getDependencies()[1].getModuleConfigurations()[0]);
        assertEquals(1, md.getDependencies()[1].getDependencyConfigurations("compile").length);
        assertEquals("default", md.getDependencies()[1].getDependencyConfigurations("compile")[0]);

        assertEquals("org1", md.getDependencies()[2].getDependencyId().getOrganisation());
        assertEquals("mod1.2", md.getDependencies()[2].getDependencyId().getName());
        assertEquals(false, md.getDependencies()[2].isChanging());
        assertEquals(true, md.getDependencies()[2].isForce());
        assertEquals(false, md.getDependencies()[2].isTransitive());
        assertEquals("2.1", md.getDependencies()[2].getDependencyRevisionId().getRevision());
        assertEquals(1, md.getDependencies()[2].getModuleConfigurations().length);
        assertEquals("compile", md.getDependencies()[2].getModuleConfigurations()[0]);
        assertEquals(1, md.getDependencies()[2].getDependencyConfigurations("compile").length);
        assertEquals("*", md.getDependencies()[2].getDependencyConfigurations("compile")[0]);
    }
View Full Code Here

TOP

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

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.