From da7da7f9d61012e2773b9c3518ca9eb63f5e1627 Mon Sep 17 00:00:00 2001 From: Karen Chen Date: Thu, 30 Mar 2023 16:27:51 -0700 Subject: [PATCH 1/3] chore: update version for hibernate tests --- wrapper/src/test/resources/hibernate_files/java-module.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrapper/src/test/resources/hibernate_files/java-module.gradle b/wrapper/src/test/resources/hibernate_files/java-module.gradle index c1de5759e..5c56f57eb 100644 --- a/wrapper/src/test/resources/hibernate_files/java-module.gradle +++ b/wrapper/src/test/resources/hibernate_files/java-module.gradle @@ -97,7 +97,7 @@ dependencies { // Since both the DB2 driver and HANA have a package "net.jpountz" we have to add dependencies conditionally // This is due to the "no split-packages" requirement of Java 9+ - testRuntimeOnly files('/app/libs/aws-advanced-jdbc-wrapper-1.0.1.jar') + testRuntimeOnly files('/app/libs/aws-advanced-jdbc-wrapper-1.0.2.jar') testRuntimeOnly dbLibs.mysql if ( db.startsWith( 'db2' ) ) { From d485557c6328957ca08103ee4163a0aeb575c08d Mon Sep 17 00:00:00 2001 From: Karen Chen Date: Thu, 30 Mar 2023 16:43:28 -0700 Subject: [PATCH 2/3] chore: update version for hibernate tests --- benchmarks/README.md | 2 +- .../src/test/resources/hibernate_files/hibernate-core.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/README.md b/benchmarks/README.md index 16aa251ca..1d4a9d75c 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -7,5 +7,5 @@ The benchmarks do not measure the performance of target JDBC drivers nor the per ## Usage 1. Build the benchmarks with the following command `../gradlew jmhJar`. 1. the JAR file will be outputted to `build/libs` -2. Run the benchmarks with the following command `java -jar build/libs/benchmarks-1.0.1-jmh.jar`. +2. Run the benchmarks with the following command `java -jar build/libs/benchmarks-1.0.2-jmh.jar`. 1. you may have to update the command based on the exact version of the produced JAR file diff --git a/wrapper/src/test/resources/hibernate_files/hibernate-core.gradle b/wrapper/src/test/resources/hibernate_files/hibernate-core.gradle index 1534e3bd2..54925fa51 100644 --- a/wrapper/src/test/resources/hibernate_files/hibernate-core.gradle +++ b/wrapper/src/test/resources/hibernate_files/hibernate-core.gradle @@ -61,7 +61,7 @@ dependencies { transitive = true } testImplementation "joda-time:joda-time:2.3" - testImplementation files('/app/libs/aws-advanced-jdbc-wrapper-1.0.1.jar') + testImplementation files('/app/libs/aws-advanced-jdbc-wrapper-1.0.2.jar') testImplementation dbLibs.postgresql testImplementation dbLibs.mysql testImplementation dbLibs.h2 From 62cfca060d3585346d0900ba5a6e8b713c665d60 Mon Sep 17 00:00:00 2001 From: Karen Chen Date: Thu, 30 Mar 2023 17:30:05 -0700 Subject: [PATCH 3/3] fix: failing tests due to incorrect string splitting --- .../java/software/amazon/jdbc/util/ConnectionUrlParser.java | 2 +- .../integration/refactored/container/tests/HikariTests.java | 3 ++- .../software/amazon/jdbc/util/ConnectionUrlParserTest.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wrapper/src/main/java/software/amazon/jdbc/util/ConnectionUrlParser.java b/wrapper/src/main/java/software/amazon/jdbc/util/ConnectionUrlParser.java index 99a4bd41a..cfddbef90 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/util/ConnectionUrlParser.java +++ b/wrapper/src/main/java/software/amazon/jdbc/util/ConnectionUrlParser.java @@ -142,7 +142,7 @@ public static String parsePasswordFromUrl(String url) { // Get the properties from a given url of the generic format: // "protocol//[hosts][/database][?properties]" public static void parsePropertiesFromUrl(String url, Properties props) { - String[] urlParameters = url.split("\\?", 1); + String[] urlParameters = url.split("\\?", 2); if (urlParameters.length == 1) { return; } diff --git a/wrapper/src/test/java/integration/refactored/container/tests/HikariTests.java b/wrapper/src/test/java/integration/refactored/container/tests/HikariTests.java index 89000a5a4..505615916 100644 --- a/wrapper/src/test/java/integration/refactored/container/tests/HikariTests.java +++ b/wrapper/src/test/java/integration/refactored/container/tests/HikariTests.java @@ -75,7 +75,8 @@ public class HikariTests { @TestTemplate public void testOpenConnectionWithUrl() throws SQLException { final HikariDataSource dataSource = new HikariDataSource(); - dataSource.setJdbcUrl(ConnectionStringHelper.getWrapperUrl() + "?wrapperPlugins=\"\""); + final String url = ConnectionStringHelper.getWrapperUrl(); + dataSource.setJdbcUrl(url + (url.contains("?") ? "&" : "?") + "wrapperPlugins=\"\""); dataSource.setUsername(TestEnvironment.getCurrent().getInfo().getDatabaseInfo().getUsername()); dataSource.setPassword(TestEnvironment.getCurrent().getInfo().getDatabaseInfo().getPassword()); dataSource.addDataSourceProperty(PropertyDefinition.PLUGINS.name, ""); diff --git a/wrapper/src/test/java/software/amazon/jdbc/util/ConnectionUrlParserTest.java b/wrapper/src/test/java/software/amazon/jdbc/util/ConnectionUrlParserTest.java index 1b1b814d3..8ea49b707 100644 --- a/wrapper/src/test/java/software/amazon/jdbc/util/ConnectionUrlParserTest.java +++ b/wrapper/src/test/java/software/amazon/jdbc/util/ConnectionUrlParserTest.java @@ -86,7 +86,7 @@ void testEncodedParams(final String url, final String expected) { void testParsingUrlsWithQuestionMarks(final String url, final String expected) { Properties props = new Properties(); ConnectionUrlParser.parsePropertiesFromUrl(url, props); - assertEquals(props.getProperty("param"), expected); + assertEquals(expected, props.getProperty("param")); } private static Stream testGetHostsFromConnectionUrlArguments() {