Skip to content

Commit

Permalink
Use Named arguments in parameterized tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Mar 16, 2022
1 parent 8a0c4ca commit c462fe3
Show file tree
Hide file tree
Showing 28 changed files with 416 additions and 366 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,7 +35,7 @@
class DataBufferTests extends AbstractDataBufferAllocatingTests {

@ParameterizedDataBufferAllocatingTest
void byteCountsAndPositions(String displayName, DataBufferFactory bufferFactory) {
void byteCountsAndPositions(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(2);
Expand Down Expand Up @@ -78,7 +78,7 @@ void byteCountsAndPositions(String displayName, DataBufferFactory bufferFactory)
}

@ParameterizedDataBufferAllocatingTest
void readPositionSmallerThanZero(String displayName, DataBufferFactory bufferFactory) {
void readPositionSmallerThanZero(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(1);
Expand All @@ -92,7 +92,7 @@ void readPositionSmallerThanZero(String displayName, DataBufferFactory bufferFac
}

@ParameterizedDataBufferAllocatingTest
void readPositionGreaterThanWritePosition(String displayName, DataBufferFactory bufferFactory) {
void readPositionGreaterThanWritePosition(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(1);
Expand All @@ -106,7 +106,7 @@ void readPositionGreaterThanWritePosition(String displayName, DataBufferFactory
}

@ParameterizedDataBufferAllocatingTest
void writePositionSmallerThanReadPosition(String displayName, DataBufferFactory bufferFactory) {
void writePositionSmallerThanReadPosition(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(2);
Expand All @@ -122,7 +122,7 @@ void writePositionSmallerThanReadPosition(String displayName, DataBufferFactory
}

@ParameterizedDataBufferAllocatingTest
void writePositionGreaterThanCapacity(String displayName, DataBufferFactory bufferFactory) {
void writePositionGreaterThanCapacity(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(1);
Expand All @@ -136,7 +136,7 @@ void writePositionGreaterThanCapacity(String displayName, DataBufferFactory buff
}

@ParameterizedDataBufferAllocatingTest
void writeAndRead(String displayName, DataBufferFactory bufferFactory) {
void writeAndRead(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(5);
Expand All @@ -157,7 +157,7 @@ void writeAndRead(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void writeNullString(String displayName, DataBufferFactory bufferFactory) {
void writeNullString(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(1);
Expand All @@ -171,7 +171,7 @@ void writeNullString(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void writeNullCharset(String displayName, DataBufferFactory bufferFactory) {
void writeNullCharset(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(1);
Expand All @@ -185,7 +185,7 @@ void writeNullCharset(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void writeEmptyString(String displayName, DataBufferFactory bufferFactory) {
void writeEmptyString(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(1);
Expand All @@ -197,7 +197,7 @@ void writeEmptyString(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void writeUtf8String(String displayName, DataBufferFactory bufferFactory) {
void writeUtf8String(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(6);
Expand All @@ -211,7 +211,7 @@ void writeUtf8String(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void writeUtf8StringOutGrowsCapacity(String displayName, DataBufferFactory bufferFactory) {
void writeUtf8StringOutGrowsCapacity(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(5);
Expand All @@ -225,7 +225,7 @@ void writeUtf8StringOutGrowsCapacity(String displayName, DataBufferFactory buffe
}

@ParameterizedDataBufferAllocatingTest
void writeIsoString(String displayName, DataBufferFactory bufferFactory) {
void writeIsoString(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(3);
Expand All @@ -239,7 +239,7 @@ void writeIsoString(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void writeMultipleUtf8String(String displayName, DataBufferFactory bufferFactory) {
void writeMultipleUtf8String(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(1);
Expand All @@ -261,7 +261,7 @@ void writeMultipleUtf8String(String displayName, DataBufferFactory bufferFactory
}

@ParameterizedDataBufferAllocatingTest
void toStringNullCharset(String displayName, DataBufferFactory bufferFactory) {
void toStringNullCharset(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(1);
Expand All @@ -275,7 +275,7 @@ void toStringNullCharset(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void toStringUtf8(String displayName, DataBufferFactory bufferFactory) {
void toStringUtf8(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

String spring = "Spring";
Expand All @@ -290,7 +290,7 @@ void toStringUtf8(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void toStringSection(String displayName, DataBufferFactory bufferFactory) {
void toStringSection(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

String spring = "Spring";
Expand All @@ -305,7 +305,7 @@ void toStringSection(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void inputStream(String displayName, DataBufferFactory bufferFactory) throws Exception {
void inputStream(DataBufferFactory bufferFactory) throws Exception {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(4);
Expand Down Expand Up @@ -339,7 +339,7 @@ void inputStream(String displayName, DataBufferFactory bufferFactory) throws Exc
}

@ParameterizedDataBufferAllocatingTest
void inputStreamReleaseOnClose(String displayName, DataBufferFactory bufferFactory) throws Exception {
void inputStreamReleaseOnClose(DataBufferFactory bufferFactory) throws Exception {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(3);
Expand All @@ -357,7 +357,7 @@ void inputStreamReleaseOnClose(String displayName, DataBufferFactory bufferFacto
}

@ParameterizedDataBufferAllocatingTest
void outputStream(String displayName, DataBufferFactory bufferFactory) throws Exception {
void outputStream(DataBufferFactory bufferFactory) throws Exception {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(4);
Expand All @@ -377,7 +377,7 @@ void outputStream(String displayName, DataBufferFactory bufferFactory) throws Ex
}

@ParameterizedDataBufferAllocatingTest
void expand(String displayName, DataBufferFactory bufferFactory) {
void expand(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(1);
Expand All @@ -391,7 +391,7 @@ void expand(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void increaseCapacity(String displayName, DataBufferFactory bufferFactory) {
void increaseCapacity(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(1);
Expand All @@ -404,7 +404,7 @@ void increaseCapacity(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void decreaseCapacityLowReadPosition(String displayName, DataBufferFactory bufferFactory) {
void decreaseCapacityLowReadPosition(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(2);
Expand All @@ -416,7 +416,7 @@ void decreaseCapacityLowReadPosition(String displayName, DataBufferFactory buffe
}

@ParameterizedDataBufferAllocatingTest
void decreaseCapacityHighReadPosition(String displayName, DataBufferFactory bufferFactory) {
void decreaseCapacityHighReadPosition(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(2);
Expand All @@ -429,7 +429,7 @@ void decreaseCapacityHighReadPosition(String displayName, DataBufferFactory buff
}

@ParameterizedDataBufferAllocatingTest
void capacityLessThanZero(String displayName, DataBufferFactory bufferFactory) {
void capacityLessThanZero(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(1);
Expand All @@ -443,7 +443,7 @@ void capacityLessThanZero(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void writeByteBuffer(String displayName, DataBufferFactory bufferFactory) {
void writeByteBuffer(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer1 = createDataBuffer(1);
Expand Down Expand Up @@ -472,7 +472,7 @@ private ByteBuffer createByteBuffer(int capacity) {
}

@ParameterizedDataBufferAllocatingTest
void writeDataBuffer(String displayName, DataBufferFactory bufferFactory) {
void writeDataBuffer(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer1 = createDataBuffer(1);
Expand All @@ -495,7 +495,7 @@ void writeDataBuffer(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void asByteBuffer(String displayName, DataBufferFactory bufferFactory) {
void asByteBuffer(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(4);
Expand All @@ -516,7 +516,7 @@ void asByteBuffer(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void asByteBufferIndexLength(String displayName, DataBufferFactory bufferFactory) {
void asByteBufferIndexLength(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(3);
Expand All @@ -536,7 +536,7 @@ void asByteBufferIndexLength(String displayName, DataBufferFactory bufferFactory
}

@ParameterizedDataBufferAllocatingTest
void byteBufferContainsDataBufferChanges(String displayName, DataBufferFactory bufferFactory) {
void byteBufferContainsDataBufferChanges(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer dataBuffer = createDataBuffer(1);
Expand All @@ -552,7 +552,7 @@ void byteBufferContainsDataBufferChanges(String displayName, DataBufferFactory b
}

@ParameterizedDataBufferAllocatingTest
void dataBufferContainsByteBufferChanges(String displayName, DataBufferFactory bufferFactory) {
void dataBufferContainsByteBufferChanges(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer dataBuffer = createDataBuffer(1);
Expand All @@ -568,7 +568,7 @@ void dataBufferContainsByteBufferChanges(String displayName, DataBufferFactory b
}

@ParameterizedDataBufferAllocatingTest
void emptyAsByteBuffer(String displayName, DataBufferFactory bufferFactory) {
void emptyAsByteBuffer(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(1);
Expand All @@ -580,7 +580,7 @@ void emptyAsByteBuffer(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void indexOf(String displayName, DataBufferFactory bufferFactory) {
void indexOf(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(3);
Expand All @@ -602,7 +602,7 @@ void indexOf(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void lastIndexOf(String displayName, DataBufferFactory bufferFactory) {
void lastIndexOf(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(3);
Expand Down Expand Up @@ -633,7 +633,7 @@ void lastIndexOf(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void slice(String displayName, DataBufferFactory bufferFactory) {
void slice(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(3);
Expand Down Expand Up @@ -662,7 +662,7 @@ void slice(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void retainedSlice(String displayName, DataBufferFactory bufferFactory) {
void retainedSlice(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(3);
Expand Down Expand Up @@ -691,7 +691,7 @@ void retainedSlice(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void spr16351(String displayName, DataBufferFactory bufferFactory) {
void spr16351(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = createDataBuffer(6);
Expand All @@ -711,7 +711,7 @@ void spr16351(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void join(String displayName, DataBufferFactory bufferFactory) {
void join(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer composite = this.bufferFactory.join(Arrays.asList(stringBuffer("a"),
Expand All @@ -726,7 +726,7 @@ void join(String displayName, DataBufferFactory bufferFactory) {
}

@ParameterizedDataBufferAllocatingTest
void getByte(String displayName, DataBufferFactory bufferFactory) {
void getByte(DataBufferFactory bufferFactory) {
super.bufferFactory = bufferFactory;

DataBuffer buffer = stringBuffer("abc");
Expand Down
Loading

0 comments on commit c462fe3

Please sign in to comment.