Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions core/src/test/java/org/apache/iceberg/util/TestArrayUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

import org.junit.jupiter.api.Test;

public class TestArrayUtil {
class TestArrayUtil {

@Test
public void testStrictlyAscendingLongArrays() {
void testStrictlyAscendingLongArrays() {
long[] emptyArray = new long[0];
assertThat(ArrayUtil.isStrictlyAscending(emptyArray)).isTrue();

Expand All @@ -43,7 +43,7 @@ public void testStrictlyAscendingLongArrays() {
}

@Test
public void testConcatWithDifferentLengthArrays() {
void testConcatWithDifferentLengthArrays() {
Integer[] array1 = {1, 2, 3};
Integer[] array2 = {4, 5};
Integer[] array3 = {6, 7, 8, 9};
Expand All @@ -53,7 +53,7 @@ public void testConcatWithDifferentLengthArrays() {
}

@Test
public void testConcatWithEmptyArrays() {
void testConcatWithEmptyArrays() {
String[] array1 = {};
String[] array2 = {"a", "b"};

Expand All @@ -62,14 +62,14 @@ public void testConcatWithEmptyArrays() {
}

@Test
public void testConcatWithSingleArray() {
void testConcatWithSingleArray() {
Boolean[] array = {true, false};
Boolean[] result = ArrayUtil.concat(Boolean.class, array);
assertThat(result).isEqualTo(new Boolean[] {true, false});
}

@Test
public void testConcatWithNoArray() {
void testConcatWithNoArray() {
Character[] result = ArrayUtil.concat(Character.class);
assertThat(result).isEqualTo(new Character[] {});
}
Expand Down
12 changes: 6 additions & 6 deletions core/src/test/java/org/apache/iceberg/util/TestBinPacking.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import org.apache.iceberg.util.BinPacking.ListPacker;
import org.junit.jupiter.api.Test;

public class TestBinPacking {
class TestBinPacking {
@Test
public void testBasicBinPacking() {
void testBasicBinPacking() {
assertThat(pack(list(1, 2, 3, 4, 5), 3))
.as("Should pack the first 2 values")
.isEqualTo(list(list(1, 2), list(3), list(4), list(5)));
Expand Down Expand Up @@ -62,7 +62,7 @@ public void testBasicBinPacking() {
}

@Test
public void testBasicBinPackingTargetSize() {
void testBasicBinPackingTargetSize() {
assertThat(pack(list(1, 2, 3, 4, 5), 3, Integer.MAX_VALUE, 2))
.as("Should pack the first 2 values")
.isEqualTo(list(list(1, 2), list(3), list(4), list(5)));
Expand Down Expand Up @@ -93,7 +93,7 @@ public void testBasicBinPackingTargetSize() {
}

@Test
public void testReverseBinPackingSingleLookback() {
void testReverseBinPackingSingleLookback() {
assertThat(packEnd(list(1, 2, 3, 4, 5), 3, 1))
.as("Should pack the first 2 values")
.isEqualTo(list(list(1, 2), list(3), list(4), list(5)));
Expand Down Expand Up @@ -140,7 +140,7 @@ public void testReverseBinPackingSingleLookback() {
}

@Test
public void testReverseBinPackingUnlimitedLookback() {
void testReverseBinPackingUnlimitedLookback() {
assertThat(packEnd(list(1, 2, 3, 4, 5), 3))
.as("Should pack the first 2 values")
.isEqualTo(list(list(1, 2), list(3), list(4), list(5)));
Expand Down Expand Up @@ -195,7 +195,7 @@ public void testReverseBinPackingUnlimitedLookback() {
}

@Test
public void testBinPackingLookBack() {
void testBinPackingLookBack() {
// lookback state:
// 1. [5]
// 2. [5, 1]
Expand Down
26 changes: 13 additions & 13 deletions core/src/test/java/org/apache/iceberg/util/TestDataFileSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* Testing {@link DataFileSet} is easier in iceberg-core since the data file builders are located
* here
*/
public class TestDataFileSet {
class TestDataFileSet {

private static final DataFile FILE_A =
DataFiles.builder(PartitionSpec.unpartitioned())
Expand Down Expand Up @@ -66,13 +66,13 @@ public class TestDataFileSet {
.build();

@Test
public void emptySet() {
void emptySet() {
assertThat(DataFileSet.create()).isEmpty();
assertThat(DataFileSet.create()).doesNotContain(FILE_A, FILE_B, FILE_C);
}

@Test
public void insertionOrderIsMaintained() {
void insertionOrderIsMaintained() {
DataFileSet set = DataFileSet.create();
set.addAll(ImmutableList.of(FILE_D, FILE_A, FILE_C));
set.add(FILE_B);
Expand All @@ -82,14 +82,14 @@ public void insertionOrderIsMaintained() {
}

@Test
public void clear() {
void clear() {
DataFileSet set = DataFileSet.of(ImmutableList.of(FILE_A, FILE_B));
set.clear();
assertThat(set).isEmpty();
}

@Test
public void addAll() {
void addAll() {
DataFileSet empty = DataFileSet.create();
assertThatThrownBy(() -> empty.add(null))
.isInstanceOf(NullPointerException.class)
Expand All @@ -113,7 +113,7 @@ public void addAll() {
}

@Test
public void contains() {
void contains() {
DataFileSet set = DataFileSet.of(ImmutableList.of(FILE_A, FILE_B));
assertThatThrownBy(() -> set.contains(null))
.isInstanceOf(NullPointerException.class)
Expand All @@ -131,7 +131,7 @@ public void contains() {
}

@Test
public void containsAll() {
void containsAll() {
DataFileSet set = DataFileSet.of(ImmutableList.of(FILE_A, FILE_B));
assertThatThrownBy(() -> set.containsAll(null))
.isInstanceOf(NullPointerException.class)
Expand All @@ -151,7 +151,7 @@ public void containsAll() {
}

@Test
public void toArray() {
void toArray() {
DataFileSet set = DataFileSet.of(ImmutableList.of(FILE_B, FILE_A));
assertThat(set.toArray()).hasSize(2).containsExactly(FILE_B, FILE_A);

Expand All @@ -169,7 +169,7 @@ public void toArray() {
}

@Test
public void retainAll() {
void retainAll() {
DataFileSet empty = DataFileSet.create();
assertThatThrownBy(() -> empty.retainAll(null))
.isInstanceOf(NullPointerException.class)
Expand Down Expand Up @@ -204,7 +204,7 @@ public void retainAll() {
}

@Test
public void remove() {
void remove() {
DataFileSet set = DataFileSet.of(ImmutableList.of(FILE_A, FILE_B));
assertThatThrownBy(() -> set.remove(null))
.isInstanceOf(NullPointerException.class)
Expand All @@ -219,7 +219,7 @@ public void remove() {
}

@Test
public void removeAll() {
void removeAll() {
DataFileSet empty = DataFileSet.create();
assertThatThrownBy(() -> empty.removeAll(null))
.isInstanceOf(NullPointerException.class)
Expand Down Expand Up @@ -254,7 +254,7 @@ public void removeAll() {
}

@Test
public void equalsAndHashCode() {
void equalsAndHashCode() {
DataFileSet set1 = DataFileSet.create();
DataFileSet set2 = DataFileSet.create();

Expand Down Expand Up @@ -293,7 +293,7 @@ public void equalsAndHashCode() {

@ParameterizedTest
@MethodSource("org.apache.iceberg.TestHelpers#serializers")
public void serialization(TestHelpers.RoundTripSerializer<DataFileSet> roundTripSerializer)
void serialization(TestHelpers.RoundTripSerializer<DataFileSet> roundTripSerializer)
throws IOException, ClassNotFoundException {
DataFileSet dataFiles = DataFileSet.of(ImmutableList.of(FILE_C, FILE_B, FILE_A));
assertThat(roundTripSerializer.apply(dataFiles)).isEqualTo(dataFiles);
Expand Down
26 changes: 13 additions & 13 deletions core/src/test/java/org/apache/iceberg/util/TestDeleteFileSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* Testing {@link DeleteFileSet} is easier in iceberg-core since the delete file builders are
* located here
*/
public class TestDeleteFileSet {
class TestDeleteFileSet {

private static final DeleteFile FILE_A_DELETES =
FileMetadata.deleteFileBuilder(PartitionSpec.unpartitioned())
Expand Down Expand Up @@ -70,14 +70,14 @@ public class TestDeleteFileSet {
.build();

@Test
public void emptySet() {
void emptySet() {
assertThat(DeleteFileSet.create()).isEmpty();
assertThat(DeleteFileSet.create())
.doesNotContain(FILE_A_DELETES, FILE_B_DELETES, FILE_C_DELETES);
}

@Test
public void insertionOrderIsMaintained() {
void insertionOrderIsMaintained() {
DeleteFileSet set = DeleteFileSet.create();
set.addAll(ImmutableList.of(FILE_D_DELETES, FILE_A_DELETES, FILE_C_DELETES));
set.add(FILE_B_DELETES);
Expand All @@ -89,14 +89,14 @@ public void insertionOrderIsMaintained() {
}

@Test
public void clear() {
void clear() {
DeleteFileSet set = DeleteFileSet.of(ImmutableList.of(FILE_A_DELETES, FILE_B_DELETES));
set.clear();
assertThat(set).isEmpty();
}

@Test
public void addAll() {
void addAll() {
DeleteFileSet empty = DeleteFileSet.create();
assertThatThrownBy(() -> empty.add(null))
.isInstanceOf(NullPointerException.class)
Expand All @@ -120,7 +120,7 @@ public void addAll() {
}

@Test
public void contains() {
void contains() {
DeleteFileSet set = DeleteFileSet.of(ImmutableList.of(FILE_A_DELETES, FILE_B_DELETES));
assertThatThrownBy(() -> set.contains(null))
.isInstanceOf(NullPointerException.class)
Expand All @@ -141,7 +141,7 @@ public void contains() {
}

@Test
public void containsAll() {
void containsAll() {
DeleteFileSet set = DeleteFileSet.of(ImmutableList.of(FILE_A_DELETES, FILE_B_DELETES));
assertThatThrownBy(() -> set.containsAll(null))
.isInstanceOf(NullPointerException.class)
Expand All @@ -162,7 +162,7 @@ public void containsAll() {
}

@Test
public void toArray() {
void toArray() {
DeleteFileSet set = DeleteFileSet.of(ImmutableList.of(FILE_B_DELETES, FILE_A_DELETES));
assertThat(set.toArray()).hasSize(2).containsExactly(FILE_B_DELETES, FILE_A_DELETES);

Expand All @@ -182,7 +182,7 @@ public void toArray() {
}

@Test
public void retainAll() {
void retainAll() {
DeleteFileSet empty = DeleteFileSet.create();
assertThatThrownBy(() -> empty.retainAll(null))
.isInstanceOf(NullPointerException.class)
Expand Down Expand Up @@ -217,7 +217,7 @@ public void retainAll() {
}

@Test
public void remove() {
void remove() {
DeleteFileSet set = DeleteFileSet.of(ImmutableList.of(FILE_A_DELETES, FILE_B_DELETES));
assertThatThrownBy(() -> set.remove(null))
.isInstanceOf(NullPointerException.class)
Expand All @@ -233,7 +233,7 @@ public void remove() {
}

@Test
public void removeAll() {
void removeAll() {
DeleteFileSet empty = DeleteFileSet.create();
assertThatThrownBy(() -> empty.removeAll(null))
.isInstanceOf(NullPointerException.class)
Expand Down Expand Up @@ -267,7 +267,7 @@ public void removeAll() {
}

@Test
public void equalsAndHashCode() {
void equalsAndHashCode() {
DeleteFileSet set1 = DeleteFileSet.create();
DeleteFileSet set2 = DeleteFileSet.create();

Expand Down Expand Up @@ -309,7 +309,7 @@ public void equalsAndHashCode() {

@ParameterizedTest
@MethodSource("org.apache.iceberg.TestHelpers#serializers")
public void serialization(TestHelpers.RoundTripSerializer<DeleteFileSet> roundTripSerializer)
void serialization(TestHelpers.RoundTripSerializer<DeleteFileSet> roundTripSerializer)
throws IOException, ClassNotFoundException {
DeleteFileSet deleteFiles =
DeleteFileSet.of(ImmutableList.of(FILE_C_DELETES, FILE_B_DELETES, FILE_A_DELETES));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

class TestEnvironmentUtil {
@Test
public void testEnvironmentSubstitution() {
void testEnvironmentSubstitution() {
Optional<Map.Entry<String, String>> envEntry = System.getenv().entrySet().stream().findFirst();
assumeThat(envEntry).as("Expecting at least one env. variable to be present").isPresent();
Map<String, String> resolvedProps =
Expand All @@ -39,7 +39,7 @@ public void testEnvironmentSubstitution() {
}

@Test
public void testMultipleEnvironmentSubstitutions() {
void testMultipleEnvironmentSubstitutions() {
Map<String, String> result =
EnvironmentUtil.resolveAll(
ImmutableMap.of("USER", "u", "VAR", "value"),
Expand All @@ -51,7 +51,7 @@ public void testMultipleEnvironmentSubstitutions() {
}

@Test
public void testEnvironmentSubstitutionWithMissingVar() {
void testEnvironmentSubstitutionWithMissingVar() {
Map<String, String> result =
EnvironmentUtil.resolveAll(ImmutableMap.of(), ImmutableMap.of("user-test", "env:USER"));

Expand Down
Loading
Loading