Skip to content

Commit 2a8e700

Browse files
committed
BOOKKEEPER-879: Record ledger creation time
1 parent c43f0b4 commit 2a8e700

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

bookkeeper-server/src/test/java/org/apache/bookkeeper/client/ListLedgersTest.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* License for the specific language governing permissions and limitations under
1515
* the License.
1616
*/
17+
1718
package org.apache.bookkeeper.client;
1819

1920
import java.util.Iterator;
@@ -30,17 +31,16 @@
3031
import org.slf4j.LoggerFactory;
3132

3233
public class ListLedgersTest extends BaseTestCase {
33-
3434
private final static Logger LOG = LoggerFactory.getLogger(ListLedgersTest.class);
3535

3636
DigestType digestType;
3737

38-
public ListLedgersTest(DigestType digestType) {
38+
public ListLedgersTest (DigestType digestType) {
3939
super(4);
4040
this.digestType = digestType;
4141
}
4242

43-
@Test(timeout = 60000)
43+
@Test(timeout=60000)
4444
public void testListLedgers()
4545
throws Exception {
4646
int numOfLedgers = 10;
@@ -49,7 +49,7 @@ public void testListLedgers()
4949
.setZkServers(zkUtil.getZooKeeperConnectString());
5050

5151
BookKeeper bkc = new BookKeeper(conf);
52-
for (int i = 0; i < numOfLedgers; i++) {
52+
for (int i = 0; i < numOfLedgers ; i++) {
5353
bkc.createLedger(digestType, "testPasswd".
5454
getBytes()).close();
5555
}
@@ -59,15 +59,15 @@ public void testListLedgers()
5959
Iterable<Long> iterable = admin.listLedgers();
6060

6161
int counter = 0;
62-
for (Long lId : iterable) {
62+
for (Long lId: iterable) {
6363
counter++;
6464
}
6565

6666
Assert.assertTrue("Wrong number of ledgers: " + numOfLedgers,
6767
counter == numOfLedgers);
6868
}
6969

70-
@Test(timeout = 60000)
70+
@Test(timeout=60000)
7171
public void testEmptyList()
7272
throws Exception {
7373
ClientConfiguration conf = new ClientConfiguration()
@@ -80,7 +80,7 @@ public void testEmptyList()
8080
Assert.assertFalse("There should be no ledger", iterable.iterator().hasNext());
8181
}
8282

83-
@Test(timeout = 60000)
83+
@Test(timeout=60000)
8484
public void testRemoveNotSupported()
8585
throws Exception {
8686
int numOfLedgers = 1;
@@ -89,7 +89,7 @@ public void testRemoveNotSupported()
8989
.setZkServers(zkUtil.getZooKeeperConnectString());
9090

9191
BookKeeper bkc = new BookKeeper(conf);
92-
for (int i = 0; i < numOfLedgers; i++) {
92+
for (int i = 0; i < numOfLedgers ; i++) {
9393
bkc.createLedger(digestType, "testPasswd".
9494
getBytes()).close();
9595
}
@@ -98,7 +98,7 @@ public void testRemoveNotSupported()
9898
getZooKeeperConnectString());
9999
Iterator<Long> iterator = admin.listLedgers().iterator();
100100
iterator.next();
101-
try {
101+
try{
102102
iterator.remove();
103103
} catch (UnsupportedOperationException e) {
104104
// This exception is expected
@@ -132,4 +132,5 @@ public void testCtimeRecorded()
132132
}
133133

134134
}
135+
135136
}

0 commit comments

Comments
 (0)