Skip to content

Commit 7bb84a9

Browse files
committed
fix typos in test java files
Signed-off-by: ZhangJian He <[email protected]>
1 parent 4e00c8f commit 7bb84a9

File tree

60 files changed

+148
-148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+148
-148
lines changed

bookkeeper-common/src/test/java/org/apache/bookkeeper/common/util/TestSharedResourceManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public void destroyResourceWhenRefCountReachesZero() {
9898
assertEquals(SharedResourceManager.DESTROY_DELAY_SECONDS,
9999
scheduledDestroyTask.getDelay(TimeUnit.SECONDS));
100100

101-
// Simluate that the destroyer executes the foo destroying task
101+
// Simulate that the destroyer executes the foo destroying task
102102
scheduledDestroyTask.runTask();
103103
assertTrue(sharedFoo.closed);
104104

bookkeeper-server/src/test/java/org/apache/bookkeeper/auth/TestAuth.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public void testMultiMessageAuthFailure() throws Exception {
273273
fail("Shouldn't get this far");
274274
} catch (BKException.BKUnauthorizedAccessException bke) {
275275
// bookie should have sent a negative response before
276-
// breaking the conneciton
276+
// breaking the connection
277277
}
278278
assertFalse(ledgerId.get() == -1);
279279
assertEquals("Shouldn't have entry", 0, entryCount(ledgerId.get(), bookieConf, clientConf));
@@ -300,7 +300,7 @@ public void testDifferentPluginFailure() throws Exception {
300300
fail("Shouldn't get this far");
301301
} catch (BKException.BKUnauthorizedAccessException bke) {
302302
// bookie should have sent a negative response before
303-
// breaking the conneciton
303+
// breaking the connection
304304
assertEquals(ProtocolVersion.ProtocolV3, protocolVersion);
305305
} catch (BKException.BKNotEnoughBookiesException nebe) {
306306
// With V2 we don't get the authorization error, but rather just
@@ -316,7 +316,7 @@ public void testDifferentPluginFailure() throws Exception {
316316
* doesn't implement the interface, we fail predictably.
317317
*/
318318
@Test
319-
public void testExistantButNotValidPlugin() throws Exception {
319+
public void testExistentButNotValidPlugin() throws Exception {
320320
ServerConfiguration bookieConf = newServerConfiguration();
321321
bookieConf.setBookieAuthProviderFactoryClass(
322322
"java.lang.String");
@@ -351,14 +351,14 @@ public void testExistantButNotValidPlugin() throws Exception {
351351
* break.
352352
*/
353353
@Test
354-
public void testNonExistantPlugin() throws Exception {
354+
public void testNonExistentPlugin() throws Exception {
355355
ServerConfiguration bookieConf = newServerConfiguration();
356356
bookieConf.setBookieAuthProviderFactoryClass(
357-
"NonExistantClassNameForTestingAuthPlugins");
357+
"NonExistentClassNameForTestingAuthPlugins");
358358

359359
ClientConfiguration clientConf = newClientConfiguration();
360360
clientConf.setClientAuthProviderFactoryClass(
361-
"NonExistantClassNameForTestingAuthPlugins");
361+
"NonExistentClassNameForTestingAuthPlugins");
362362
try {
363363
startAndStoreBookie(bookieConf);
364364
fail("Shouldn't get this far");

bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieInitializationTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public void testBookieRegistrationWithSameZooKeeperClient() throws Exception {
324324
"Bookie registration node doesn't exists!",
325325
rm.isBookieRegistered(bookieId));
326326

327-
// test register bookie again if the registeration node is created by itself.
327+
// test register bookie again if the registration node is created by itself.
328328
manager.registerBookie(true).get();
329329
assertTrue(
330330
"Bookie registration node doesn't exists!",
@@ -742,11 +742,11 @@ bkConf, new TestBookieImpl(conf),
742742
* OutOfMemoryError.
743743
*/
744744
public static class MockInterleavedLedgerStorage extends InterleavedLedgerStorage {
745-
AtomicInteger atmoicInt = new AtomicInteger(0);
745+
AtomicInteger atomicInt = new AtomicInteger(0);
746746

747747
@Override
748748
public long addEntry(ByteBuf entry) throws IOException {
749-
if (atmoicInt.incrementAndGet() == 10) {
749+
if (atomicInt.incrementAndGet() == 10) {
750750
throw new OutOfMemoryError("Some Injected Exception");
751751
}
752752
return super.addEntry(entry);
@@ -1676,7 +1676,7 @@ private void bookieConnectAfterCookieDeleteWorker(ServerConfiguration conf, Regi
16761676

16771677
final BookieId bookieAddress = BookieImpl.getBookieId(conf);
16781678

1679-
// Read cookie from registation manager
1679+
// Read cookie from registration manager
16801680
Versioned<Cookie> rmCookie = Cookie.readFromRegistrationManager(rm, bookieAddress);
16811681

16821682
// Shutdown bookie

bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CreateNewLogTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ public List<File> getWritableLedgerDirsForNewLog() throws NoWritableLedgerDirExc
862862
/*
863863
* In a new thread, create newlog for 'firstLedgerId' and then set
864864
* 'newLogCreated' to true. Since this is the first createNewLog call,
865-
* it is going to be blocked untill latch is countdowned to 0.
865+
* it is going to be blocked until latch is countdowned to 0.
866866
*/
867867
new Thread() {
868868
@Override

bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/DefaultEntryLogTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ public void testExpiryRemovalByAccessingNonCacheRelatedMethods() throws Exceptio
13821382
BufferedLogChannel newLogChannel = createDummyBufferedLogChannel(entryLogger, 1, conf);
13831383
entryLogManager.setCurrentLogForLedgerAndAddToRotate(ledgerId, newLogChannel);
13841384

1385-
AtomicBoolean exceptionOccured = new AtomicBoolean(false);
1385+
AtomicBoolean exceptionOccurred = new AtomicBoolean(false);
13861386
Thread t = new Thread() {
13871387
public void run() {
13881388
try {
@@ -1402,15 +1402,15 @@ public void run() {
14021402
entryLogManager.getCurrentLogIfPresent(newLedgerId);
14031403
} catch (Exception e) {
14041404
LOG.error("Got Exception in thread", e);
1405-
exceptionOccured.set(true);
1405+
exceptionOccurred.set(true);
14061406
}
14071407
}
14081408
};
14091409

14101410
t.start();
14111411
Thread.sleep(evictionPeriod * 1000 + 100);
14121412
entryLogManager.doEntryLogMapCleanup();
1413-
Assert.assertFalse("Exception occured in thread, which is not expected", exceptionOccured.get());
1413+
Assert.assertFalse("Exception occurred in thread, which is not expected", exceptionOccurred.get());
14141414

14151415
/*
14161416
* since for more than evictionPeriod, that ledger is not accessed and cache is cleaned up, mapping for that

bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/IndexPersistenceMgrTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public void testGetFileInfoReadBeforeWrite() throws Exception {
164164
indexPersistenceMgr.getFileInfo(lid, null);
165165
fail("Should fail get file info for reading if the file doesn't exist");
166166
} catch (Bookie.NoLedgerException nle) {
167-
// exepcted
167+
// expected
168168
}
169169
assertEquals(0, indexPersistenceMgr.writeFileInfoCache.size());
170170
assertEquals(0, indexPersistenceMgr.readFileInfoCache.size());
@@ -468,7 +468,7 @@ void validateFileInfo(IndexPersistenceMgr indexPersistenceMgr, long ledgerId, in
468468
assertEquals("explicitLac ByteBuf contents should match", 0,
469469
ByteBufUtil.compare(explicitLacByteBuf, indexPersistenceMgr.getExplicitLac(ledgerId)));
470470
/*
471-
* release fileInfo untill it is marked dead and closed, so that
471+
* release fileInfo until it is marked dead and closed, so that
472472
* contents of it are persisted.
473473
*/
474474
while (fileInfo.refCount.get() != FileInfoBackingCache.DEAD_REF) {

bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerCacheTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public void testPageEviction() throws Exception {
225225
// create ledger cache
226226
newLedgerCache();
227227
try {
228-
// create serveral ledgers
228+
// create several ledgers
229229
for (int i = 1; i <= numLedgers; i++) {
230230
ledgerCache.setMasterKey((long) i, masterKey);
231231
ledgerCache.putEntryOffset(i, 0, i * 8);
@@ -237,7 +237,7 @@ public void testPageEviction() throws Exception {
237237
// flush all
238238
ledgerCache.flushLedger(true);
239239

240-
// delete serveral ledgers
240+
// delete several ledgers
241241
for (int i = 1; i <= numLedgers / 2; i++) {
242242
ledgerCache.deleteLedger(i);
243243
}

bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerStorageCheckpointTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ conf, new TestBookieImpl(conf),
261261
LogMark curMarkAfterFirstSetOfAdds = lastLogMarkAfterFirstSetOfAdds.getCurMark();
262262

263263
File lastMarkFile = new File(ledgerDir, "lastMark");
264-
// lastMark file should be zero, because checkpoint hasn't happenend
264+
// lastMark file should be zero, because checkpoint hasn't happened
265265
LogMark logMarkFileBeforeCheckpoint = readLastMarkFile(lastMarkFile);
266266
Assert.assertEquals("lastMarkFile before checkpoint should be zero", 0,
267267
logMarkFileBeforeCheckpoint.compare(new LogMark()));
@@ -282,7 +282,7 @@ conf, new TestBookieImpl(conf),
282282
LogMark curMarkAfterCheckpoint = lastLogMarkAfterCheckpoint.getCurMark();
283283

284284
LogMark rolledLogMark = readLastMarkFile(lastMarkFile);
285-
Assert.assertNotEquals("rolledLogMark should not be zero, since checkpoint has happenend", 0,
285+
Assert.assertNotEquals("rolledLogMark should not be zero, since checkpoint has happened", 0,
286286
rolledLogMark.compare(new LogMark()));
287287
/*
288288
* Curmark should be equal before and after checkpoint, because we didnt
@@ -558,7 +558,7 @@ conf, new TestBookieImpl(conf),
558558
executorController.advance(Duration.ofMillis(conf.getFlushInterval()));
559559

560560
/*
561-
* since checkpoint happenend, there shouldn't be any logChannelsToFlush
561+
* since checkpoint happened, there shouldn't be any logChannelsToFlush
562562
* and bytesWrittenSinceLastFlush should be zero.
563563
*/
564564
List<DefaultEntryLogger.BufferedLogChannel> copyOfRotatedLogChannels = entryLogManager.getRotatedLogChannels();
@@ -673,7 +673,7 @@ conf, new TestBookieImpl(conf),
673673
Assert.assertTrue("lastMark file must be existing, because checkpoint should have happened",
674674
lastMarkFile.exists());
675675
LogMark rolledLogMark = readLastMarkFile(lastMarkFile);
676-
Assert.assertNotEquals("rolledLogMark should not be zero, since checkpoint has happenend", 0,
676+
Assert.assertNotEquals("rolledLogMark should not be zero, since checkpoint has happened", 0,
677677
rolledLogMark.compare(new LogMark()));
678678

679679
bkClient.close();

bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/UpgradeTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static File initV2LedgerDirectoryWithIndexDir(File ledgerDir, File indexDir) thr
185185
return ledgerDir;
186186
}
187187

188-
private static void testUpgradeProceedure(String zkServers, String journalDir, String ledgerDir, String indexDir)
188+
private static void testUpgradeProcedure(String zkServers, String journalDir, String ledgerDir, String indexDir)
189189
throws Exception {
190190
ServerConfiguration conf = TestBKConfiguration.newServerConfiguration();
191191
conf.setMetadataServiceUri("zk://" + zkServers + "/ledgers");
@@ -250,7 +250,7 @@ private static void testUpgradeProceedure(String zkServers, String journalDir, S
250250
public void testUpgradeV1toCurrent() throws Exception {
251251
File journalDir = initV1JournalDirectory(tmpDirs.createNew("bookie", "journal"));
252252
File ledgerDir = initV1LedgerDirectory(tmpDirs.createNew("bookie", "ledger"));
253-
testUpgradeProceedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(),
253+
testUpgradeProcedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(),
254254
ledgerDir.getPath(), ledgerDir.getPath());
255255
}
256256

@@ -260,7 +260,7 @@ public void testUpgradeV1toCurrentWithIndexDir() throws Exception {
260260
File indexDir = tmpDirs.createNew("bookie", "index");
261261
File ledgerDir = initV1LedgerDirectoryWithIndexDir(
262262
tmpDirs.createNew("bookie", "ledger"), indexDir);
263-
testUpgradeProceedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(),
263+
testUpgradeProcedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(),
264264
ledgerDir.getPath(), indexDir.getPath());
265265
}
266266

@@ -269,7 +269,7 @@ public void testUpgradeV2toCurrent() throws Exception {
269269
File journalDir = initV2JournalDirectory(tmpDirs.createNew("bookie", "journal"));
270270
File ledgerDir = initV2LedgerDirectory(tmpDirs.createNew("bookie", "ledger"));
271271
File indexDir = tmpDirs.createNew("bookie", "index");
272-
testUpgradeProceedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(),
272+
testUpgradeProcedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(),
273273
ledgerDir.getPath(), indexDir.getPath());
274274
}
275275

@@ -279,7 +279,7 @@ public void testUpgradeV2toCurrentWithIndexDir() throws Exception {
279279
File indexDir = tmpDirs.createNew("bookie", "index");
280280
File ledgerDir = initV2LedgerDirectoryWithIndexDir(
281281
tmpDirs.createNew("bookie", "ledger"), indexDir);
282-
testUpgradeProceedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(),
282+
testUpgradeProcedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(),
283283
ledgerDir.getPath(), indexDir.getPath());
284284
}
285285

@@ -304,7 +304,7 @@ public void testUpgradeCurrent(boolean hasIndexDir) throws Exception {
304304
initV2LedgerDirectory(ledgerDir);
305305
}
306306

307-
testUpgradeProceedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(),
307+
testUpgradeProcedure(zkUtil.getZooKeeperConnectString(), journalDir.getPath(),
308308
ledgerDir.getPath(), indexDir.getPath());
309309

310310
// Upgrade again

bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/storage/ldb/DbReadLedgerIndexEntriesTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ public void testReadLedgerIndexEntries() throws Exception {
125125
try {
126126
for (ledgerId = TEST_LEDGER_MIN_ID; ledgerId <= TEST_LEDGER_MAX_ID; ledgerId++) {
127127
BlockingQueue<Long> entrys = new ArrayBlockingQueue<>(TEST_ENTRY_MAX_ID + 1);
128-
DbLedgerStorage.readLedgerIndexEntries(ledgerId, conf, (eId, entryLodId, pos) -> {
129-
System.out.println("entry " + eId + "\t:\t(log: " + entryLodId + ", pos: " + pos + ")");
128+
DbLedgerStorage.readLedgerIndexEntries(ledgerId, conf, (eId, entryLogId, pos) -> {
129+
System.out.println("entry " + eId + "\t:\t(log: " + entryLogId + ", pos: " + pos + ")");
130130
entrys.add(eId);
131131
});
132132
for (long entryId = TEST_ENTRY_MIN_ID; entryId <= TEST_ENTRY_MAX_ID; entryId++) {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public void createComplete(int rc, LedgerHandle lh, Object ctx) {
151151
// wait for creating the ledger
152152
assertTrue("create ledger call should have completed",
153153
openLatch.await(20, TimeUnit.SECONDS));
154-
assertEquals("Succesfully created ledger through closed bkclient!",
154+
assertEquals("Successfully created ledger through closed bkclient!",
155155
BKException.Code.ClientClosedException, returnCode.get());
156156
}
157157

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public void testAsyncReadWithError() throws Exception {
218218
final AtomicInteger result = new AtomicInteger(0);
219219
final CountDownLatch counter = new CountDownLatch(1);
220220

221-
// Try to write, we shoud get and error callback but not an exception
221+
// Try to write, we should get and error callback but not an exception
222222
lh.asyncAddEntry("test".getBytes(), new AddCallback() {
223223
public void addComplete(int rc, LedgerHandle lh, long entryId, Object ctx) {
224224
result.set(rc);
@@ -398,7 +398,7 @@ public void testReadAfterLastAddConfirmed() throws Exception {
398398
// without readUnconfirmedEntries we are not able to read all of the entries
399399
try {
400400
rlh.readEntries(0, numOfEntries - 1);
401-
fail("shoud not be able to read up to " + (numOfEntries - 1) + " with readEntries");
401+
fail("should not be able to read up to " + (numOfEntries - 1) + " with readEntries");
402402
} catch (BKException.BKReadException expected) {
403403
}
404404

@@ -480,7 +480,7 @@ public void testReadAfterLastAddConfirmed() throws Exception {
480480
// without readUnconfirmedEntries we are not able to read all of the entries
481481
try {
482482
rlh.readEntries(0, numOfEntries - 1);
483-
fail("shoud not be able to read up to " + (numOfEntries - 1) + " with readEntries");
483+
fail("should not be able to read up to " + (numOfEntries - 1) + " with readEntries");
484484
} catch (BKException.BKReadException expected) {
485485
}
486486

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ public void testLedgerCreateAdvAndWriteNonAdv() throws Exception {
466466
}
467467

468468
/**
469-
* Verify that LedgerHandleAdv cannnot handle addEntry without the entryId.
469+
* Verify that LedgerHandleAdv cannot handle addEntry without the entryId.
470470
*
471471
* @throws Exception
472472
*/

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void testForceRequiresFullEnsemble() throws Exception {
146146
}
147147

148148
@Test
149-
public void testForceWillAdvanceLacOnlyUpToLastAcknoledgedWrite() throws Exception {
149+
public void testForceWillAdvanceLacOnlyUpToLastAcknowledgedWrite() throws Exception {
150150
try (WriteHandle wh = result(newCreateLedgerOp()
151151
.withEnsembleSize(3)
152152
.withWriteQuorumSize(3)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public void testNewEnsemble() throws Exception {
113113
}
114114

115115
@Test
116-
public void testNewEnsembleWithNotEnoughtBookies() throws Exception {
116+
public void testNewEnsembleWithNotEnoughBookies() throws Exception {
117117
numBookies = 0;
118118
try {
119119
startBKCluster(zkUtil.getMetadataServiceUri());

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public void testHandlingFailuresOneBookieFailsAfterOneEntry() throws Exception {
171171
}
172172

173173
@Test(timeout = 30000)
174-
public void testHandlingFailuresMultipleBookieFailImmediatelyNotEnoughToReplace() throws Exception {
174+
public void testHandlingFailuresMultipleBookieFailImmediatelyNotEnoughoReplace() throws Exception {
175175
MockClientContext clientCtx = MockClientContext.create();
176176
Versioned<LedgerMetadata> md = ClientUtil.setupLedger(clientCtx, 10L,
177177
LedgerMetadataBuilder.create()
@@ -197,7 +197,7 @@ public void testHandlingFailuresMultipleBookieFailImmediatelyNotEnoughToReplace(
197197
}
198198

199199
@Test(timeout = 30000)
200-
public void testHandlingFailuresMultipleBookieFailAfterOneEntryNotEnoughToReplace() throws Exception {
200+
public void testHandlingFailuresMultipleBookieFailAfterOneEntryNotEnoughoReplace() throws Exception {
201201
MockClientContext clientCtx = MockClientContext.create();
202202
Versioned<LedgerMetadata> md = ClientUtil.setupLedger(clientCtx, 10L,
203203
LedgerMetadataBuilder.create()

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public void testRecoveryTwoBookiesFailOnSameEntry() throws Exception {
294294
}
295295

296296
/**
297-
* This test verifies the fix for the data loss scenario found by the TLA+ specfication, specifically
297+
* This test verifies the fix for the data loss scenario found by the TLA+ specification, specifically
298298
* the invariant violation that metadata and writer can diverge. The scenario is that the original writer
299299
* can commit an entry e that will later be lost because a second writer can close the ledger at e-1.
300300
* The cause is that fencing was originally only performed on LAC reads which is not enough to prevent

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public void testBasicUpdate() throws Exception {
9898
}
9999

100100
/**
101-
* Test that when 2 update loops conflict when making diffent updates to the metadata,
101+
* Test that when 2 update loops conflict when making different updates to the metadata,
102102
* both will eventually succeed, and both updates will be reflected in the final metadata.
103103
*/
104104
@Test
@@ -446,7 +446,7 @@ public synchronized CompletableFuture<Versioned<LedgerMetadata>> writeLedgerMeta
446446
.whenComplete((written, exception) -> {
447447
synchronized (DeferCallbacksMockLedgerManager.this) {
448448
if (writeCount++ < numToDefer) {
449-
LOG.info("Added to deferals");
449+
LOG.info("Added to deferrals");
450450
deferred.add(Triple.of(promise, written, exception));
451451
} else {
452452
LOG.info("Completing {}", numToDefer);

0 commit comments

Comments
 (0)