Skip to content

Commit

Permalink
JCLOUDS-457: Call BeforeMethod and AfterMethod
Browse files Browse the repository at this point in the history
Use these annotations to initialize before every test.  BeforeTest and
AfterTest initialize once before a single test in this suite.
  • Loading branch information
gaul committed Jun 22, 2014
1 parent 6194a3e commit 913b8c5
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -45,8 +45,8 @@
import org.jclouds.http.HttpResponseException;
import org.jclouds.io.Payload;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import com.google.common.collect.ImmutableMap;
Expand Down Expand Up @@ -112,15 +112,15 @@ private static String getResponseBody(String path) throws IOException {
return Resources.toString(Resources.getResource(GlacierClientMockTest.class, path), UTF_8);
}

@BeforeTest
@BeforeMethod
private void initServer() throws IOException {
server = new MockWebServer();
server.setBodyLimit(0);
server.play();
client = getGlacierClient(server.getUrl("/"));
}

@AfterTest
@AfterMethod
private void shutdownServer() throws IOException {
server.shutdown();
}
Expand Down

0 comments on commit 913b8c5

Please sign in to comment.