Parameterize TestUtils.startS3Proxy

pull/257/head
Andrew Gaul 2018-01-08 22:33:46 -08:00
rodzic 0f26d65846
commit c410df593d
7 zmienionych plików z 9 dodań i 8 usunięć

Wyświetl plik

@ -127,7 +127,8 @@ public final class AwsSdkTest {
@Before
public void setUp() throws Exception {
TestUtils.S3ProxyLaunchInfo info = TestUtils.startS3Proxy();
TestUtils.S3ProxyLaunchInfo info = TestUtils.startS3Proxy(
"s3proxy.conf");
awsCreds = new BasicAWSCredentials(info.getS3Identity(),
info.getS3Credential());
context = info.getBlobStore().getContext();

Wyświetl plik

@ -62,7 +62,7 @@ public final class JcloudsBucketsLiveTest extends BucketsLiveTest {
protected Properties setupProperties() {
TestUtils.S3ProxyLaunchInfo info;
try {
info = TestUtils.startS3Proxy();
info = TestUtils.startS3Proxy("s3proxy.conf");
s3Proxy = info.getS3Proxy();
context = info.getBlobStore().getContext();
blobStoreType = context.unwrap().getProviderMetadata().getId();

Wyświetl plik

@ -58,7 +58,7 @@ public final class JcloudsS3BlobIntegrationLiveTest
protected Properties setupProperties() {
TestUtils.S3ProxyLaunchInfo info;
try {
info = TestUtils.startS3Proxy();
info = TestUtils.startS3Proxy("s3proxy.conf");
s3Proxy = info.getS3Proxy();
context = info.getBlobStore().getContext();
blobStoreType = context.unwrap().getProviderMetadata().getId();

Wyświetl plik

@ -57,7 +57,7 @@ public final class JcloudsS3BlobSignerLiveTest extends S3BlobSignerLiveTest {
protected Properties setupProperties() {
TestUtils.S3ProxyLaunchInfo info;
try {
info = TestUtils.startS3Proxy();
info = TestUtils.startS3Proxy("s3proxy.conf");
s3Proxy = info.getS3Proxy();
context = info.getBlobStore().getContext();
} catch (Exception e) {

Wyświetl plik

@ -66,7 +66,7 @@ public final class JcloudsS3ClientLiveTest extends S3ClientLiveTest {
protected Properties setupProperties() {
TestUtils.S3ProxyLaunchInfo info;
try {
info = TestUtils.startS3Proxy();
info = TestUtils.startS3Proxy("s3proxy.conf");
s3Proxy = info.getS3Proxy();
context = info.getBlobStore().getContext();
blobStoreType = context.unwrap().getProviderMetadata().getId();

Wyświetl plik

@ -57,7 +57,7 @@ public final class JcloudsS3ContainerIntegrationLiveTest
protected Properties setupProperties() {
TestUtils.S3ProxyLaunchInfo info;
try {
info = TestUtils.startS3Proxy();
info = TestUtils.startS3Proxy("s3proxy.conf");
s3Proxy = info.getS3Proxy();
context = info.getBlobStore().getContext();
blobStoreType = context.unwrap().getProviderMetadata().getId();

Wyświetl plik

@ -152,11 +152,11 @@ final class TestUtils {
}
}
static S3ProxyLaunchInfo startS3Proxy() throws Exception {
static S3ProxyLaunchInfo startS3Proxy(String configFile) throws Exception {
S3ProxyLaunchInfo info = new S3ProxyLaunchInfo();
try (InputStream is = Resources.asByteSource(Resources.getResource(
"s3proxy.conf")).openStream()) {
configFile)).openStream()) {
info.getProperties().load(is);
}