Skip to content
Permalink
Browse files
Renamed BaseOpenStackMockTest variable and method more appropriately.
  • Loading branch information
Everett Toews committed Oct 15, 2013
1 parent a54cdca commit be16c972f936cdd85caa834b23914a718ee699d0
Showing 7 changed files with 62 additions and 62 deletions.
@@ -51,8 +51,8 @@ Object[][] credentialTypeToPostBody() {

@Test(dataProvider = "jclouds.keystone.credential-type")
public void authenticateCredentialType(String credentialType, String expectedPost) throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(accountResponse());

try {
@@ -34,8 +34,8 @@ public void whenAccountApiIsNull() {
}

public void whenAccountApiHasKey() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(accountResponse().addHeader("X-Account-Meta-Temp-URL-Key", "mykey"));

try {
@@ -56,8 +56,8 @@ public void whenAccountApiHasKey() throws Exception {

@Test(expectedExceptions = IllegalStateException.class, expectedExceptionsMessageRegExp = ".*returned a null temporaryUrlKey!")
public void whenAccountApiDoesntHaveKey() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(accountResponse());

try {
@@ -40,8 +40,8 @@ public class AccountApiMockTest extends BaseOpenStackMockTest<SwiftApi> {

/** upper-cases first char, and lower-cases rest!! **/
public void getKnowingServerMessesWithMetadataKeyCaseFormat() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(accountResponse() //
// note silly casing
.addHeader("X-Account-Meta-Apiname", "swift") //
@@ -67,8 +67,8 @@ public void getKnowingServerMessesWithMetadataKeyCaseFormat() throws Exception {
}

public void updateMetadata() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(accountResponse() //
.addHeader("X-Account-Meta-ApiName", "swift") //
.addHeader("X-Account-Meta-ApiVersion", "v1.1"));
@@ -91,8 +91,8 @@ public void updateMetadata() throws Exception {
}

public void updateTemporaryUrlKey() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(accountResponse());

try {
@@ -111,8 +111,8 @@ public void updateTemporaryUrlKey() throws Exception {
}

public void deleteMetadata() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(accountResponse());

try {
@@ -46,8 +46,8 @@ public void extractArchive() throws Exception {
}
byte[] tarGz = ByteStreams.toByteArray(files.as(TarGzExporter.class).exportAsInputStream());

MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse().setResponseCode(201).setBody("{\"Number Files Created\": 10, \"Errors\": []}"));

try {
@@ -46,8 +46,8 @@ public class ContainerApiMockTest extends BaseOpenStackMockTest<SwiftApi> {
+ "]";

public void listFirstPage() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse().setBody(containerList));

try {
@@ -73,8 +73,8 @@ public void listFirstPage() throws Exception {
}

public void listAt() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse().setBody(containerList));

try {
@@ -100,8 +100,8 @@ public void listAt() throws Exception {
}

public void createIfAbsent() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse().setResponseCode(201));

try {
@@ -119,8 +119,8 @@ public void createIfAbsent() throws Exception {
}

public void createWithOptions() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse().setResponseCode(201));

try {
@@ -142,8 +142,8 @@ public void createWithOptions() throws Exception {
}

public void alreadyCreated() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse().setResponseCode(202));

try {
@@ -162,8 +162,8 @@ public void alreadyCreated() throws Exception {

/** upper-cases first char, and lower-cases rest!! **/
public void getKnowingServerMessesWithMetadataKeyCaseFormat() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(containerResponse() //
// note silly casing
.addHeader("X-Container-Meta-Apiname", "swift") //
@@ -189,8 +189,8 @@ public void getKnowingServerMessesWithMetadataKeyCaseFormat() throws Exception {
}

public void updateMetadata() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(containerResponse() //
.addHeader("X-Container-Meta-ApiName", "swift") //
.addHeader("X-Container-Meta-ApiVersion", "v1.1"));
@@ -213,8 +213,8 @@ public void updateMetadata() throws Exception {
}

public void deleteMetadata() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(containerResponse());

try {
@@ -235,8 +235,8 @@ public void deleteMetadata() throws Exception {
}

public void deleteIfEmpty() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse().setResponseCode(204));

try {
@@ -254,8 +254,8 @@ public void deleteIfEmpty() throws Exception {
}

public void alreadyDeleted() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse().setResponseCode(404));

try {
@@ -274,8 +274,8 @@ public void alreadyDeleted() throws Exception {

@Test(expectedExceptions = IllegalStateException.class)
public void deleteWhenNotEmpty() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse().setResponseCode(409));

try {
@@ -82,8 +82,8 @@ protected ImmutableList<SwiftObject> parsedObjectsForUrl(String baseUri) {
}

public void list() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(containerResponse() //
.addHeader("X-Container-Read", ".r:*,.rlistings") //
.setBody(objectList));
@@ -105,8 +105,8 @@ public void list() throws Exception {
}

public void listOptions() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(containerResponse().setBody(objectList));

try {
@@ -124,8 +124,8 @@ public void listOptions() throws Exception {
}

public void replace() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse() //
.setResponseCode(201) //
.addHeader("ETag", "d9f5eb4bba4e2f2f046e54611bc8196b"));
@@ -152,8 +152,8 @@ public void replace() throws Exception {

/** upper-cases first char, and lower-cases rest!! **/
public void headKnowingServerMessesWithMetadataKeyCaseFormat() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(objectResponse() //
// note silly casing
.addHeader("X-Object-Meta-Apiname", "swift") //
@@ -182,8 +182,8 @@ public void headKnowingServerMessesWithMetadataKeyCaseFormat() throws Exception
}

public void get() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(objectResponse() //
// note silly casing
.addHeader("X-Object-Meta-Apiname", "swift") //
@@ -215,8 +215,8 @@ public void get() throws Exception {
}

public void updateMetadata() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(objectResponse() //
.addHeader("X-Object-Meta-ApiName", "swift") //
.addHeader("X-Object-Meta-ApiVersion", "v1.1"));
@@ -239,8 +239,8 @@ public void updateMetadata() throws Exception {
}

public void deleteMetadata() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(objectResponse());

try {
@@ -261,8 +261,8 @@ public void deleteMetadata() throws Exception {
}

public void delete() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse().setResponseCode(204));

try {
@@ -280,8 +280,8 @@ public void delete() throws Exception {
}

public void alreadyDeleted() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse().setResponseCode(404));

try {
@@ -34,8 +34,8 @@
public class StaticLargeObjectApiMockTest extends BaseOpenStackMockTest<SwiftApi> {

public void replaceManifest() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse().addHeader(HttpHeaders.ETAG, "\"abcd\""));

try {
@@ -70,8 +70,8 @@ public void replaceManifest() throws Exception {
}

public void delete() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse().setResponseCode(204));

try {
@@ -89,8 +89,8 @@ public void delete() throws Exception {
}

public void alreadyDeleted() throws Exception {
MockWebServer server = mockSwiftServer();
server.enqueue(new MockResponse().setBody(access));
MockWebServer server = mockOpenStackServer();
server.enqueue(new MockResponse().setBody(accessRackspace));
server.enqueue(new MockResponse().setResponseCode(404));

try {

0 comments on commit be16c97

Please sign in to comment.