pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: vlsi (@vlsi) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: [pgjdbc/pgjdbc] PR #3614: test: simplify TestUtil.openDB, add tests with various assumeMinServerVersion values
Date: Thu, 01 May 2025 17:23:53 +0000
Message-ID: <[email protected]> (raw)
Previously, the code considered only a few of PGProperty names when creating a database connection. So there was no possibility to set the rest of the properties by passing them with build.properties or -D...
After the change, the code uses all the matching properties from System.properties, so we can increase test coverage.
For instance, the change adds tests with assumeMinServerVersion setting.
I still do not like how `Properties` contents is copied all over the place, however, we can't do better as we do not have `Properties(List<Properties>)` factory yet.
This test would have caught https://github.com/pgjdbc/pgjdbc/issues/3508 earlier.
The idea behind the change is:
* Prefer pgjdbc property names (the ones in `PGProperty`). For instance, previously, `build.properties` included a property named `username` which was handled in a special way since `PGProperty.USER` has a value of `user`.
That is the reason I changed `server` to `test.url.PGHOST` which effectively means "use it as a default PGHOST value, and pass it via the URL rather than props object)
* host/port/database was handled separately when building the URL. Now the logic is that any property can be passed to the URL when building the URL with `TestUtil`. The `test.url.` prefix allows to configure which properties should be passed with the URL (`TestUtil` strips the prefix and adds the rest as a query parameter, etc)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: github://pgjdbc/pgjdbc
Cc: [email protected], [email protected]
Subject: Re: [pgjdbc/pgjdbc] PR #3614: test: simplify TestUtil.openDB, add tests with various assumeMinServerVersion values
In-Reply-To: <<[email protected]>>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox