You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by jg...@apache.org on 2023/04/26 22:52:56 UTC
[age] branch master updated: Update jdbc driver and workflows (#861)
This is an automated email from the ASF dual-hosted git repository.
jgemignani pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/age.git
The following commit(s) were added to refs/heads/master by this push:
new 19c05ae5 Update jdbc driver and workflows (#861)
19c05ae5 is described below
commit 19c05ae570ea43026a77ab3b5253d5efff8214d7
Author: Muhammad Taha Naveed <m....@gmail.com>
AuthorDate: Thu Apr 27 03:52:49 2023 +0500
Update jdbc driver and workflows (#861)
* Update jdbc and go driver workflows
- Removed reduntant setup for java environment in go driver workflow.
- Removed builds for microsoft and tumerin distros from jdbc driver
workflow.
* Update jdbc driver dependencies and tests
- Updated jdbc dependencies to latest.
- Changed AgtypeStatementTest to create connection one time for all
tests in this class instead of making and breaking connection for
each test. 'beforeEach' and 'afterEach' was resulting in connection
failure occasionaly.
---
.github/workflows/go-driver.yml | 10 ++--------
.github/workflows/jdbc-driver.yaml | 10 +++-------
drivers/jdbc/lib/build.gradle.kts | 18 +++++++++---------
.../java/org/apache/age/jdbc/AgtypeStatementTest.java | 13 ++++++++-----
.../java/org/apache/age/jdbc/BaseDockerizedTest.java | 10 +++++++---
5 files changed, 29 insertions(+), 32 deletions(-)
diff --git a/.github/workflows/go-driver.yml b/.github/workflows/go-driver.yml
index 581b479a..f60ae802 100644
--- a/.github/workflows/go-driver.yml
+++ b/.github/workflows/go-driver.yml
@@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
go-version: [ '1.18', '1.19' ]
- distributions: ['zulu', 'temurin', 'microsoft']
+
defaults:
run:
working-directory: drivers/golang/age/
@@ -47,12 +47,6 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- - name: Set up Java
- uses: actions/setup-java@v3
- with:
- distribution: ${{ matrix.distributions }}
- java-version: '17'
-
- name: Generate
run: go generate ./../...
@@ -60,4 +54,4 @@ jobs:
run: go build -v ./...
- name: Test
- run: go test . -v
+ run: go test . -v
\ No newline at end of file
diff --git a/.github/workflows/jdbc-driver.yaml b/.github/workflows/jdbc-driver.yaml
index c8035b23..c4037382 100644
--- a/.github/workflows/jdbc-driver.yaml
+++ b/.github/workflows/jdbc-driver.yaml
@@ -10,22 +10,18 @@ on:
jobs:
build:
runs-on: ubuntu-latest
-
- strategy:
- matrix:
- distributions: ['zulu', 'temurin', 'microsoft']
-
+
defaults:
run:
working-directory: drivers/jdbc
steps:
- uses: actions/checkout@v3
-
+
- name: Set up Java
uses: actions/setup-java@v3
with:
- distribution: ${{ matrix.distributions }}
+ distribution: 'zulu'
java-version: '17'
- name: Set tag based on branch
diff --git a/drivers/jdbc/lib/build.gradle.kts b/drivers/jdbc/lib/build.gradle.kts
index 5e2d0f27..15662e7c 100644
--- a/drivers/jdbc/lib/build.gradle.kts
+++ b/drivers/jdbc/lib/build.gradle.kts
@@ -30,18 +30,18 @@ repositories {
}
dependencies {
- implementation("org.postgresql:postgresql:42.2.20")
- api("org.apache.commons:commons-text:1.9")
- antlr("org.antlr:antlr4:4.9.2")
+ implementation("org.postgresql:postgresql:42.6.0")
+ api("org.apache.commons:commons-text:1.10.0")
+ antlr("org.antlr:antlr4:4.12.0")
- testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.1")
+ testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
- testImplementation("org.testcontainers:testcontainers:1.15.3")
- testImplementation("org.postgresql:postgresql:42.2.20")
+ testImplementation("org.testcontainers:testcontainers:1.18.0")
+ testImplementation("org.postgresql:postgresql:42.6.0")
- testImplementation("org.slf4j:slf4j-api:1.7.5")
- testImplementation("org.slf4j:slf4j-simple:1.7.5")
+ testImplementation("org.slf4j:slf4j-api:2.0.7")
+ testImplementation("org.slf4j:slf4j-simple:2.0.7")
}
tasks.generateGrammarSource {
@@ -68,4 +68,4 @@ tasks.test {
showCauses = true
showStackTraces = true
}
-}
+}
\ No newline at end of file
diff --git a/drivers/jdbc/lib/src/test/java/org/apache/age/jdbc/AgtypeStatementTest.java b/drivers/jdbc/lib/src/test/java/org/apache/age/jdbc/AgtypeStatementTest.java
index e160ef39..74be2460 100644
--- a/drivers/jdbc/lib/src/test/java/org/apache/age/jdbc/AgtypeStatementTest.java
+++ b/drivers/jdbc/lib/src/test/java/org/apache/age/jdbc/AgtypeStatementTest.java
@@ -29,11 +29,14 @@ import java.sql.Statement;
import org.apache.age.jdbc.base.Agtype;
import org.apache.age.jdbc.base.AgtypeFactory;
import org.apache.age.jdbc.base.InvalidAgtypeException;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.postgresql.jdbc.PgConnection;
+import org.junit.jupiter.api.TestInstance;
+import org.junit.jupiter.api.TestInstance.Lifecycle;
+@TestInstance(Lifecycle.PER_CLASS)
/**
* Tests the different combinations that are possible when running Statements and Prepared
* Statements with the AgType and shows how the JDBC needs to be setup to convert values to the
@@ -43,12 +46,12 @@ class AgtypeStatementTest {
BaseDockerizedTest baseDockerizedTest = new BaseDockerizedTest();
- @BeforeEach
+ @BeforeAll
public void setup() throws Exception {
baseDockerizedTest.beforeAll();
}
- @AfterEach
+ @AfterAll
void tearDown() throws Exception {
baseDockerizedTest.afterAll();
}
@@ -199,4 +202,4 @@ class AgtypeStatementTest {
assertEquals(1, returnedAgtype.getInt());
}
-}
+}
\ No newline at end of file
diff --git a/drivers/jdbc/lib/src/test/java/org/apache/age/jdbc/BaseDockerizedTest.java b/drivers/jdbc/lib/src/test/java/org/apache/age/jdbc/BaseDockerizedTest.java
index 2a71a462..2ed48a73 100644
--- a/drivers/jdbc/lib/src/test/java/org/apache/age/jdbc/BaseDockerizedTest.java
+++ b/drivers/jdbc/lib/src/test/java/org/apache/age/jdbc/BaseDockerizedTest.java
@@ -65,9 +65,13 @@ public class BaseDockerizedTest {
String jdbcUrl = String
.format("jdbc:postgresql://%s:%d/%s", "localhost", mappedPort, "postgres");
- connection = DriverManager.getConnection(jdbcUrl, "postgres", CORRECT_DB_PASSWORDS)
- .unwrap(PgConnection.class);
- connection.addDataType("agtype", Agtype.class);
+ try {
+ this.connection = DriverManager.getConnection(jdbcUrl, "postgres", CORRECT_DB_PASSWORDS)
+ .unwrap(PgConnection.class);
+ this.connection.addDataType("agtype", Agtype.class);
+ } catch (Exception e) {
+ System.out.println(e);
+ }
try (Statement statement = connection.createStatement()) {
statement.execute("CREATE EXTENSION IF NOT EXISTS age;");
statement.execute("LOAD 'age'");