Skip to content

Commit

Permalink
Fix failure ITs
Browse files Browse the repository at this point in the history
Signed-off-by: zane-neo <[email protected]>
  • Loading branch information
zane-neo committed Dec 7, 2023
1 parent b60ff2a commit 8afb99c
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
Expand All @@ -34,13 +37,14 @@ public void testFromActionResponseDifferentClassLoader()
InstantiationException,
IllegalAccessException,
NoSuchMethodException,
InvocationTargetException {
InvocationTargetException,
URISyntaxException {
ClassLoader loader = TransportPPLQueryResponseTest.class.getClassLoader();
String classFilePath =
URI resourceURI =
loader
.getResource("org/opensearch/sql/plugin/transport/TransportPPLQueryResponse.class")
.getPath();

.toURI();
Path classFilePath = Paths.get(resourceURI);
CustomClassLoader classLoader1 = new CustomClassLoader(classFilePath);
CustomClassLoader classLoader2 = new CustomClassLoader(classFilePath);

Expand All @@ -62,8 +66,8 @@ class CustomClassLoader extends ClassLoader {

private final Path classFilePath;

public CustomClassLoader(String classFilePath) {
this.classFilePath = Path.of(classFilePath);
public CustomClassLoader(Path classFilePath) {
this.classFilePath = classFilePath;
}

@Override
Expand Down

0 comments on commit 8afb99c

Please sign in to comment.