Skip to content

Commit 52f8c8a

Browse files
authored
Merge pull request #119 from EMCECS/bugfix-sdk-656
simply change test suites to enforce the order of shutDownClient()
2 parents a10cdae + fff7b14 commit 52f8c8a

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/test/java/com/emc/object/AbstractClientTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ public abstract class AbstractClientTest {
5050
*/
5151
protected abstract void initClient() throws Exception;
5252

53+
/**
54+
* Implement to clean up the object client used for each test. Each subclass must keep a reference to the
55+
* client.
56+
*/
57+
protected abstract void shutdownClient() throws Exception;
58+
5359
/**
5460
* Implement to create an arbitrary bucket or directory. Do not do anything if the
5561
* bucket/directory already exists.
@@ -91,6 +97,11 @@ public final void initTestBucket() throws Exception {
9197
}
9298

9399
@After
100+
public final void tearDown() throws Exception {
101+
destroyTestBucket();
102+
shutdownClient();
103+
}
104+
94105
public final void destroyTestBucket() throws Exception {
95106
log.info("cleaning up bucket " + getTestBucket());
96107
cleanUpBucket(getTestBucket());

src/test/java/com/emc/object/s3/AbstractS3ClientTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ public void dumpLBStats() {
8282
}
8383
}
8484

85-
@After
85+
@Override
8686
public void shutdownClient() {
87+
log.debug("shutting down client");
8788
if (client != null) client.destroy();
8889
}
8990

@@ -168,4 +169,4 @@ static S3Config s3ConfigFromProperties() throws Exception {
168169

169170
return s3Config;
170171
}
171-
}
172+
}

0 commit comments

Comments
 (0)