14
14
* License for the specific language governing permissions and limitations under
15
15
* the License.
16
16
*/
17
+
17
18
package org .apache .bookkeeper .client ;
18
19
19
20
import java .util .Iterator ;
30
31
import org .slf4j .LoggerFactory ;
31
32
32
33
public class ListLedgersTest extends BaseTestCase {
33
-
34
34
private final static Logger LOG = LoggerFactory .getLogger (ListLedgersTest .class );
35
35
36
36
DigestType digestType ;
37
37
38
- public ListLedgersTest (DigestType digestType ) {
38
+ public ListLedgersTest (DigestType digestType ) {
39
39
super (4 );
40
40
this .digestType = digestType ;
41
41
}
42
42
43
- @ Test (timeout = 60000 )
43
+ @ Test (timeout = 60000 )
44
44
public void testListLedgers ()
45
45
throws Exception {
46
46
int numOfLedgers = 10 ;
@@ -49,7 +49,7 @@ public void testListLedgers()
49
49
.setZkServers (zkUtil .getZooKeeperConnectString ());
50
50
51
51
BookKeeper bkc = new BookKeeper (conf );
52
- for (int i = 0 ; i < numOfLedgers ; i ++) {
52
+ for (int i = 0 ; i < numOfLedgers ; i ++) {
53
53
bkc .createLedger (digestType , "testPasswd" .
54
54
getBytes ()).close ();
55
55
}
@@ -59,15 +59,15 @@ public void testListLedgers()
59
59
Iterable <Long > iterable = admin .listLedgers ();
60
60
61
61
int counter = 0 ;
62
- for (Long lId : iterable ) {
62
+ for (Long lId : iterable ) {
63
63
counter ++;
64
64
}
65
65
66
66
Assert .assertTrue ("Wrong number of ledgers: " + numOfLedgers ,
67
67
counter == numOfLedgers );
68
68
}
69
69
70
- @ Test (timeout = 60000 )
70
+ @ Test (timeout = 60000 )
71
71
public void testEmptyList ()
72
72
throws Exception {
73
73
ClientConfiguration conf = new ClientConfiguration ()
@@ -80,7 +80,7 @@ public void testEmptyList()
80
80
Assert .assertFalse ("There should be no ledger" , iterable .iterator ().hasNext ());
81
81
}
82
82
83
- @ Test (timeout = 60000 )
83
+ @ Test (timeout = 60000 )
84
84
public void testRemoveNotSupported ()
85
85
throws Exception {
86
86
int numOfLedgers = 1 ;
@@ -89,7 +89,7 @@ public void testRemoveNotSupported()
89
89
.setZkServers (zkUtil .getZooKeeperConnectString ());
90
90
91
91
BookKeeper bkc = new BookKeeper (conf );
92
- for (int i = 0 ; i < numOfLedgers ; i ++) {
92
+ for (int i = 0 ; i < numOfLedgers ; i ++) {
93
93
bkc .createLedger (digestType , "testPasswd" .
94
94
getBytes ()).close ();
95
95
}
@@ -98,7 +98,7 @@ public void testRemoveNotSupported()
98
98
getZooKeeperConnectString ());
99
99
Iterator <Long > iterator = admin .listLedgers ().iterator ();
100
100
iterator .next ();
101
- try {
101
+ try {
102
102
iterator .remove ();
103
103
} catch (UnsupportedOperationException e ) {
104
104
// This exception is expected
@@ -132,4 +132,5 @@ public void testCtimeRecorded()
132
132
}
133
133
134
134
}
135
+
135
136
}
0 commit comments