use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class WebsiteCloudFrontDistributionConfigurationTest method testGetMethodsAWS.
@Test
public void testGetMethodsAWS() {
final S3Session session = new S3Session(new Host(new S3Protocol()));
final WebsiteCloudFrontDistributionConfiguration configuration = new WebsiteCloudFrontDistributionConfiguration(session, new DisabledX509TrustManager(), new DefaultX509KeyManager());
assertTrue(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.DOWNLOAD));
assertTrue(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.STREAMING));
assertFalse(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.CUSTOM));
assertTrue(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE_CDN));
assertTrue(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE));
assertFalse(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb_b", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE));
}
use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class WebsiteCloudFrontDistributionConfigurationTest method testFeatures.
@Test
public void testFeatures() {
final WebsiteCloudFrontDistributionConfiguration d = new WebsiteCloudFrontDistributionConfiguration(new S3Session(new Host(new S3Protocol(), new S3Protocol().getDefaultHostname())), new DisabledX509TrustManager(), new DefaultX509KeyManager());
assertNotNull(d.getFeature(Purge.class, Distribution.DOWNLOAD));
assertNotNull(d.getFeature(Purge.class, Distribution.WEBSITE_CDN));
assertNull(d.getFeature(Purge.class, Distribution.STREAMING));
assertNull(d.getFeature(Purge.class, Distribution.WEBSITE));
assertNotNull(d.getFeature(Index.class, Distribution.DOWNLOAD));
assertNotNull(d.getFeature(Index.class, Distribution.WEBSITE_CDN));
assertNotNull(d.getFeature(Index.class, Distribution.WEBSITE));
assertNull(d.getFeature(Index.class, Distribution.STREAMING));
assertNotNull(d.getFeature(DistributionLogging.class, Distribution.DOWNLOAD));
assertNotNull(d.getFeature(Cname.class, Distribution.DOWNLOAD));
assertNotNull(d.getFeature(Cname.class, Distribution.WEBSITE));
}
use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class WebsiteCloudFrontDistributionConfigurationTest method testReadNoWebsiteConfiguration.
@Test
public void testReadNoWebsiteConfiguration() throws Exception {
final WebsiteCloudFrontDistributionConfiguration configuration = new WebsiteCloudFrontDistributionConfiguration(session, new DisabledX509TrustManager(), new DefaultX509KeyManager());
final Path container = new Path("test-eu-central-1-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
final Distribution distribution = configuration.read(container, Distribution.WEBSITE, new DisabledLoginCallback());
assertEquals("The specified bucket does not have a website configuration", distribution.getStatus());
}
use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class WebsiteCloudFrontDistributionConfigurationTest method testGetName.
@Test
public void testGetName() {
final WebsiteCloudFrontDistributionConfiguration configuration = new WebsiteCloudFrontDistributionConfiguration(session, new DisabledX509TrustManager(), new DefaultX509KeyManager());
assertEquals("Amazon CloudFront", configuration.getName());
}
use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class WebsiteCloudFrontDistributionConfigurationTest method testGetMethodsNonAWS.
@Test
public void testGetMethodsNonAWS() {
final S3Session session = new S3Session(new Host(new S3Protocol(), "s3.cyberduck.io"));
final WebsiteCloudFrontDistributionConfiguration configuration = new WebsiteCloudFrontDistributionConfiguration(session, new DisabledX509TrustManager(), new DefaultX509KeyManager());
assertFalse(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.DOWNLOAD));
assertFalse(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.STREAMING));
assertFalse(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.CUSTOM));
assertFalse(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE_CDN));
assertTrue(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE));
assertFalse(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb_b", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE));
}
Aggregations