Skip to content
Permalink
Browse files
JCLOUDS-457: Call BeforeMethod and AfterMethod
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 913b8c5b3cf88b91eaa25cdb48287900903e4c09
Showing 1 changed file with 4 additions and 4 deletions.
@@ -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;
@@ -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();
}

0 comments on commit 913b8c5

Please sign in to comment.