Class UtilsTest
java.lang.Object
org.apache.kafka.common.utils.UtilsTest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidtestAbs()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidTest custom goal list file is parsed correctlyvoidVerify Utils.delete(_, ignoreMissingSubFiles=true) uses FilesWrapper.deleteIfExists().voidVerify Utils.delete(_, ignoreMissingSubFiles=false) uses FilesWrapper.delete().voidtestDiff()voidvoidvoidTest to read content of named pipe as string.voidvoidvoidvoidtestGetHostInvalid(String protocol) voidtestGetHostValid(String protocol) voidvoidvoidvoidvoidvoidvoidvoidtestMax()voidtestMin()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidTests that `readFullyOrFail` behaves correctly if multiple `FileChannel.read` operations are required to fill the destination buffer.voidvoidTests that `readFullyOrFail` behaves correctly if multiple `FileChannel.read` operations are required to fill the destination buffer.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidtoArray()voidvoidvoidvoid
-
Constructor Details
-
UtilsTest
public UtilsTest()
-
-
Method Details
-
testMurmur2
@Test public void testMurmur2() -
testMurmur2Checksum
@Test public void testMurmur2Checksum() -
testGetHostValid
@ParameterizedTest @CsvSource({"PLAINTEXT","SASL_PLAINTEXT","SSL","SASL_SSL"}) public void testGetHostValid(String protocol) -
testGetHostInvalid
@ParameterizedTest @CsvSource({"PLAINTEXT","SASL_PLAINTEXT","SSL","SASL_SSL"}) public void testGetHostInvalid(String protocol) -
testHostPattern
@Test public void testHostPattern() -
testGetPort
@Test public void testGetPort() -
testFormatAddress
@Test public void testFormatAddress() -
testFormatBytes
@Test public void testFormatBytes() -
testMkString
@Test public void testMkString() -
testAbs
@Test public void testAbs() -
writeToBuffer
- Throws:
IOException
-
toArray
@Test public void toArray() -
toArrayDirectByteBuffer
@Test public void toArrayDirectByteBuffer() -
getNullableSizePrefixedArrayExact
@Test public void getNullableSizePrefixedArrayExact() -
getNullableSizePrefixedArrayExactEmpty
@Test public void getNullableSizePrefixedArrayExactEmpty() -
getNullableSizePrefixedArrayRemainder
@Test public void getNullableSizePrefixedArrayRemainder() -
getNullableSizePrefixedArrayNull
@Test public void getNullableSizePrefixedArrayNull() -
getNullableSizePrefixedArrayInvalid
@Test public void getNullableSizePrefixedArrayInvalid() -
getNullableSizePrefixedArrayUnderflow
@Test public void getNullableSizePrefixedArrayUnderflow() -
utf8ByteArraySerde
@Test public void utf8ByteArraySerde() -
utf8ByteBufferSerde
@Test public void utf8ByteBufferSerde() -
testReadBytes
@Test public void testReadBytes() -
testFileAsStringSimpleFile
- Throws:
IOException
-
testFileAsStringNamedPipe
-
testMin
@Test public void testMin() -
testMax
@Test public void testMax() -
mkStringTest
@Test public void mkStringTest() -
parseMapTest
@Test public void parseMapTest() -
ensureCapacityTest
@Test public void ensureCapacityTest() -
testCloseAll
@Test public void testCloseAll() -
testReadFullyOrFailWithRealFile
- Throws:
IOException
-
testReadFullyOrFailWithPartialFileChannelReads
Tests that `readFullyOrFail` behaves correctly if multiple `FileChannel.read` operations are required to fill the destination buffer.- Throws:
IOException
-
testReadFullyWithPartialFileChannelReads
Tests that `readFullyOrFail` behaves correctly if multiple `FileChannel.read` operations are required to fill the destination buffer.- Throws:
IOException
-
testReadFullyIfEofIsReached
- Throws:
IOException
-
testLoadProps
- Throws:
IOException
-
testCreateGoalList
Test custom goal list file is parsed correctly- Throws:
IOException
-
testRecursiveDelete
- Throws:
IOException
-
testRecursiveDeleteWithDeletedFile
- Throws:
IOException
-
testIgnoreMissingSubFiles
- Throws:
IOException
-
testDeleteIgnoringMissingFilesWhenConcurrentDeletion
Verify Utils.delete(_, ignoreMissingSubFiles=true) uses FilesWrapper.deleteIfExists(). Fixes KSTORAGE-2060: concurrent deletion should not throw exception.- Throws:
IOException
-
testDeleteNotIgnoringMissingFilesWhenConcurrentDeletion
Verify Utils.delete(_, ignoreMissingSubFiles=false) uses FilesWrapper.delete(). When file is missing, NoSuchFileException should propagate.- Throws:
IOException
-
testConvertTo32BitField
@Test public void testConvertTo32BitField() -
testUnion
@Test public void testUnion() -
testUnionOfOne
@Test public void testUnionOfOne() -
testUnionOfMany
@Test public void testUnionOfMany() -
testUnionOfNone
@Test public void testUnionOfNone() -
testIntersection
@Test public void testIntersection() -
testIntersectionOfOne
@Test public void testIntersectionOfOne() -
testIntersectionOfMany
@Test public void testIntersectionOfMany() -
testDisjointIntersectionOfMany
@Test public void testDisjointIntersectionOfMany() -
testDiff
@Test public void testDiff() -
testPropsToMap
@Test public void testPropsToMap() -
testPropsToMapNonStringKey
@Test public void testPropsToMapNonStringKey() -
testPropsToMapWithDefaults
@Test public void testPropsToMapWithDefaults() -
testPropsToMapWithDefaultsAndSameKey
@Test public void testPropsToMapWithDefaultsAndSameKey() -
testCastToStringObjectMap
@Test public void testCastToStringObjectMap() -
testCastToStringObjectMapNonStringKey
@Test public void testCastToStringObjectMapNonStringKey() -
testCastToStringObjectMapPropertiesAsInput
@Test public void testCastToStringObjectMapPropertiesAsInput() -
testCastToStringObjectMapPropertiesNonStringKey
@Test public void testCastToStringObjectMapPropertiesNonStringKey() -
testCastToStringObjectMapPropertiesWithDefaults
@Test public void testCastToStringObjectMapPropertiesWithDefaults() -
testCastToStringObjectMapPropertiesWithDefaultsAndSameKey
@Test public void testCastToStringObjectMapPropertiesWithDefaultsAndSameKey() -
testCloseAllQuietly
@Test public void testCloseAllQuietly() -
shouldAcceptValidDateFormats
- Throws:
ParseException
-
shouldThrowOnInvalidDateFormatOrNullTimestamp
@Test public void shouldThrowOnInvalidDateFormatOrNullTimestamp() -
testCharacterArrayEquality
@Test public void testCharacterArrayEquality() -
testToLogDateTimeFormat
@Test public void testToLogDateTimeFormat() -
testReplaceSuffix
@Test public void testReplaceSuffix() -
testEntriesWithPrefix
@Test public void testEntriesWithPrefix() -
testTryAll
-
testMsToNs
@Test public void testMsToNs()
-