From 15ea4c5bb4dd8527b15570e83f640ee34a499171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Tue, 19 Nov 2024 18:58:33 +0100 Subject: [PATCH] deps: remove duplicate dependencies --- pom.xml | 15 ------------- .../spanner/jdbc/it/ITSingleJarTest.java | 22 ++++++++++++++++++- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index 4e42ecfd1..834ec766f 100644 --- a/pom.xml +++ b/pom.xml @@ -201,21 +201,6 @@ - - io.opentelemetry - opentelemetry-sdk-common - test - - - io.opentelemetry - opentelemetry-sdk - test - - - io.opentelemetry - opentelemetry-sdk-trace - test - com.google.cloud.opentelemetry exporter-trace diff --git a/src/test/java/com/google/cloud/spanner/jdbc/it/ITSingleJarTest.java b/src/test/java/com/google/cloud/spanner/jdbc/it/ITSingleJarTest.java index 9ae8f6003..23d7f75e9 100644 --- a/src/test/java/com/google/cloud/spanner/jdbc/it/ITSingleJarTest.java +++ b/src/test/java/com/google/cloud/spanner/jdbc/it/ITSingleJarTest.java @@ -61,6 +61,7 @@ public void setup() { @Test public void testUseSingleJar() throws Exception { + printDeps(); buildSingleJar(); buildMainClass(); runTestApplication(); @@ -68,6 +69,7 @@ public void testUseSingleJar() throws Exception { @Test public void testUseShadedJar() throws Exception { + printDeps(); buildShadedJar(); buildMainClass(); runTestApplication(); @@ -91,6 +93,12 @@ private void runTestApplication() throws Exception { execute(builder); } + private void printDeps() throws Exception { + ProcessBuilder builder = new ProcessBuilder(); + builder.command("mvn", "dependency:tree"); + execute(builder, true); + } + private void buildSingleJar() throws Exception { ProcessBuilder builder = new ProcessBuilder(); builder.command("mvn", "clean", "package", "-DskipTests", "-Dalt.build.dir=./target/single"); @@ -116,11 +124,23 @@ private void buildMainClass() throws Exception { } private void execute(ProcessBuilder builder) throws Exception { + execute(builder, false); + } + + private void execute(ProcessBuilder builder, boolean showOutput) throws Exception { Process process = builder.start(); - String errors; + String errors, output = ""; try (InputStreamReader reader = new InputStreamReader(process.getErrorStream())) { errors = CharStreams.toString(reader); } + if (showOutput) { + try (InputStreamReader reader = new InputStreamReader(process.getInputStream())) { + output = CharStreams.toString(reader); + } + } assertEquals(errors, 0, process.waitFor()); + if (showOutput) { + System.out.print(output); + } } }