[Git][debian-gis-team/postgis-java][upstream] New upstream version 2024.1.0
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Sat Aug 3 07:16:12 BST 2024
Bas Couwenberg pushed to branch upstream at Debian GIS Project / postgis-java
Commits:
7a0f04b1 by Bas Couwenberg at 2024-08-03T07:57:31+02:00
New upstream version 2024.1.0
- - - - -
30 changed files:
- − .github/install-maven.sh
- + .github/install-sdkman.sh
- − .github/install-zulu11.sh
- − .github/install-zulu8.sh
- .github/workflows/main.yml
- maven-version-rules.xml
- pmd.xml
- pom.xml
- postgis-jdbc-geometry/pom.xml
- postgis-jdbc-geometry/src/test/resources/logback-test.xml
- postgis-jdbc-java2d/pom.xml
- postgis-jdbc-java2d/src/main/java/net/postgis/jdbc/java2d/Java2DWrapper.java
- postgis-jdbc-java2d/src/test/resources/logback-test.xml
- postgis-jdbc-jts/pom.xml
- postgis-jdbc-jts/src/main/java/net/postgis/jdbc/jts/JtsBinaryParser.java
- postgis-jdbc-jts/src/main/java/net/postgis/jdbc/jts/JtsGisWrapper.java
- postgis-jdbc-jts/src/main/java/net/postgis/jdbc/jts/JtsWrapper.java
- + postgis-jdbc-jts/src/test/java/net/postgis/jdbc/jts/EmptyGeometriesTest.java
- postgis-jdbc-jts/src/test/resources-filtered/testng-it.xml
- postgis-jdbc-jts/src/test/resources/logback-test.xml
- postgis-jdbc/pom.xml
- postgis-jdbc/src/main/java/net/postgis/jdbc/DriverWrapper.java
- + postgis-jdbc/src/test/java/net/postgis/jdbc/DriverConnectBehaviorTest.java
- postgis-jdbc/src/test/resources/logback-test.xml
- tools/pom.xml
- tools/smoketest/pom.xml
- tools/smoketest/src/test/resources/logback-test.xml
- tools/test-utils/pom.xml
- tools/test-utils/src/main/java/net/postgis/tools/testutils/TestContainerController.java
- tools/test-utils/src/test/resources/logback-test.xml
Changes:
=====================================
.github/install-maven.sh deleted
=====================================
@@ -1,20 +0,0 @@
-#!/usr/bin/env bash
-
-set -euf
-
-MAVEN_BASE_URL=https://archive.apache.org/dist/maven/maven-3/
-MAVEN_VERSION=3.8.1
-MAVEN_SHA=b98a1905eb554d07427b2e5509ff09bd53e2f1dd7a0afa38384968b113abef02
-
-sudo apt-get update
-sudo apt-get install -y curl
-sudo mkdir -p /usr/share/maven /usr/share/maven/ref
-sudo curl -fsSL -o /tmp/apache-maven.tar.gz ${MAVEN_BASE_URL}/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz
-echo "${MAVEN_SHA} /tmp/apache-maven.tar.gz" | sha256sum -c -
-sudo tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1
-sudo rm -f /tmp/apache-maven.tar.gz
-sudo ln -fs /usr/share/maven/bin/mvn /usr/bin/mvn
-mvn -version
-
-set +euf
-
=====================================
.github/install-sdkman.sh
=====================================
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+set -euf -o pipefail
+
+JAVA_VERSION=$1
+MAVEN_VERSION=$2
+
+printf "Installing, configuring, and initializing SDKMAN\n"
+curl -s "https://get.sdkman.io" | bash
+sed -i -e "s/sdkman_auto_answer=false/sdkman_auto_answer=true/" "${HOME}/.sdkman/etc/config"
+set +uf
+source "${HOME}/.sdkman/bin/sdkman-init.sh"
+
+printf "Installing Azul Zulu JDKs via SDKMAN\n"
+sdk i java ${JAVA_VERSION}
+
+printf "Installing Apache Maven via SDKMAN\n"
+sdk i maven ${MAVEN_VERSION}
=====================================
.github/install-zulu11.sh deleted
=====================================
@@ -1,23 +0,0 @@
-#!/usr/bin/env bash
-
-set -euf
-
-AZUL_GPG_KEY=0xB1998361219BD9C9
-ZULU_VERSION=11
-ZULU_RELEASE=11.0.12-1
-
-sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ${AZUL_GPG_KEY}
-sudo apt-add-repository 'deb http://repos.azulsystems.com/ubuntu stable main'
-sudo apt-get update
-sudo apt-get install -y zulu-repo
-sudo apt-get update
-sudo apt-get install -y zulu${ZULU_VERSION}=${ZULU_RELEASE}
-sudo sed -i.orig -e "s/^hl /jre /g" -e "s/^jdkhl /jdk /g" /usr/lib/jvm/.zulu${ZULU_VERSION}-ca-amd64.jinfo
-sudo update-java-alternatives --set zulu${ZULU_VERSION}-ca-amd64
-export ALTERNATIVES_JAVAC=$(realpath /etc/alternatives/javac)
-export JAVA_HOME=${ALTERNATIVES_JAVAC%/bin/javac}
-export PATH=$JAVA_HOME/bin:$PATH
-java -version
-
-set +euf
-
=====================================
.github/install-zulu8.sh deleted
=====================================
@@ -1,23 +0,0 @@
-#!/usr/bin/env bash
-
-set -euf
-
-AZUL_GPG_KEY=0xB1998361219BD9C9
-ZULU_VERSION=8
-ZULU_RELEASE=8.0.302-1
-
-sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ${AZUL_GPG_KEY}
-sudo apt-add-repository 'deb http://repos.azulsystems.com/ubuntu stable main'
-sudo apt-get update
-sudo apt-get install -y zulu-repo
-sudo apt-get update
-sudo apt-get install -y zulu${ZULU_VERSION}=${ZULU_RELEASE}
-sudo sed -i.orig -e "s/^hl /jre /g" -e "s/^jdkhl /jdk /g" /usr/lib/jvm/.zulu${ZULU_VERSION}-ca-amd64.jinfo
-sudo update-java-alternatives --set zulu${ZULU_VERSION}-ca-amd64
-export ALTERNATIVES_JAVAC=$(realpath /etc/alternatives/javac)
-export JAVA_HOME=${ALTERNATIVES_JAVAC%/bin/javac}
-export PATH=$JAVA_HOME/bin:$PATH
-java -version
-
-set +euf
-
=====================================
.github/workflows/main.yml
=====================================
@@ -10,38 +10,50 @@ jobs:
build-codebase:
strategy:
matrix:
- os: [ubuntu-20.04]
- java_version: [8]
- maven_version: [3.8.1]
+ os: [ubuntu-24.04]
+ jdk_version: [8.0.422-zulu, 11.0.24-zulu, 17.0.12-zulu, 21.0.4-zulu]
+ maven_version: [3.9.8]
include:
- - os: ubuntu-20.04
- java_version: 8
- maven_version: 3.8.1
+ - os: ubuntu-24.04
+ jdk_version: 8.0.422-zulu
+ zulu_version: 8.80.0.17
+ maven_version: 3.9.8
maven_deploy: true
- name: Build on OS ${{ matrix.os }} with Maven ${{ matrix.maven_version }} using Zulu ${{ matrix.java_version }}
+ docker_build: true
+ maven_docker_container_image_repo: luminositylabs
+ maven_docker_container_image_name: maven
+ maven_docker_container_image_tag: 3.9.8_openjdk-8u422_zulu-alpine-8.80.0.17
+ name: Build on OS ${{ matrix.os }} with Maven ${{ matrix.maven_version }} using JDK ${{ matrix.jdk_version }}
runs-on: ${{ matrix.os }}
env:
- JAVA_HOME: /usr/lib/jvm/zulu${{ matrix.java_version }}-ca-amd64
- MAVEN_HOME: /usr/share/maven
MAVEN_PROPS: -Djavadoc.path=`which javadoc`
PROFILES: gpg,release-sign-artifacts,sonatype-deployment,sonatype-snapshots,sonatype-staging,sonatype-releases
SETTINGS: .github/settings.xml
steps:
- name: Checkout Source
- uses: actions/checkout at v2
+ uses: actions/checkout at v4
- name: Install GPG and generate test key
run: .github/install-gpg.sh
- - name: Install Zulu OpenJDK
- run: .github/install-zulu${{ matrix.java_version }}.sh
+ - name: Install SDKMAN and java environment
+ run: |
+ .github/install-sdkman.sh ${{ matrix.jdk_version }} ${{ matrix.maven_version }}
+ echo "SDKMAN_DIR=${HOME}/.sdkman" >> $GITHUB_ENV
- - name: Install Maven
- run: .github/install-maven.sh
+ - name: Add SDKMAN candidate environment variables
+ run: |
+ echo "JAVA_HOME=${SDKMAN_DIR}/candidates/java/current" >> $GITHUB_ENV
+ echo "MAVEN_HOME=${SDKMAN_DIR}/candidates/maven/current" >> $GITHUB_ENV
+
+ - name: Add SDKMAN candidate paths to system path
+ run: |
+ echo "${JAVA_HOME}/bin" >> $GITHUB_PATH
+ echo "${MAVEN_HOME}/bin" >> $GITHUB_PATH
- name: Setup Maven repository cache
- uses: actions/cache at v2
+ uses: actions/cache at v4
env:
cache-name: m2repo
with:
@@ -53,6 +65,9 @@ jobs:
- name: Log github.ref
run: echo "${{ github.ref }}"
+ - name: List Maven repositories
+ run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} dependency:list-repositories
+
- name: Show Maven dependency tree
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} dependency:tree
@@ -73,4 +88,11 @@ jobs:
env:
OSSRHU: ${{ secrets.OSSRHU }}
OSSRHT: ${{ secrets.OSSRHT }}
- run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} deploy
\ No newline at end of file
+ run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} deploy
+
+ - name: Docker maven build
+ if: ${{ matrix.docker_build }}
+ env:
+ CBD: /usr/src/build
+ P: luminositylabs-oss
+ run: docker container run --rm -i -v "$(pwd)":"${CBD}" -v ${HOME}/.gnupg:/root/.gnupg -v ${P}-${{ matrix.maven_docker_container_image_tag }}-mvn-repo:/root/.m2 -w "${CBD}" ${{ matrix.maven_docker_container_image_repo }}/${{ matrix.maven_docker_container_image_name }}:${{ matrix.maven_docker_container_image_tag }} mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} -Djavadoc.path=/usr/bin/javadoc -Dmaven.integration.test.skip=true dependency:list-repositories dependency:tree help:active-profiles clean install site site:stage
=====================================
maven-version-rules.xml
=====================================
@@ -4,27 +4,34 @@
xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 http://mojo.codehaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">
<ignoreVersions>
<!-- Exclude milestones, release candidates, alphas, and betas-->
- <ignoreVersion type="regex">.*-[M|RC|alpha|beta|rc].*</ignoreVersion>
+ <ignoreVersion type="regex">.*[\.-](?i)([M|alpha|beta|rc]).*</ignoreVersion>
<!-- Exclude milestones, release candidates, alphas, and betas, and Java7 qualifiers -->
<ignoreVersion type="regex">.*\.jre[6-7]</ignoreVersion>
</ignoreVersions>
<rules>
- <!-- Pin git-commit-id-plugin version to final release version before V5 until codebase migrates to Java11 -->
- <rule groupId="pl.project13.maven" artifactId="git-commit-id-plugin">
+ <!-- Pin logback version to v1.3.x (v1.4.0+ requires Java11) -->
+ <rule groupId="ch.qos.logback" comparisonMethod="maven">
<ignoreVersions>
- <ignoreVersion type="regex">4\.9\.9</ignoreVersion>
+ <ignoreVersion type="regex">1\.[4-9]\..*</ignoreVersion>
</ignoreVersions>
</rule>
- <!-- Pin testng version to pre-V7 -->
- <rule groupId="org.testng" artifactId="testng">
+ <!-- Pin checkstyle version to pre-v10 (v10 is requires Java11) -->
+ <rule groupId="com.puppycrawl.tools" artifactId="checkstyle" comparisonMethod="maven">
<ignoreVersions>
- <ignoreVersion type="regex">7\..*</ignoreVersion>
+ <ignoreVersion type="regex">10\..*</ignoreVersion>
</ignoreVersions>
</rule>
- <!-- Ignore logback version with groovyless suffix -->
- <rule groupId="ch.qos.logback">
+ <!-- Pin testng version to 7.5.x (v7.6+ requires Java11) -->
+ <rule groupId="org.testng" artifactId="testng" comparisonMethod="maven">
<ignoreVersions>
- <ignoreVersion type="regex">.*-groovyless</ignoreVersion>
+ <ignoreVersion type="regex">7\.[6-9].*</ignoreVersion>
+ <ignoreVersion type="regex">7\.10\..*</ignoreVersion>
+ </ignoreVersions>
+ </rule>
+ <!-- Pin git-commit-id-plugin version to final 4.x release version (v5+ requires Java11 -->
+ <rule groupId="pl.project13.maven" artifactId="git-commit-id-plugin">
+ <ignoreVersions>
+ <ignoreVersion type="regex">4\.9\.9</ignoreVersion>
</ignoreVersions>
</rule>
</rules>
=====================================
pmd.xml
=====================================
@@ -11,10 +11,12 @@
</description>
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP"/>
<rule ref="category/java/bestpractices.xml/CheckResultSet"/>
+ <rule ref="category/java/bestpractices.xml/PrimitiveWrapperInstantiation"/>
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter"/>
<rule ref="category/java/bestpractices.xml/UnusedLocalVariable"/>
<rule ref="category/java/bestpractices.xml/UnusedPrivateField"/>
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod"/>
+ <rule ref="category/java/codestyle.xml/EmptyControlStatement"/>
<rule ref="category/java/codestyle.xml/ExtendsObject"/>
<rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop"/>
<rule ref="category/java/codestyle.xml/TooManyStaticImports"/>
@@ -22,6 +24,7 @@
<rule ref="category/java/codestyle.xml/UnnecessaryImport"/>
<rule ref="category/java/codestyle.xml/UnnecessaryModifier"/>
<rule ref="category/java/codestyle.xml/UnnecessaryReturn"/>
+ <rule ref="category/java/codestyle.xml/UnnecessarySemicolon"/>
<rule ref="category/java/codestyle.xml/UselessParentheses"/>
<rule ref="category/java/codestyle.xml/UselessQualifiedThis"/>
<rule ref="category/java/design.xml/CollapsibleIfStatements"/>
@@ -36,15 +39,6 @@
<rule ref="category/java/errorprone.xml/ClassCastExceptionWithToArray"/>
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices"/>
<rule ref="category/java/errorprone.xml/EmptyCatchBlock"/>
- <rule ref="category/java/errorprone.xml/EmptyFinallyBlock"/>
- <rule ref="category/java/errorprone.xml/EmptyIfStmt"/>
- <rule ref="category/java/errorprone.xml/EmptyInitializer"/>
- <rule ref="category/java/errorprone.xml/EmptyStatementBlock"/>
- <rule ref="category/java/errorprone.xml/EmptyStatementNotInLoop"/>
- <rule ref="category/java/errorprone.xml/EmptySwitchStatements"/>
- <rule ref="category/java/errorprone.xml/EmptySynchronizedBlock"/>
- <rule ref="category/java/errorprone.xml/EmptyTryBlock"/>
- <rule ref="category/java/errorprone.xml/EmptyWhileStmt"/>
<rule ref="category/java/errorprone.xml/JumbledIncrementer"/>
<rule ref="category/java/errorprone.xml/MisplacedNullCheck"/>
<rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode"/>
@@ -57,5 +51,4 @@
<rule ref="category/java/multithreading.xml/DontCallThreadRun"/>
<rule ref="category/java/multithreading.xml/DoubleCheckedLocking"/>
<rule ref="category/java/performance.xml/BigIntegerInstantiation"/>
- <rule ref="category/java/performance.xml/BooleanInstantiation"/>
</ruleset>
\ No newline at end of file
=====================================
pom.xml
=====================================
@@ -4,7 +4,7 @@
<groupId>net.postgis</groupId>
<artifactId>postgis-java-aggregator</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
<packaging>pom</packaging>
<name>PostGIS Java Project</name>
@@ -79,7 +79,7 @@
<url>https://github.com/postgis/postgis-java</url>
<connection>scm:git:git://github.com/postgis/postgis-java.git</connection>
<developerConnection>scm:git:git at github.com:postgis/postgis-java.git</developerConnection>
- <tag>postgis-java-aggregator-2021.1.0</tag>
+ <tag>postgis-java-aggregator-2024.1.0</tag>
</scm>
<issueManagement>
<system>GitHub Issues</system>
@@ -94,9 +94,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.min.version>8</java.min.version>
- <maven.min.version>3.6</maven.min.version>
+ <maven.min.version>3.8</maven.min.version>
<maven.test.skip>false</maven.test.skip>
<maven.integration.test.skip>false</maven.integration.test.skip>
<failsafe.forkCount>1</failsafe.forkCount>
@@ -109,59 +108,59 @@
<jxr.skip>false</jxr.skip>
<pmd.skip>true</pmd.skip>
<spotbugs.skip>true</spotbugs.skip>
- <test.container.image>postgis/postgis:13-3.1-alpine</test.container.image>
+ <test.container.image>postgis/postgis:16-3.4-alpine</test.container.image>
<test.db.username>postgis1</test.db.username>
<test.db.password>postgis1</test.db.password>
<test.db.name>postgis1</test.db.name>
<test.db.port>5432</test.db.port>
<!-- Plugin versioning -->
- <build-helper-maven-plugin.version>3.2.0</build-helper-maven-plugin.version>
- <directory-maven-plugin.version>0.3.1</directory-maven-plugin.version>
- <download-maven-plugin.version>1.6.6</download-maven-plugin.version>
- <exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
- <git-commit-id-plugin.version>4.0.5</git-commit-id-plugin.version>
- <jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
- <maven-antrun-plugin.version>3.0.0</maven-antrun-plugin.version>
- <maven-archetype-plugin.version>3.2.0</maven-archetype-plugin.version>
- <maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version>
- <maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
- <maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
- <maven-dependency-plugin.version>3.2.0</maven-dependency-plugin.version>
- <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
- <maven-ear-plugin.version>3.2.0</maven-ear-plugin.version>
+ <build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
+ <directory-maven-plugin.version>1.0</directory-maven-plugin.version>
+ <download-maven-plugin.version>1.9.0</download-maven-plugin.version>
+ <exec-maven-plugin.version>3.3.0</exec-maven-plugin.version>
+ <git-commit-id-plugin.version>4.9.10</git-commit-id-plugin.version>
+ <jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
+ <maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
+ <maven-archetype-plugin.version>3.2.1</maven-archetype-plugin.version>
+ <maven-assembly-plugin.version>3.7.1</maven-assembly-plugin.version>
+ <maven-checkstyle-plugin.version>3.4.0</maven-checkstyle-plugin.version>
+ <maven-clean-plugin.version>3.4.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
+ <maven-dependency-plugin.version>3.7.1</maven-dependency-plugin.version>
+ <maven-deploy-plugin.version>3.1.2</maven-deploy-plugin.version>
+ <maven-ear-plugin.version>3.3.0</maven-ear-plugin.version>
<maven-ejb-plugin.version>3.0.1</maven-ejb-plugin.version>
- <maven-enforcer-plugin.version>3.0.0</maven-enforcer-plugin.version>
- <maven-failsafe-plugin.version>2.22.2</maven-failsafe-plugin.version>
- <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
- <maven-install-plugin.version>2.5.2</maven-install-plugin.version>
- <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
+ <maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
+ <maven-failsafe-plugin.version>3.3.1</maven-failsafe-plugin.version>
+ <maven-gpg-plugin.version>3.2.4</maven-gpg-plugin.version>
+ <maven-install-plugin.version>3.1.2</maven-install-plugin.version>
+ <maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
<maven-jarsigner-plugin.version>3.0.0</maven-jarsigner-plugin.version>
- <maven-javadoc-plugin.version>3.3.0</maven-javadoc-plugin.version>
- <maven-jxr-plugin.version>3.1.1</maven-jxr-plugin.version>
- <maven-pmd-plugin.version>3.14.0</maven-pmd-plugin.version>
- <maven-project-info-reports-plugin.version>3.1.2</maven-project-info-reports-plugin.version>
- <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
- <maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
- <maven-shade-plugin.version>3.2.4</maven-shade-plugin.version>
- <maven-site-plugin.version>3.9.1</maven-site-plugin.version>
- <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
- <maven-surefire-report-plugin.version>2.22.2</maven-surefire-report-plugin.version>
- <maven-war-plugin.version>3.3.1</maven-war-plugin.version>
- <spotbugs-maven-plugin.version>4.3.0</spotbugs-maven-plugin.version>
- <versions-maven-plugin.version>2.8.1</versions-maven-plugin.version>
+ <maven-javadoc-plugin.version>3.8.0</maven-javadoc-plugin.version>
+ <maven-jxr-plugin.version>3.4.0</maven-jxr-plugin.version>
+ <maven-pmd-plugin.version>3.24.0</maven-pmd-plugin.version>
+ <maven-project-info-reports-plugin.version>3.6.2</maven-project-info-reports-plugin.version>
+ <maven-release-plugin.version>3.1.1</maven-release-plugin.version>
+ <maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
+ <maven-shade-plugin.version>3.6.0</maven-shade-plugin.version>
+ <maven-site-plugin.version>3.12.1</maven-site-plugin.version>
+ <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
+ <maven-surefire-plugin.version>3.3.1</maven-surefire-plugin.version>
+ <maven-surefire-report-plugin.version>3.3.1</maven-surefire-report-plugin.version>
+ <maven-war-plugin.version>3.4.0</maven-war-plugin.version>
+ <spotbugs-maven-plugin.version>4.8.6.2</spotbugs-maven-plugin.version>
+ <versions-maven-plugin.version>2.17.1</versions-maven-plugin.version>
<!-- Dependency versions -->
- <dependency.checkstyle.version>8.45</dependency.checkstyle.version>
- <dependency.jts-version.version>1.18.1</dependency.jts-version.version>
- <dependency.logback.version>1.2.5</dependency.logback.version>
- <dependency.pmd.version>6.37.0</dependency.pmd.version>
- <dependency.postgresql-jdbc.version>42.2.23</dependency.postgresql-jdbc.version>
- <dependency.slf4j.version>1.7.32</dependency.slf4j.version>
+ <dependency.checkstyle.version>9.3</dependency.checkstyle.version>
+ <dependency.jts-version.version>1.19.0</dependency.jts-version.version>
+ <dependency.logback.version>1.3.14</dependency.logback.version>
+ <dependency.pmd.version>7.4.0</dependency.pmd.version>
+ <dependency.postgresql-jdbc.version>42.7.3</dependency.postgresql-jdbc.version>
+ <dependency.slf4j.version>2.0.13</dependency.slf4j.version>
<dependency.spatial4j.version>0.8</dependency.spatial4j.version>
- <dependency.spotbugs.version>4.3.0</dependency.spotbugs.version>
- <dependency.testcontainers.version>1.16.0</dependency.testcontainers.version>
- <dependency.testng.version>6.14.3</dependency.testng.version>
+ <dependency.spotbugs.version>4.8.6</dependency.spotbugs.version>
+ <dependency.testcontainers.version>1.20.1</dependency.testcontainers.version>
+ <dependency.testng.version>7.5.1</dependency.testng.version>
</properties>
<dependencyManagement>
@@ -827,17 +826,6 @@
<javadoc.path>${java.home}/bin/javadoc.exe</javadoc.path>
</properties>
</profile>
- <profile>
- <id>javahome-env-javadoc</id>
- <activation>
- <property>
- <name>env.JAVA_HOME</name>
- </property>
- </activation>
- <properties>
- <javadoc.path>${env.JAVA_HOME}/bin/javadoc</javadoc.path>
- </properties>
- </profile>
<profile>
<id>check-versions</id>
<build>
=====================================
postgis-jdbc-geometry/pom.xml
=====================================
@@ -5,11 +5,11 @@
<parent>
<groupId>net.postgis</groupId>
<artifactId>postgis-java-aggregator</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
</parent>
<artifactId>postgis-geometry</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
<packaging>jar</packaging>
<name>PostGIS Geometry</name>
@@ -21,7 +21,7 @@
<dependency>
<groupId>net.postgis.tools</groupId>
<artifactId>test-utils</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
=====================================
postgis-jdbc-geometry/src/test/resources/logback-test.xml
=====================================
@@ -12,6 +12,8 @@
<logger name="com.github.dockerjava" level="ERROR"/>
<logger name="org.testcontainers" level="ERROR"/>
+ <logger name="org.testng" level="ERROR"/>
+
<logger name="net.postgis" level="ERROR"/>
</configuration>
\ No newline at end of file
=====================================
postgis-jdbc-java2d/pom.xml
=====================================
@@ -5,11 +5,11 @@
<parent>
<groupId>net.postgis</groupId>
<artifactId>postgis-java-aggregator</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
</parent>
<artifactId>postgis-jdbc-java2d</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
<packaging>jar</packaging>
<name>postgis-jdbc-java2d</name>
@@ -19,12 +19,12 @@
<dependency>
<groupId>net.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
</dependency>
<dependency>
<groupId>net.postgis.tools</groupId>
<artifactId>test-utils</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
=====================================
postgis-jdbc-java2d/src/main/java/net/postgis/jdbc/java2d/Java2DWrapper.java
=====================================
@@ -106,15 +106,12 @@ public class Java2DWrapper extends Driver {
* Mangles the PostGIS URL to return the original PostGreSQL URL
*
* @param url String containing the url to be "mangled"
- * @return "mangled" string
- * @throws SQLException when a SQLException occurs
+ * @return "mangled" string or null if the URL is unsupported
*/
- public static String mangleURL(String url) throws SQLException {
- if (url.startsWith(POSTGIS_PROTOCOL)) {
- return POSTGRES_PROTOCOL + url.substring(POSTGIS_PROTOCOL.length());
- } else {
- throw new SQLException("Unknown protocol or subprotocol in url " + url);
- }
+ public static String mangleURL(String url) {
+ return url.startsWith(POSTGIS_PROTOCOL)
+ ? POSTGRES_PROTOCOL + url.substring(POSTGIS_PROTOCOL.length())
+ : null;
}
/**
@@ -128,12 +125,8 @@ public class Java2DWrapper extends Driver {
* @return true if this driver accepts the given URL
*/
public boolean acceptsURL(String url) {
- try {
- url = mangleURL(url);
- } catch (SQLException e) {
- return false;
- }
- return super.acceptsURL(url);
+ url = mangleURL(url);
+ return url != null && super.acceptsURL(url);
}
/**
=====================================
postgis-jdbc-java2d/src/test/resources/logback-test.xml
=====================================
@@ -10,6 +10,8 @@
<appender-ref ref="STDOUT" />
</root>
+ <logger name="org.testng" level="ERROR"/>
+
<logger name="net.postgis.jdbc.java2d" level="ERROR"/>
</configuration>
\ No newline at end of file
=====================================
postgis-jdbc-jts/pom.xml
=====================================
@@ -5,11 +5,11 @@
<parent>
<groupId>net.postgis</groupId>
<artifactId>postgis-java-aggregator</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
</parent>
<artifactId>postgis-jdbc-jts</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
<packaging>jar</packaging>
<name>Postgis JDBC Driver JTS Parser</name>
@@ -21,7 +21,7 @@
<dependency>
<groupId>net.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
</dependency>
<dependency>
<groupId>org.locationtech.jts</groupId>
@@ -36,7 +36,7 @@
<dependency>
<groupId>net.postgis.tools</groupId>
<artifactId>test-utils</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
=====================================
postgis-jdbc-jts/src/main/java/net/postgis/jdbc/jts/JtsBinaryParser.java
=====================================
@@ -228,11 +228,15 @@ public class JtsBinaryParser {
}
private Polygon parsePolygon(ValueGetter data, boolean haveZ, boolean haveM, int srid) {
- int holecount = data.getInt() - 1;
- LinearRing[] rings = new LinearRing[holecount];
+ int count = data.getInt();
+ if (count == 0) {
+ return jtsFactory.getGeometryFactory().createPolygon();
+ }
LinearRing shell = parseLinearRing(data, haveZ, haveM);
shell.setSRID(srid);
- for (int i = 0; i < holecount; i++) {
+ int holeCount = count-1;
+ LinearRing[] rings = new LinearRing[holeCount];
+ for (int i = 0; i < holeCount; i++) {
rings[i] = parseLinearRing(data, haveZ, haveM);
rings[i].setSRID(srid);
}
=====================================
postgis-jdbc-jts/src/main/java/net/postgis/jdbc/jts/JtsGisWrapper.java
=====================================
@@ -100,15 +100,12 @@ public class JtsGisWrapper extends Driver {
* Mangles the PostGIS URL to return the original PostGreSQL URL
*
* @param url String containing the url to be "mangled"
- * @return "mangled" string
- * @throws SQLException when a SQLException occurs
+ * @return "mangled" string or null if the URL is unsupported
*/
- public static String mangleURL(String url) throws SQLException {
- if (url.startsWith(POSTGIS_PROTOCOL)) {
- return POSTGRES_PROTOCOL + url.substring(POSTGIS_PROTOCOL.length());
- } else {
- throw new SQLException("Unknown protocol or subprotocol in url " + url);
- }
+ public static String mangleURL(String url) {
+ return url.startsWith(POSTGIS_PROTOCOL)
+ ? POSTGRES_PROTOCOL + url.substring(POSTGIS_PROTOCOL.length())
+ : null;
}
/**
@@ -122,12 +119,8 @@ public class JtsGisWrapper extends Driver {
* @return true if this driver accepts the given URL
*/
public boolean acceptsURL(String url) {
- try {
- url = mangleURL(url);
- } catch (SQLException e) {
- return false;
- }
- return super.acceptsURL(url);
+ url = mangleURL(url);
+ return url != null && super.acceptsURL(url);
}
/**
=====================================
postgis-jdbc-jts/src/main/java/net/postgis/jdbc/jts/JtsWrapper.java
=====================================
@@ -109,15 +109,12 @@ public class JtsWrapper extends Driver {
* Mangles the PostGIS URL to return the original PostGreSQL URL
*
* @param url String containing the url to be "mangled"
- * @return "mangled" string
- * @throws SQLException when a SQLException occurs
+ * @return "mangled" string or null if the URL is unsupported
*/
- public static String mangleURL(String url) throws SQLException {
- if (url.startsWith(POSTGIS_PROTOCOL)) {
- return POSTGRES_PROTOCOL + url.substring(POSTGIS_PROTOCOL.length());
- } else {
- throw new SQLException("Unknown protocol or subprotocol in url " + url);
- }
+ public static String mangleURL(String url) {
+ return url.startsWith(POSTGIS_PROTOCOL)
+ ? POSTGRES_PROTOCOL + url.substring(POSTGIS_PROTOCOL.length())
+ : null;
}
/**
@@ -128,12 +125,8 @@ public class JtsWrapper extends Driver {
* @return true if this driver accepts the given URL
*/
public boolean acceptsURL(String url) {
- try {
- url = mangleURL(url);
- } catch (SQLException e) {
- return false;
- }
- return super.acceptsURL(url);
+ url = mangleURL(url);
+ return url != null && super.acceptsURL(url);
}
/**
=====================================
postgis-jdbc-jts/src/test/java/net/postgis/jdbc/jts/EmptyGeometriesTest.java
=====================================
@@ -0,0 +1,116 @@
+/*
+ * EmptyGeometriesTest.java
+ *
+ * EmptyGeometriesTest for JTS - checks correct parsing of empty geometry.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+package net.postgis.jdbc.jts;
+
+import net.postgis.tools.testutils.TestContainerController;
+import org.locationtech.jts.geom.Geometry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.ITestContext;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This class contains tests for handling of empty geometries.
+ */
+public class EmptyGeometriesTest {
+
+ private static final Logger logger = LoggerFactory.getLogger(EmptyGeometriesTest.class);
+
+ private static final String DRIVER_WRAPPER_CLASS_NAME = "net.postgis.jdbc.jts.JtsWrapper";
+
+ public static final String[] geometriesToTest = new String[]{
+ "POINT",
+ "LINESTRING",
+ "POLYGON",
+ "MULTIPOINT",
+ "MULTILINESTRING",
+ "MULTIPOLYGON",
+ "GEOMETRYCOLLECTION",
+ };
+
+ private Connection connection = null;
+
+ private Statement statement = null;
+
+ @Test
+ public void testSqlStatements() throws SQLException {
+ for (String sqlStatement : generateSqlStatements()) {
+ logger.debug("**********");
+ logger.debug("* Executing sql statement => [{}]", sqlStatement);
+ logger.debug("**********");
+ try (PreparedStatement preparedStatement = connection.prepareStatement(sqlStatement);
+ ResultSet resultSet = preparedStatement.executeQuery()
+ ) {
+ resultSet.next();
+ JtsGeometry resultSetObject = resultSet.getObject(1, JtsGeometry.class);
+ Geometry geometry = resultSetObject.getGeometry();
+ logger.debug("JTS geometry => {}", geometry.toString());
+ }
+ }
+ }
+
+ private List<String> generateSqlStatements() {
+ List<String> sqlStatementList = new ArrayList<>();
+ for (String geometry : geometriesToTest) {
+ String sqlStatement = "select ST_GeomFromText('" + geometry + " EMPTY')";
+ logger.debug("generate sql statement: {}", sqlStatement);
+ sqlStatementList.add(sqlStatement);
+ }
+ return sqlStatementList;
+ }
+
+ @BeforeClass
+ public void initJdbcConnection(ITestContext ctx) throws Exception {
+ final String jdbcUrlSuffix = (String) ctx.getAttribute(TestContainerController.TEST_CONTAINER_JDBC_URL_SUFFIX);
+ Assert.assertNotNull(jdbcUrlSuffix);
+ final String jdbcUrl = "jdbc:postgres_jts" + jdbcUrlSuffix;
+ final String jdbcUsername = (String) ctx.getAttribute(TestContainerController.TEST_CONTAINER_ENV_USER_PARAM_NAME);
+ Assert.assertNotNull(jdbcUsername);
+ final String jdbcPassword = (String) ctx.getAttribute(TestContainerController.TEST_CONTAINER_ENV_PW_PARAM_NAME);
+ Assert.assertNotNull(jdbcPassword);
+ Class.forName(DRIVER_WRAPPER_CLASS_NAME);
+ connection = DriverManager.getConnection(jdbcUrl, jdbcUsername, jdbcPassword);
+ statement = connection.createStatement();
+ }
+
+ @AfterClass
+ public void unallocateDatabaseResources() throws Exception {
+ if ((statement != null) && (!statement.isClosed())) {
+ statement.close();
+ }
+ if ((connection != null) && (!connection.isClosed())) {
+ connection.close();
+ }
+ }
+}
\ No newline at end of file
=====================================
postgis-jdbc-jts/src/test/resources-filtered/testng-it.xml
=====================================
@@ -11,6 +11,7 @@
<classes>
<class name="net.postgis.tools.testutils.TestContainerController"/>
<class name="net.postgis.jdbc.jts.JtsParserTest"/>
+ <class name="net.postgis.jdbc.jts.EmptyGeometriesTest"/>
</classes>
</test>
=====================================
postgis-jdbc-jts/src/test/resources/logback-test.xml
=====================================
@@ -12,8 +12,8 @@
<logger name="com.github.dockerjava" level="ERROR"/>
<logger name="org.testcontainers" level="ERROR"/>
- <logger name="net.postgis" level="ERROR"/>
+ <logger name="org.testng" level="ERROR"/>
- <logger name="net.postgis.jdbc.jts" level="ERROR"/>
+ <logger name="net.postgis" level="ERROR"/>
</configuration>
\ No newline at end of file
=====================================
postgis-jdbc/pom.xml
=====================================
@@ -5,11 +5,11 @@
<parent>
<groupId>net.postgis</groupId>
<artifactId>postgis-java-aggregator</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
</parent>
<artifactId>postgis-jdbc</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
<packaging>jar</packaging>
<name>Postgis JDBC Driver</name>
@@ -21,7 +21,7 @@
<dependency>
<groupId>net.postgis</groupId>
<artifactId>postgis-geometry</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
@@ -31,7 +31,7 @@
<dependency>
<groupId>net.postgis.tools</groupId>
<artifactId>test-utils</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
=====================================
postgis-jdbc/src/main/java/net/postgis/jdbc/DriverWrapper.java
=====================================
@@ -145,18 +145,20 @@ public class DriverWrapper extends Driver {
/**
* Creates a postgresql connection, and then adds the PostGIS data types to it calling addpgtypes().
*
- * A side-effect of this method is that the specified url parameter may be be changed
- *
- * @param url the URL of the database to connect to (may be changed as a side-effect of this method)
+ * @param url the URL of the database to connect to
* @param info a list of arbitrary tag/value pairs as connection arguments
- * @return a connection to the URL or null if it isnt us
+ * @return a connection to the URL or null if the driver does not support the subprotocol specified in the URL
* @exception SQLException if a database access error occurs
*
* @see java.sql.Driver#connect
* @see org.postgresql.Driver
*/
public java.sql.Connection connect(String url, final Properties info) throws SQLException {
- url = mangleURL(url);
+ if (acceptsURL(url)) {
+ url = mangleURL(url);
+ } else {
+ return null;
+ }
Connection result = super.connect(url, info);
typesAdder.addGT(result, useLW(result));
return result;
@@ -181,19 +183,17 @@ public class DriverWrapper extends Driver {
/**
* Check whether the driver thinks he can handle the given URL.
*
- * A side-effect of this method is that the specified url parameter may be be changed
- *
* @see java.sql.Driver#acceptsURL
- * @param url the URL of the driver (may be changed as a side-effect of this method)
+ * @param url the URL of the driver
* @return true if this driver accepts the given URL
*/
public boolean acceptsURL(String url) {
- try {
- url = mangleURL(url);
- } catch (SQLException e) {
+ String mangledURL = mangleURL(url);
+ if (mangledURL == null) {
return false;
+ } else {
+ return super.acceptsURL(mangledURL);
}
- return super.acceptsURL(url);
}
@@ -254,16 +254,13 @@ public class DriverWrapper extends Driver {
* Mangles the PostGIS URL to return the original PostGreSQL URL
*
* @param url String containing the url to be "mangled"
- * @return "mangled" string
- * @throws SQLException when a SQLException occurs
+ * @return "mangled" string or null if the URL is unsupported
*/
- protected String mangleURL(final String url) throws SQLException {
- String myProgo = getProtoString();
- if (url.startsWith(myProgo)) {
- return POSTGRES_PROTOCOL + url.substring(myProgo.length());
- } else {
- throw new SQLException("Unknown protocol or subprotocol in url " + url);
- }
+ protected String mangleURL(final String url) {
+ String myProto = getProtoString();
+ return url.startsWith(myProto)
+ ? POSTGRES_PROTOCOL + url.substring(myProto.length())
+ : null;
}
=====================================
postgis-jdbc/src/test/java/net/postgis/jdbc/DriverConnectBehaviorTest.java
=====================================
@@ -0,0 +1,32 @@
+package net.postgis.jdbc;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+public class DriverConnectBehaviorTest {
+
+ @Test
+ public void testThatPostGisDoesNotOverwriteSavedExceptionForUnsupportedConnectionString() {
+ try {
+ DriverManager.getConnection("jdbc:missing");
+ } catch (SQLException e) {
+ // This should not be "Unknown protocol or subprotocol in url jdbc:missing", which
+ // would indicate that PostGIS threw an exception instead of returning `null` from
+ // the `connect` method for an unsupported connection string.
+ // (This is documented in `java.sql.Driver.connect`.)
+ //
+ // The former behavior is not desirable as throwing an exception causes a previously
+ // saved exception from a "better fitting" driver to be overwritten by PostGis, despite
+ // PostGis not actually being able to handle the connection.
+ //
+ // (Imagine an Oracle connection string with a wrong password, in which the Oracle
+ // driver's exception regarding the wrong password would be replaced with a generic
+ // nonsensical PostGis exception.)
+ Assert.assertEquals("No suitable driver found for jdbc:missing", e.getMessage());
+ }
+ }
+
+}
=====================================
postgis-jdbc/src/test/resources/logback-test.xml
=====================================
@@ -12,7 +12,7 @@
<logger name="com.github.dockerjava" level="ERROR"/>
<logger name="org.testcontainers" level="ERROR"/>
- <logger name="net.postgis" level="ERROR"/>
+ <logger name="org.testng" level="ERROR"/>
<logger name="net.postgis" level="ERROR"/>
=====================================
tools/pom.xml
=====================================
@@ -5,11 +5,11 @@
<parent>
<artifactId>postgis-java-aggregator</artifactId>
<groupId>net.postgis</groupId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
</parent>
<artifactId>tools</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
<packaging>pom</packaging>
<name>Tools</name>
=====================================
tools/smoketest/pom.xml
=====================================
@@ -5,11 +5,11 @@
<parent>
<artifactId>tools</artifactId>
<groupId>net.postgis</groupId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
</parent>
<artifactId>smoketest</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
<packaging>jar</packaging>
<name>smoketest</name>
@@ -26,12 +26,12 @@
<dependency>
<groupId>net.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
</dependency>
<dependency>
<groupId>net.postgis</groupId>
<artifactId>postgis-jdbc-java2d</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
@@ -46,7 +46,7 @@
<dependency>
<groupId>net.postgis.tools</groupId>
<artifactId>test-utils</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
=====================================
tools/smoketest/src/test/resources/logback-test.xml
=====================================
@@ -12,6 +12,8 @@
<logger name="com.github.dockerjava" level="ERROR"/>
<logger name="org.testcontainers" level="ERROR"/>
+ <logger name="org.testng" level="ERROR"/>
+
<logger name="net.postgis" level="ERROR"/>
</configuration>
\ No newline at end of file
=====================================
tools/test-utils/pom.xml
=====================================
@@ -5,12 +5,12 @@
<parent>
<groupId>net.postgis</groupId>
<artifactId>tools</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
</parent>
<groupId>net.postgis.tools</groupId>
<artifactId>test-utils</artifactId>
- <version>2021.1.0</version>
+ <version>2024.1.0</version>
<name>Test Utilities</name>
<description>Tools to facilities building and maintaining test suites</description>
=====================================
tools/test-utils/src/main/java/net/postgis/tools/testutils/TestContainerController.java
=====================================
@@ -47,7 +47,7 @@ public class TestContainerController {
@BeforeSuite
- public void initializeTestContainer(ITestContext ctx) {
+ public void initializeTestContainer(ITestContext ctx) throws Exception {
logger.debug("initializing test container");
Objects.requireNonNull(ctx, "test context was null");
@@ -84,6 +84,7 @@ public class TestContainerController {
final int mappedPort = container.getMappedPort(containerPort);
final String containerIpAddress = container.getContainerIpAddress();
logger.debug("started container with containerIPAddress=[{}] mappedPort=[{}]", containerIpAddress, mappedPort);
+ Thread.sleep(200); // wait a moment more for container to come up beyond the test container wait strategy
final String jdbcUrlSuffix = "://" + containerIpAddress + ":" + mappedPort + "/" + containerEnvDb;
ctx.setAttribute(TEST_CONTAINER_ATTR_NAME, container);
=====================================
tools/test-utils/src/test/resources/logback-test.xml
=====================================
@@ -12,6 +12,8 @@
<logger name="com.github.dockerjava" level="ERROR"/>
<logger name="org.testcontainers" level="ERROR"/>
+ <logger name="org.testng" level="ERROR"/>
+
<logger name="net.postgis" level="ERROR"/>
</configuration>
\ No newline at end of file
View it on GitLab: https://salsa.debian.org/debian-gis-team/postgis-java/-/commit/7a0f04b17a42514c467e9a2382e0a746479595d5
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/postgis-java/-/commit/7a0f04b17a42514c467e9a2382e0a746479595d5
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20240803/bc9d80b1/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list