18
18
package org .apache .hadoop .hbase .client ;
19
19
20
20
import static org .junit .Assert .assertEquals ;
21
+ import static org .junit .Assert .assertFalse ;
22
+ import static org .junit .Assert .assertTrue ;
21
23
import static org .junit .Assert .fail ;
22
24
23
25
import java .io .IOException ;
@@ -115,7 +117,7 @@ public void testRestoreSnapshotWithTTLSuccess() throws Exception {
115
117
String snapshotName = "nonExpiredTTLRestoreSnapshotTest" ;
116
118
117
119
// table should exist
118
- assertEquals ( true , UTIL .getAdmin ().tableExists (TABLE_NAME ));
120
+ assertTrue ( UTIL .getAdmin ().tableExists (TABLE_NAME ));
119
121
120
122
// create snapshot fo given table with specified ttl
121
123
createSnapshotWithTTL (TABLE_NAME , snapshotName , CHORE_INTERVAL_SECS * 2 );
@@ -124,21 +126,21 @@ public void testRestoreSnapshotWithTTLSuccess() throws Exception {
124
126
// Disable and drop table
125
127
admin .disableTable (TABLE_NAME );
126
128
admin .deleteTable (TABLE_NAME );
127
- assertEquals ( false , UTIL .getAdmin ().tableExists (TABLE_NAME ));
129
+ assertFalse ( UTIL .getAdmin ().tableExists (TABLE_NAME ));
128
130
129
131
// restore snapshot
130
132
admin .restoreSnapshot (snapshotName );
131
133
132
134
// table should be created
133
- assertEquals ( true , UTIL .getAdmin ().tableExists (TABLE_NAME ));
135
+ assertTrue ( UTIL .getAdmin ().tableExists (TABLE_NAME ));
134
136
}
135
137
136
138
@ Test
137
139
public void testRestoreSnapshotFailsDueToTTLExpired () throws Exception {
138
140
String snapshotName = "expiredTTLRestoreSnapshotTest" ;
139
141
140
142
// table should exist
141
- assertEquals ( true , UTIL .getAdmin ().tableExists (TABLE_NAME ));
143
+ assertTrue ( UTIL .getAdmin ().tableExists (TABLE_NAME ));
142
144
143
145
// create snapshot fo given table with specified ttl
144
146
createSnapshotWithTTL (TABLE_NAME , snapshotName , 1 );
@@ -147,7 +149,7 @@ public void testRestoreSnapshotFailsDueToTTLExpired() throws Exception {
147
149
// Disable and drop table
148
150
admin .disableTable (TABLE_NAME );
149
151
admin .deleteTable (TABLE_NAME );
150
- assertEquals ( false , UTIL .getAdmin ().tableExists (TABLE_NAME ));
152
+ assertFalse ( UTIL .getAdmin ().tableExists (TABLE_NAME ));
151
153
152
154
// Sleep so that TTL may expire
153
155
Threads .sleep (2000 );
@@ -161,15 +163,15 @@ public void testRestoreSnapshotFailsDueToTTLExpired() throws Exception {
161
163
}
162
164
163
165
// table should not be created
164
- assertEquals ( false , UTIL .getAdmin ().tableExists (TABLE_NAME ));
166
+ assertFalse ( UTIL .getAdmin ().tableExists (TABLE_NAME ));
165
167
}
166
168
167
169
@ Test
168
170
public void testCloneSnapshotWithTTLSuccess () throws Exception {
169
171
String snapshotName = "nonExpiredTTLCloneSnapshotTest" ;
170
172
171
173
// table should exist
172
- assertEquals ( true , UTIL .getAdmin ().tableExists (TABLE_NAME ));
174
+ assertTrue ( UTIL .getAdmin ().tableExists (TABLE_NAME ));
173
175
174
176
// create snapshot fo given table with specified ttl
175
177
createSnapshotWithTTL (TABLE_NAME , snapshotName , CHORE_INTERVAL_SECS * 2 );
@@ -179,21 +181,21 @@ public void testCloneSnapshotWithTTLSuccess() throws Exception {
179
181
admin .cloneSnapshot (snapshotName , CLONED_TABLE_NAME );
180
182
181
183
// table should be created
182
- assertEquals ( true , UTIL .getAdmin ().tableExists (CLONED_TABLE_NAME ));
184
+ assertTrue ( UTIL .getAdmin ().tableExists (CLONED_TABLE_NAME ));
183
185
}
184
186
185
187
@ Test
186
188
public void testCloneSnapshotFailsDueToTTLExpired () throws Exception {
187
189
String snapshotName = "expiredTTLCloneSnapshotTest" ;
188
190
189
191
// table should exist
190
- assertEquals ( true , UTIL .getAdmin ().tableExists (TABLE_NAME ));
192
+ assertTrue ( UTIL .getAdmin ().tableExists (TABLE_NAME ));
191
193
192
194
// create snapshot fo given table with specified ttl
193
195
createSnapshotWithTTL (TABLE_NAME , snapshotName , 1 );
194
196
Admin admin = UTIL .getAdmin ();
195
197
196
- assertEquals ( true , UTIL .getAdmin ().tableExists (TABLE_NAME ));
198
+ assertTrue ( UTIL .getAdmin ().tableExists (TABLE_NAME ));
197
199
198
200
// Sleep so that TTL may expire
199
201
Threads .sleep (2000 );
@@ -207,7 +209,7 @@ public void testCloneSnapshotFailsDueToTTLExpired() throws Exception {
207
209
}
208
210
209
211
// table should not be created
210
- assertEquals ( false , UTIL .getAdmin ().tableExists (CLONED_TABLE_NAME ));
212
+ assertFalse ( UTIL .getAdmin ().tableExists (CLONED_TABLE_NAME ));
211
213
}
212
214
213
215
private void createSnapshotWithTTL (TableName tableName , final String snapshotName ,
0 commit comments