Package org.gradle.api.artifacts

Examples of org.gradle.api.artifacts.Configuration


                context.mock(IvyDependencyPublisher.class), clientModuleRegistryDummy);
    }

    @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);
View Full Code Here


    }

    @Test
    public void testAddWithClosure() {
        expectConfigurationCreated(TEST_NAME);
        Configuration configuration = checkAddGetWithName((DefaultConfiguration) configurationContainer.add(TEST_NAME, TEST_CLOSURE));
        assertThat(configuration.getDescription(), equalTo(TEST_DESCRIPTION));
    }
View Full Code Here

    }

    @Test
    public void testFind() {
        expectConfigurationCreated(TEST_NAME);
        Configuration configuration = configurationContainer.add(TEST_NAME);
        assertThat(configuration, sameInstance(configurationContainer.findByName(TEST_NAME)));
    }
View Full Code Here

    @Test
    public void testGetWithClosure() {
        expectConfigurationCreated(TEST_NAME);
        configurationContainer.add(TEST_NAME);
        Configuration configuration = configurationContainer.getByName(TEST_NAME, TEST_CLOSURE);
        assertThat(configuration.getDescription(), equalTo(TEST_DESCRIPTION));
    }
View Full Code Here

    @Test
    public void testGetWithFilter() {
        expectConfigurationCreated(TEST_NAME);
        expectConfigurationCreated(TEST_NAME + "delta");
        Configuration configuration = configurationContainer.add(TEST_NAME);
        configurationContainer.add(TEST_NAME + "delta");
        Set<Configuration> result = configurationContainer.findAll(new Spec<Configuration>() {
            public boolean isSatisfiedBy(Configuration element) {
                return element.getName().equals(TEST_NAME);
            }
View Full Code Here

    @Test
    public void testGetAll() {
        expectConfigurationCreated(TEST_NAME);
        expectConfigurationCreated(TEST_NAME + "delta");
        Configuration configuration1 = configurationContainer.add(TEST_NAME);
        Configuration configuration2 = configurationContainer.add(TEST_NAME + "delta");
        assertThat(configurationContainer.getAll(), equalTo(WrapUtil.toSet(configuration1, configuration2)));
    }
View Full Code Here

    @Test
    public void testCreateDetached() {
        Dependency dependency1 = HelperUtil.createDependency("group1", "name1", "version1");
        Dependency dependency2 = HelperUtil.createDependency("group2", "name2", "version2");

        Configuration detachedConf = configurationContainer.detachedConfiguration(dependency1, dependency2);

        assertThat(detachedConf.getAll(), equalTo(WrapUtil.toSet(detachedConf)));
        assertThat(detachedConf.getHierarchy(), equalTo(WrapUtil.<Configuration>toSet(detachedConf)));
        assertThat(detachedConf.getDependencies(), equalTo(WrapUtil.toSet(dependency1, dependency2)));
        assertNotSameInstances(detachedConf.getDependencies(), WrapUtil.toSet(dependency1, dependency2));
    }
View Full Code Here

    }

    @Test
    public void passesEachProjectConfigurationToRenderer() throws IOException {
        final ConfigurationContainer configurationContainer = context.mock(ConfigurationContainer.class);
        final Configuration configuration1 = context.mock(Configuration.class, "Configuration1");
        final Configuration configuration2 = context.mock(Configuration.class, "Configuration2");
        context.checking(new Expectations() {{
            allowing(project).getConfigurations();
            will(returnValue(configurationContainer));

            allowing(configurationContainer).getAll();
View Full Code Here

        assertConfigurationsIsPassedToRenderer(configuration1, configuration2);
    }

    @Test
    public void passesSpecifiedConfigurationToRenderer() throws IOException {
        final Configuration configuration1 = context.mock(Configuration.class, "Configuration1");
        final Configuration configuration2 = context.mock(Configuration.class, "Configuration2");
        task.setConfigurations(WrapUtil.toSet(configuration1, configuration2));
        assertConfigurationsIsPassedToRenderer(configuration1, configuration2);
    }
View Full Code Here

    @Test
    public void testAddDependencyDescriptors() {
        DefaultDependenciesToModuleDescriptorConverter converter = new DefaultDependenciesToModuleDescriptorConverter(
                dependencyDescriptorFactoryStub, excludeRuleConverterStub);
        Configuration configurationStub1 = createNamedConfigurationStubWithDependenciesAndExcludeRules("conf1", GRADLE_EXCLUDE_RULE_DUMMY_1, dependencyDummy1, similarDependency1);
        Configuration configurationStub2 = createNamedConfigurationStubWithDependenciesAndExcludeRules("conf2", GRADLE_EXCLUDE_RULE_DUMMY_2, dependencyDummy2, similarDependency2);
        Configuration configurationStub3 = createNamedConfigurationStubWithDependenciesAndExcludeRules("conf3", null, similarDependency3);
        DefaultModuleDescriptor moduleDescriptor = HelperUtil.createModuleDescriptor(toSet(configurationStub1.getName(),
                configurationStub2.getName()));
        associateDependencyWithDescriptor(dependencyDummy1, moduleDescriptor, configurationStub1);
        associateDependencyWithDescriptor(dependencyDummy2, moduleDescriptor, configurationStub2);
        associateDependencyWithDescriptor(similarDependency1, moduleDescriptor, configurationStub1);
View Full Code Here

TOP

Related Classes of org.gradle.api.artifacts.Configuration

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.