55
66import static org .assertj .core .api .Assertions .assertThat ;
77
8- import java .io .IOException ;
8+ import java .io .File ;
99import java .io .InputStream ;
10+ import java .net .URISyntaxException ;
1011import java .net .URL ;
1112import java .nio .charset .StandardCharsets ;
1213import java .nio .file .Files ;
@@ -24,7 +25,7 @@ final class JarTest {
2425 @ TempDir public Path outPath ;
2526
2627 @ Test
27- void testSampleJar () throws IOException , InterruptedException {
28+ void testSampleJar () throws Exception {
2829 Path agentPath = Path .of (System .getProperty ("agent" ));
2930 Path noInstAgentPath = Path .of (System .getProperty ("no.inst.agent" ));
3031 // jar created in test-app module
@@ -57,7 +58,7 @@ void testSampleJar() throws IOException, InterruptedException {
5758 "-Dotel.traces.exporter=logging" ,
5859 "-Dio.opentelemetry.javaagent.shaded.io.opentelemetry.context.contextStorageProvider=default" ,
5960 "-cp" ,
60- String . format ( "%s:%s" , resultAppPath , noInstAgentPath ) ,
61+ resultAppPath + File . pathSeparator + noInstAgentPath ,
6162 APP_MAIN );
6263
6364 Process runtimeProcess = runtimeProcessBuilder .start ();
@@ -70,9 +71,9 @@ void testSampleJar() throws IOException, InterruptedException {
7071 "[main] INFO io.opentelemetry.exporter.logging.LoggingSpanExporter - 'HTTP GET'" );
7172 }
7273
73- private static Path getPath (String resourceName ) {
74+ private static Path getPath (String resourceName ) throws URISyntaxException {
7475 URL resourceURL = JarTest .class .getResource (resourceName );
7576 assertThat (resourceURL ).isNotNull ();
76- return Path .of (resourceURL .getPath ());
77+ return Path .of (resourceURL .toURI ());
7778 }
7879}
0 commit comments