File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
src/test/java/com/emc/object Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,12 @@ public abstract class AbstractClientTest {
50
50
*/
51
51
protected abstract void initClient () throws Exception ;
52
52
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
+
53
59
/**
54
60
* Implement to create an arbitrary bucket or directory. Do not do anything if the
55
61
* bucket/directory already exists.
@@ -91,6 +97,11 @@ public final void initTestBucket() throws Exception {
91
97
}
92
98
93
99
@ After
100
+ public final void tearDown () throws Exception {
101
+ destroyTestBucket ();
102
+ shutdownClient ();
103
+ }
104
+
94
105
public final void destroyTestBucket () throws Exception {
95
106
log .info ("cleaning up bucket " + getTestBucket ());
96
107
cleanUpBucket (getTestBucket ());
Original file line number Diff line number Diff line change @@ -82,8 +82,9 @@ public void dumpLBStats() {
82
82
}
83
83
}
84
84
85
- @ After
85
+ @ Override
86
86
public void shutdownClient () {
87
+ log .debug ("shutting down client" );
87
88
if (client != null ) client .destroy ();
88
89
}
89
90
@@ -168,4 +169,4 @@ static S3Config s3ConfigFromProperties() throws Exception {
168
169
169
170
return s3Config ;
170
171
}
171
- }
172
+ }
You can’t perform that action at this time.
0 commit comments