Search in sources :

Example 1 with BuildCacheService

use of org.gradle.caching.BuildCacheService in project gradle-s3-build-cache by myniva.

the class AwsS3BuildCacheServiceFactoryTest method testNullHeaderValue.

@Test
public void testNullHeaderValue() {
    AwsS3BuildCache conf = new AwsS3BuildCache();
    conf.setRegion("us-west-1");
    conf.setBucket("my-bucket");
    Map<String, String> headers = new HashMap<String, String>() {

        {
            put("x-foo", null);
        }
    };
    conf.setHeaders(headers);
    BuildCacheService service = subject.createBuildCacheService(conf, buildCacheDescriber);
    assertNotNull(service);
}
Also used : BuildCacheService(org.gradle.caching.BuildCacheService) HashMap(java.util.HashMap) AwsS3BuildCache(ch.myniva.gradle.caching.s3.AwsS3BuildCache) Test(org.junit.Test)

Example 2 with BuildCacheService

use of org.gradle.caching.BuildCacheService in project gradle-s3-build-cache by myniva.

the class AwsS3BuildCacheServiceFactoryTest method testWhat.

@Test
public void testWhat() {
    AwsS3BuildCache conf = new AwsS3BuildCache();
    conf.setRegion("us-west-1");
    conf.setBucket("my-bucket");
    BuildCacheService service = subject.createBuildCacheService(conf, buildCacheDescriber);
    assertNotNull(service);
}
Also used : BuildCacheService(org.gradle.caching.BuildCacheService) AwsS3BuildCache(ch.myniva.gradle.caching.s3.AwsS3BuildCache) Test(org.junit.Test)

Example 3 with BuildCacheService

use of org.gradle.caching.BuildCacheService in project gradle-s3-build-cache by myniva.

the class AwsS3BuildCacheServiceFactoryTest method testNullHeaders.

@Test
public void testNullHeaders() {
    AwsS3BuildCache conf = new AwsS3BuildCache();
    conf.setRegion("us-west-1");
    conf.setBucket("my-bucket");
    conf.setHeaders(null);
    BuildCacheService service = subject.createBuildCacheService(conf, buildCacheDescriber);
    assertNotNull(service);
}
Also used : BuildCacheService(org.gradle.caching.BuildCacheService) AwsS3BuildCache(ch.myniva.gradle.caching.s3.AwsS3BuildCache) Test(org.junit.Test)

Example 4 with BuildCacheService

use of org.gradle.caching.BuildCacheService in project gradle by gradle.

the class BuildCacheControllerFactory method createBuildCacheService.

private static <T extends BuildCache> DescribedBuildCacheService createBuildCacheService(final T configuration, BuildCacheServiceRole role, Path buildIdentityPath, BuildCacheConfigurationInternal buildCacheConfiguration, Instantiator instantiator) {
    Class<? extends BuildCacheServiceFactory<T>> castFactoryType = Cast.uncheckedCast(buildCacheConfiguration.getBuildCacheServiceFactoryType(configuration.getClass()));
    BuildCacheServiceFactory<T> factory = instantiator.newInstance(castFactoryType);
    Describer describer = new Describer();
    BuildCacheService service = factory.createBuildCacheService(configuration, describer);
    ImmutableSortedMap<String, String> config = ImmutableSortedMap.copyOf(describer.configParams);
    BuildCacheDescription description = new BuildCacheDescription(configuration, describer.type, config);
    logConfig(buildIdentityPath, role, description);
    return new DescribedBuildCacheService(service, description);
}
Also used : BuildCacheService(org.gradle.caching.BuildCacheService)

Example 5 with BuildCacheService

use of org.gradle.caching.BuildCacheService in project gradle-s3-build-cache by myniva.

the class AwsS3BuildCacheServiceFactoryTest method testNullHeaderName.

@Test
public void testNullHeaderName() {
    AwsS3BuildCache conf = new AwsS3BuildCache();
    conf.setRegion("us-west-1");
    conf.setBucket("my-bucket");
    Map<String, String> headers = new HashMap<String, String>() {

        {
            put(null, "foo");
        }
    };
    conf.setHeaders(headers);
    BuildCacheService service = subject.createBuildCacheService(conf, buildCacheDescriber);
    assertNotNull(service);
}
Also used : BuildCacheService(org.gradle.caching.BuildCacheService) HashMap(java.util.HashMap) AwsS3BuildCache(ch.myniva.gradle.caching.s3.AwsS3BuildCache) Test(org.junit.Test)

Aggregations

BuildCacheService (org.gradle.caching.BuildCacheService)7 AwsS3BuildCache (ch.myniva.gradle.caching.s3.AwsS3BuildCache)6 Test (org.junit.Test)6 HashMap (java.util.HashMap)2