Allow kernel to pick S3Proxy port in tests

pull/33/merge
Andrew Gaul 2015-01-06 14:57:13 -08:00
rodzic 2dd3dac970
commit 15e11975a2
3 zmienionych plików z 15 dodań i 7 usunięć

Wyświetl plik

@ -90,6 +90,10 @@ public final class S3Proxy {
server.stop();
}
public int getPort() {
return ((ServerConnector) server.getConnectors()[0]).getLocalPort();
}
public static void main(String[] args) throws Exception {
if (args.length == 1 && args[0].equals("--version")) {
System.err.println(

Wyświetl plik

@ -107,6 +107,16 @@ public final class S3ProxyTest {
containerName = createRandomContainerName();
blobStore.createContainerInLocation(null, containerName);
s3Proxy = new S3Proxy(blobStore, s3Endpoint, s3Identity, s3Credential,
Resources.getResource(keyStorePath).toString(),
keyStorePassword,
"true".equalsIgnoreCase(forceMultiPartUpload), virtualHost);
s3Proxy.start();
// reset endpoint to handle zero port
s3Endpoint = new URI(s3Endpoint.getScheme(), s3Endpoint.getUserInfo(),
s3Endpoint.getHost(), s3Proxy.getPort(), s3Endpoint.getPath(),
s3Endpoint.getQuery(), s3Endpoint.getFragment());
Properties s3Properties = new Properties();
s3Properties.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
s3Context = ContextBuilder
@ -116,12 +126,6 @@ public final class S3ProxyTest {
.overrides(s3Properties)
.build(BlobStoreContext.class);
s3BlobStore = s3Context.getBlobStore();
s3Proxy = new S3Proxy(blobStore, s3Endpoint, s3Identity, s3Credential,
Resources.getResource(keyStorePath).toString(),
keyStorePassword,
"true".equalsIgnoreCase(forceMultiPartUpload), virtualHost);
s3Proxy.start();
}
@After

Wyświetl plik

@ -1,4 +1,4 @@
s3proxy.endpoint=https://127.0.0.1:8080
s3proxy.endpoint=https://127.0.0.1:0
# authorization must be aws-v2 or none
s3proxy.authorization=aws-v2
s3proxy.identity=local-identity