Skip to content

Commit 88b94c5

Browse files
committed
update to junit 5.14; test refactorings
1 parent 3204811 commit 88b94c5

File tree

28 files changed

+1111
-572
lines changed

28 files changed

+1111
-572
lines changed

build/reports/problems/problems-report.html

Lines changed: 663 additions & 0 deletions
Large diffs are not rendered by default.

fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/Config.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ public int hashCode() {
322322
@Override
323323
@Nonnull
324324
public String toString() {
325-
return "Config[" + ", metric=" + getMetric() + ", numDimensions=" + getNumDimensions() +
325+
return "Config[" + "metric=" + getMetric() + ", numDimensions=" + getNumDimensions() +
326326
", isUseInlining=" + isUseInlining() + ", M=" + getM() + ", MMax=" + getMMax() +
327327
", MMax0=" + getMMax0() + ", efConstruction=" + getEfConstruction() +
328328
", isExtendCandidates=" + isExtendCandidates() +

fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/HNSW.java

Lines changed: 101 additions & 87 deletions
Large diffs are not rendered by default.

fdb-extensions/src/main/java/com/apple/foundationdb/async/hnsw/NodeReferenceAndNode.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import java.util.List;
2727

2828
/**
29-
* A container class that pairs a {@link NodeReferenceWithDistance} with its corresponding {@link AbstractNode} object.
29+
* A container class that pairs a {@link NodeReference} with its corresponding {@link AbstractNode} object.
3030
* <p>
3131
* This is often used during graph traversal or searching, where a reference to a node (along with its distance from a
3232
* query point) is first identified, and then the complete node data is fetched. This class holds these two related
@@ -70,6 +70,11 @@ public AbstractNode<N> getNode() {
7070
return node;
7171
}
7272

73+
@Override
74+
public String toString() {
75+
return "NB[" + nodeReference + "," + node + ']';
76+
}
77+
7378
/**
7479
* Helper to extract the references from a given collection of objects of this container class.
7580
* @param referencesAndNodes an iterable of {@link NodeReferenceAndNode} objects from which to extract the

fdb-extensions/src/test/java/com/apple/foundationdb/async/hnsw/HNSWTest.java

Lines changed: 271 additions & 428 deletions
Large diffs are not rendered by default.

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/VectorIndexScanComparisons.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public class VectorIndexScanComparisons implements IndexScanParameters {
6262
@Nonnull
6363
private final VectorIndexScanOptions vectorIndexScanOptions;
6464

65-
public VectorIndexScanComparisons(@Nonnull final ScanComparisons prefixScanComparisons,
66-
@Nonnull final DistanceRankValueComparison distanceRankValueComparison,
67-
@Nonnull final VectorIndexScanOptions vectorIndexScanOptions) {
65+
private VectorIndexScanComparisons(@Nonnull final ScanComparisons prefixScanComparisons,
66+
@Nonnull final DistanceRankValueComparison distanceRankValueComparison,
67+
@Nonnull final VectorIndexScanOptions vectorIndexScanOptions) {
6868
this.prefixScanComparisons = prefixScanComparisons;
6969
this.distanceRankValueComparison = distanceRankValueComparison;
7070
this.vectorIndexScanOptions = vectorIndexScanOptions;
@@ -311,14 +311,12 @@ public static VectorIndexScanComparisons fromProto(@Nonnull final PlanSerializat
311311
}
312312

313313
@Nonnull
314-
public static VectorIndexScanComparisons byDistance(@Nullable ScanComparisons prefixScanComparisons,
314+
public static VectorIndexScanComparisons byDistance(@Nullable final ScanComparisons prefixScanComparisons,
315315
@Nonnull final DistanceRankValueComparison distanceRankValueComparison,
316-
@Nonnull VectorIndexScanOptions vectorIndexScanOptions) {
317-
if (prefixScanComparisons == null) {
318-
prefixScanComparisons = ScanComparisons.EMPTY;
319-
}
320-
321-
return new VectorIndexScanComparisons(prefixScanComparisons, distanceRankValueComparison,
316+
@Nonnull final VectorIndexScanOptions vectorIndexScanOptions) {
317+
return new VectorIndexScanComparisons(
318+
prefixScanComparisons == null ? ScanComparisons.EMPTY : prefixScanComparisons,
319+
distanceRankValueComparison,
322320
vectorIndexScanOptions);
323321
}
324322

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/indexes/VectorIndexMaintainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ protected <M extends Message> CompletableFuture<Void> updateIndexKeys(@Nonnull f
346346
final HNSW hnsw =
347347
new HNSW(rtSubspace, getExecutor(), getConfig(), new OnWrite(timer), OnReadListener.NOOP);
348348
if (remove) {
349-
throw new UnsupportedOperationException("not implemented");
349+
return hnsw.delete(state.transaction, trimmedPrimaryKey);
350350
} else {
351351
return hnsw.insert(state.transaction, trimmedPrimaryKey,
352352
RealVector.fromBytes(vectorBytes));

fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/metadata/MetaDataProtoTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
import org.junit.jupiter.params.provider.Arguments;
5959
import org.junit.jupiter.params.provider.ArgumentsProvider;
6060
import org.junit.jupiter.params.provider.ArgumentsSource;
61+
import org.junit.jupiter.params.support.ParameterDeclarations;
6162

6263
import javax.annotation.Nonnull;
6364
import java.util.Arrays;
@@ -376,7 +377,8 @@ public void indexGroupingCompatibility() throws Exception {
376377

377378
private static class ArgumentProvider implements ArgumentsProvider {
378379
@Override
379-
public Stream<? extends Arguments> provideArguments(final ExtensionContext context) throws Exception {
380+
public Stream<? extends Arguments> provideArguments(final ParameterDeclarations parameterDeclarations,
381+
final ExtensionContext context) {
380382
return Stream.of(Arguments.of("double parameter", 10.10d, 12, 12d),
381383
Arguments.of("float parameter", 11.11f, 13.13f),
382384
Arguments.of("long parameter", 42L, 44L),

fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/RemoteFetchIndexScanTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
import static org.junit.jupiter.api.Assertions.assertThrows;
6767
import static org.junit.jupiter.api.Assertions.assertTrue;
6868
import static org.junit.jupiter.api.Assumptions.assumeTrue;
69-
import static org.junit.jupiter.params.ParameterizedTest.ARGUMENTS_WITH_NAMES_PLACEHOLDER;
69+
import static org.junit.jupiter.params.ParameterizedInvocationConstants.ARGUMENTS_WITH_NAMES_PLACEHOLDER;
7070

7171
/**
7272
* A test for the remote fetch index scan wrapper.

fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/RemoteFetchMultiColumnKeyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
import static org.hamcrest.MatcherAssert.assertThat;
4646
import static org.hamcrest.Matchers.equalTo;
4747
import static org.junit.jupiter.api.Assertions.assertEquals;
48-
import static org.junit.jupiter.params.ParameterizedTest.ARGUMENTS_WITH_NAMES_PLACEHOLDER;
48+
import static org.junit.jupiter.params.ParameterizedInvocationConstants.ARGUMENTS_WITH_NAMES_PLACEHOLDER;
4949

5050
/**
5151
* Remote fetch test with a compound primary key.

0 commit comments

Comments
 (0)