Skip to content

Commit

Permalink
Updated agent tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kornilova203 committed Feb 8, 2018
1 parent 40c5f3a commit 4bb42b6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ static void addProxy() {
try {
Method method = urlClass.getDeclaredMethod("addURL", URL.class);
method.setAccessible(true);
method.invoke(urlClassLoader, Paths.get(pathToAgentDir.toString(), "proxy.jar").toUri().toURL());
method.invoke(urlClassLoader,
new URL(Paths.get(pathToAgentDir.toString(), "proxy.jar").toUri().toString().replaceAll("%20", " ")));
} catch (NoSuchMethodException | IllegalAccessException | MalformedURLException | InvocationTargetException e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ public class ReturnsValue implements TestModule {
@Override
public int run(long l, String s, double d) {
System.out.println(l + s + d);
try {
Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
return 42;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ public class ThrowsException implements TestModule {
@Override
public int run(long l, String s, double d) {
System.out.println(l + s + d);
try {
Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
throw new RuntimeException("I am an exception");
}
}

0 comments on commit 4bb42b6

Please sign in to comment.