Skip to content

Accept local Url + tests#763

Closed
gfinger wants to merge 1 commit intoArcadeData:mainfrom
gfinger:local-connect
Closed

Accept local Url + tests#763
gfinger wants to merge 1 commit intoArcadeData:mainfrom
gfinger:local-connect

Conversation

@gfinger
Copy link
Contributor

@gfinger gfinger commented Jan 12, 2023

What does this PR do?

A local URL like : local:<absolutePathToDB>/DB can be used within the Console to connect to a local DB, to create and drop it.

Motivation

It should be possible to use the Console not relying on the current work-directory. It might also be advantageous not to depend on a global setting like when using the -Darcadedb.server.databaseDirectory parameter at startup of the console.

Related issues

Introduction of the -Darcadedb.server.databaseDirectory parameter for the Console.

Additional Notes

The commit also contains Unit Tests for the local connect, as well as a test whether the local URL can also be used with the CREATE DB and the DROP DB commands.
I used JDK 19 for compiling and testing, but the code is compatible with Java 8.

Checklist

  • I have run the build using mvn clean package command
  • My unit tests cover both failure and success scenarios: No, this seems not necessary. There is also no negative test for the existing connect test.

private String parseLocalUrl(final String url) {
return databaseDirectory + url.replaceFirst("file://", "");
if(url.startsWith(LOCAL_PREFIX + "//")) {
return url.replaceFirst(LOCAL_PREFIX + "//", "/");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This forces the path tp be absolute, because it prefix the path with /. Is this wanted or a bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The paths are supposed to be absolute. The intention is to not rely on the current work-directory. Any not-absolute path would always be relative to the CWD. The URL without the LOCAL_PREFIX is still supported and allows to connect to a db relative to the database directory.


@Test
public void testDropCreateWithLocalUrl() throws IOException {
String localUrl = "local:/" + absoluteDBPath + "/" + DB_NAME;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you prefixing with local:/ because the absolute path already starts with /?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, exactly.

@gfinger
Copy link
Contributor Author

gfinger commented Jan 13, 2023

The build-error is:

Error:  Errors: 
Error:    JdbcQueriesTest.simpleCypherQuery:88 » PSQL ERROR: Syntax error on parsing query: java.lang.IllegalArgumentException: Unsupported class file major version 63
Error:    JdbcQueriesTest.simpleGremlinQuery:74 » PSQL ERROR: Syntax error on parsing query: java.lang.IllegalArgumentException: Unsupported class file major version 63
Error:    RemoteDatabaseQueriesTest.simpleCypherQuery:64->lambda$simpleCypherQuery$2:65 » Remote Error on executing remote operation query (cause:java.util.concurrent.ExecutionException detail:java.lang.IllegalArgumentException: Unsupported class file major version 63)
Error:    RemoteDatabaseQueriesTest.simpleGremlinQuery:56->lambda$simpleGremlinQuery$1:57 » Remote Error on executing remote operation query (cause:java.util.concurrent.ExecutionException detail:java.lang.IllegalArgumentException: Unsupported class file major version 63)

Is it possible that the test uses a JDK version not supported by Gremlin? I cannot see any cause in my small coding additions that might be responsible for this kind of error.

@gfinger gfinger closed this Jan 20, 2023
@gfinger gfinger deleted the local-connect branch January 20, 2023 15:51
@lvca lvca added the enhancement New feature or request label Jan 20, 2023
@lvca lvca added this to the 23.1.2 milestone Jan 20, 2023
@lvca
Copy link
Member

lvca commented Jan 20, 2023

Merged, thanks @gfinger !

mergify bot added a commit that referenced this pull request Mar 9, 2026
…6.1 to 3.6.2 [skip ci]

Bumps [org.apache.maven.plugins:maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.6.1 to 3.6.2.
Release notes

*Sourced from [org.apache.maven.plugins:maven-shade-plugin's releases](https://github.com/apache/maven-shade-plugin/releases).*

> 3.6.2
> -----
>
> 🐛 Bug Fixes
> -----------
>
> * Bug: Extra JARs and Artifacts were not subjected to filtering ([#785](https://redirect.github.com/apache/maven-shade-plugin/pull/785)) [`@​cstamas`](https://github.com/cstamas)
>
> 👻 Maintenance
> -------------
>
> * Drop excessive dependencies ([#786](https://redirect.github.com/apache/maven-shade-plugin/pull/786)) [`@​cstamas`](https://github.com/cstamas)
> * chore: remove junit3 reference ([#762](https://redirect.github.com/apache/maven-shade-plugin/pull/762)) [`@​sparsick`](https://github.com/sparsick)
> * Exclude Java 25 ([#773](https://redirect.github.com/apache/maven-shade-plugin/pull/773)) [`@​slachiewicz`](https://github.com/slachiewicz)
> * Update site descriptor, use site configuration from parent ([#755](https://redirect.github.com/apache/maven-shade-plugin/pull/755)) [`@​slawekjaranowski`](https://github.com/slawekjaranowski)
>
> 📦 Dependency updates
> --------------------
>
> * Drop unneeded dependencies ([#788](https://redirect.github.com/apache/maven-shade-plugin/pull/788)) [`@​cstamas`](https://github.com/cstamas)
> * Update to parent POM v 47 ([#781](https://redirect.github.com/apache/maven-shade-plugin/pull/781)) [`@​Bukama`](https://github.com/Bukama)
> * Bump org.apache.maven.plugin-testing:maven-plugin-testing-harness from 3.5.0 to 3.5.1 ([#782](https://redirect.github.com/apache/maven-shade-plugin/pull/782)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump org.codehaus.mojo:mrm-maven-plugin from 1.7.0 to 1.7.1 ([#780](https://redirect.github.com/apache/maven-shade-plugin/pull/780)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump org.apache.maven.plugin-testing:maven-plugin-testing-harness from 3.4.0 to 3.5.0 ([#778](https://redirect.github.com/apache/maven-shade-plugin/pull/778)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump asmVersion from 9.9 to 9.9.1 ([#774](https://redirect.github.com/apache/maven-shade-plugin/pull/774)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Update invoker plugin to 3.9.1 to Support Java 25 ([#769](https://redirect.github.com/apache/maven-shade-plugin/pull/769)) [`@​Bukama`](https://github.com/Bukama)
> * Bump asmVersion from 9.8 to 9.9 ([#761](https://redirect.github.com/apache/maven-shade-plugin/pull/761)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump org.xmlunit:xmlunit-legacy from 2.10.3 to 2.11.0 ([#763](https://redirect.github.com/apache/maven-shade-plugin/pull/763)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump org.apache.maven.plugin-tools:maven-plugin-annotations from 3.15.1 to 3.15.2 ([#764](https://redirect.github.com/apache/maven-shade-plugin/pull/764)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump org.apache.maven.plugin-testing:maven-plugin-testing-harness from 3.3.0 to 3.4.0 ([#768](https://redirect.github.com/apache/maven-shade-plugin/pull/768)) @[dependabot[bot]](https://github.com/apps/dependabot)
> * Bump org.codehaus.plexus:plexus-utils from 3.5.1 to 3.6.0 ([#758](https://redirect.github.com/apache/maven-shade-plugin/pull/758)) @[dependabot[bot]](https://github.com/apps/dependabot)


Commits

* [`ad8de59`](apache/maven-shade-plugin@ad8de59) [maven-release-plugin] prepare release maven-shade-plugin-3.6.2
* [`8eb19dc`](apache/maven-shade-plugin@8eb19dc) Drop unneeded dependencies ([#788](https://redirect.github.com/apache/maven-shade-plugin/issues/788))
* [`397b2cd`](apache/maven-shade-plugin@397b2cd) Drop excessive dependencies ([#786](https://redirect.github.com/apache/maven-shade-plugin/issues/786))
* [`eca6398`](apache/maven-shade-plugin@eca6398) Bug: Extra JARs and Artifacts were not subjected to filtering ([#785](https://redirect.github.com/apache/maven-shade-plugin/issues/785))
* [`7edce17`](apache/maven-shade-plugin@7edce17) Update to parent POM v 47 ([#781](https://redirect.github.com/apache/maven-shade-plugin/issues/781))
* [`3171a34`](apache/maven-shade-plugin@3171a34) Mockito improvements ([#783](https://redirect.github.com/apache/maven-shade-plugin/issues/783))
* [`678844b`](apache/maven-shade-plugin@678844b) Bump org.apache.maven.plugin-testing:maven-plugin-testing-harness ([#782](https://redirect.github.com/apache/maven-shade-plugin/issues/782))
* [`73ec909`](apache/maven-shade-plugin@73ec909) Bump org.codehaus.mojo:mrm-maven-plugin from 1.7.0 to 1.7.1 ([#780](https://redirect.github.com/apache/maven-shade-plugin/issues/780))
* [`5f7a877`](apache/maven-shade-plugin@5f7a877) Bump org.apache.maven.plugin-testing:maven-plugin-testing-harness ([#778](https://redirect.github.com/apache/maven-shade-plugin/issues/778))
* [`73c5247`](apache/maven-shade-plugin@73c5247) chore: remove junit3 reference ([#762](https://redirect.github.com/apache/maven-shade-plugin/issues/762))
* Additional commits viewable in [compare view](apache/maven-shade-plugin@maven-shade-plugin-3.6.1...maven-shade-plugin-3.6.2)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=org.apache.maven.plugins:maven-shade-plugin&package-manager=maven&previous-version=3.6.1&new-version=3.6.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants