@@ -234,8 +234,8 @@ private void bufferShouldReleased(boolean zeroSizeFile) throws IOException {
234
234
OSSDataBlocks .ByteBufferBlockFactory
235
235
blockFactory = (OSSDataBlocks .ByteBufferBlockFactory )
236
236
((AliyunOSSFileSystem )fs ).getBlockFactory ();
237
- assertEquals (
238
- 0 , blockFactory . getOutstandingBufferCount (), "outstanding buffers in " + blockFactory );
237
+ assertEquals (0 , blockFactory . getOutstandingBufferCount (),
238
+ "outstanding buffers in " + blockFactory );
239
239
}
240
240
}
241
241
BlockOutputStreamStatistics statistics =
@@ -287,8 +287,8 @@ public void testDirectoryAllocatorRR() throws Throwable {
287
287
tmp1 .delete ();
288
288
File tmp2 = AliyunOSSUtils .createTmpFileForWrite ("out-" , 1024 , conf );
289
289
tmp2 .delete ();
290
- assertNotEquals (
291
- tmp1 . getParent (), tmp2 . getParent (), "round robin not working" );
290
+ assertNotEquals (tmp1 . getParent (), tmp2 . getParent (),
291
+ "round robin not working" );
292
292
}
293
293
294
294
@ Test
@@ -298,18 +298,17 @@ public void testByteBufferIO() throws IOException {
298
298
int limit = 128 ;
299
299
OSSDataBlocks .ByteBufferBlockFactory .ByteBufferBlock block
300
300
= factory .create (1 , limit , null );
301
- assertEquals (
302
- 1 , factory . getOutstandingBufferCount (), "outstanding buffers in " + factory );
301
+ assertEquals (1 , factory . getOutstandingBufferCount (),
302
+ "outstanding buffers in " + factory );
303
303
304
304
byte [] buffer = ContractTestUtils .toAsciiByteArray ("test data" );
305
305
int bufferLen = buffer .length ;
306
306
block .write (buffer , 0 , bufferLen );
307
307
assertEquals (bufferLen , block .dataSize ());
308
- assertEquals (
309
- limit - bufferLen , block . remainingCapacity (), "capacity in " + block );
308
+ assertEquals (limit - bufferLen , block . remainingCapacity (),
309
+ "capacity in " + block );
310
310
assertTrue (block .hasCapacity (64 ), "hasCapacity(64) in " + block );
311
- assertTrue (
312
- block .hasCapacity (limit - bufferLen ), "No capacity in " + block );
311
+ assertTrue (block .hasCapacity (limit - bufferLen ), "No capacity in " + block );
313
312
314
313
// now start the write
315
314
OSSDataBlocks .BlockUploadData blockUploadData = block .startUpload ();
@@ -321,14 +320,14 @@ public void testByteBufferIO() throws IOException {
321
320
assertTrue (stream .hasRemaining (), "!hasRemaining() in " + stream );
322
321
323
322
int expected = bufferLen ;
324
- assertEquals (
325
- expected , stream . available (), "wrong available() in " + stream );
323
+ assertEquals (expected , stream . available (),
324
+ "wrong available() in " + stream );
326
325
327
326
assertEquals ('t' , stream .read ());
328
327
stream .mark (limit );
329
328
expected --;
330
- assertEquals (
331
- expected , stream . available (), "wrong available() in " + stream );
329
+ assertEquals (expected , stream . available (),
330
+ "wrong available() in " + stream );
332
331
333
332
// read into a byte array with an offset
334
333
int offset = 5 ;
@@ -337,8 +336,8 @@ public void testByteBufferIO() throws IOException {
337
336
assertEquals ('e' , in [offset ]);
338
337
assertEquals ('s' , in [offset + 1 ]);
339
338
expected -= 2 ;
340
- assertEquals (
341
- expected , stream . available (), "wrong available() in " + stream );
339
+ assertEquals (expected , stream . available (),
340
+ "wrong available() in " + stream );
342
341
343
342
// read to end
344
343
byte [] remainder = new byte [limit ];
@@ -350,8 +349,7 @@ public void testByteBufferIO() throws IOException {
350
349
assertEquals (expected , index );
351
350
assertEquals ('a' , remainder [--index ]);
352
351
353
- assertEquals (
354
- 0 , stream .available (), "wrong available() in " + stream );
352
+ assertEquals (0 , stream .available (), "wrong available() in " + stream );
355
353
assertTrue (!stream .hasRemaining (), "hasRemaining() in " + stream );
356
354
357
355
// go the mark point
@@ -360,14 +358,14 @@ public void testByteBufferIO() throws IOException {
360
358
361
359
// when the stream is closed, the data should be returned
362
360
stream .close ();
363
- assertEquals (
364
- 1 , factory . getOutstandingBufferCount (), "outstanding buffers in " + factory );
361
+ assertEquals (1 , factory . getOutstandingBufferCount (),
362
+ "outstanding buffers in " + factory );
365
363
block .close ();
366
- assertEquals (
367
- 0 , factory . getOutstandingBufferCount (), "outstanding buffers in " + factory );
364
+ assertEquals (0 , factory . getOutstandingBufferCount (),
365
+ "outstanding buffers in " + factory );
368
366
stream .close ();
369
- assertEquals (
370
- 0 , factory . getOutstandingBufferCount (), "outstanding buffers in " + factory );
367
+ assertEquals (0 , factory . getOutstandingBufferCount (),
368
+ "outstanding buffers in " + factory );
371
369
}
372
370
}
373
371
0 commit comments