Skip to content

Commit

Permalink
OAK-10860: oak-lucene: update gson test dependency and stop using dep…
Browse files Browse the repository at this point in the history
…recated APIs (apache#1509)
  • Loading branch information
reschke authored Jun 5, 2024
1 parent cc8adb4 commit 849307c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion oak-lucene/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
<version>2.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import java.util.concurrent.TimeUnit;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.apache.jackrabbit.oak.InitialContent;
import org.apache.jackrabbit.oak.api.CommitFailedException;
import org.apache.jackrabbit.oak.plugins.index.AsyncIndexInfo;
Expand All @@ -48,10 +46,12 @@
import org.apache.jackrabbit.oak.stats.Clock;
import org.apache.jackrabbit.oak.stats.StatisticsProvider;
import org.jetbrains.annotations.Nullable;
import org.json.simple.parser.ParseException;
import org.junit.Before;
import org.junit.Test;

import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

import static java.util.Arrays.asList;
import static org.apache.jackrabbit.oak.api.CommitFailedException.CONSTRAINT;
import static org.apache.jackrabbit.oak.commons.PathUtils.getName;
Expand Down Expand Up @@ -290,11 +290,11 @@ private void assertCleanUpPerformed(CleanupStats stats, boolean expected) {
assertEquals(expected, stats.cleanupPerformed);
}

private void assertJsonInfo(String indexPath, String expectedJson) throws ParseException {
private void assertJsonInfo(String indexPath, String expectedJson) {
NodeState idx = NodeStateUtils.getNode(nodeStore.getRoot(), indexPath);
String json = new HybridPropertyIndexInfo(idx).getInfoAsJson();
JsonObject j1 = (JsonObject) new JsonParser().parse(json);
JsonObject j2 = (JsonObject) new JsonParser().parse(expectedJson);
JsonObject j1 = (JsonObject) JsonParser.parseString(json);
JsonObject j2 = (JsonObject) JsonParser.parseString(expectedJson);

if (!j1.equals(j2)){
assertEquals(j1, j2);
Expand Down

0 comments on commit 849307c

Please sign in to comment.