Skip to content

Console: Unify console commands with path argument #724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 31, 2022

Conversation

gramian
Copy link
Collaborator

@gramian gramian commented Dec 30, 2022

What does this PR do?

These changes mainly affect the methods:

  • executeConnect
  • executeCreateDatabase
  • executeDropDatabase

and unify the tests for "already connected database", "empty url", and "locked database" by refactoring these tests to private methods called:

  • checkDatabaseIsConnected
  • checkDatabaseIsLocked
  • checkUrlIsEmpty

where each is throwing a ConsoleException if triggered.
This not only makes the code cleaner and has less duplication, but I think it uncovered a problem with testing (see changes in tests): Some tests seemed to pass because no exception is thrown but just a message was printed.

Furthermore, a helper method preprocessing the local database URL, parseLocalUrl is added to unify handling of this string.

Motivation

The commands above react differently to certain states while they should be similar if not same.

Related issues

#579
#599

Additional Notes

  • Cosmetic change in executeListDatabases
  • Update help text of close command as it currently disconnects and not closes a database in the sense of the endpoint.
  • Changed the exception type incheckDatabaseIsOpen from ArcadeDBException to ConsoleException to match others.
  • Sorry for the big commit, but these changes were all interconnected.

Checklist

  • I have run the build using mvn clean package command
  • My unit tests cover both failure and success scenarios

@lvca lvca self-requested a review December 31, 2022 17:13
@lvca lvca added this to the 23.1.1 milestone Dec 31, 2022
@lvca lvca added the enhancement New feature or request label Dec 31, 2022
@lvca
Copy link
Contributor

lvca commented Dec 31, 2022

Thanks, much cleaner now.

@lvca lvca merged commit f621bfd into ArcadeData:main Dec 31, 2022
mergify bot added a commit that referenced this pull request Feb 3, 2025
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4.6.0 to 4.7.0.
Release notes

*Sourced from [actions/setup-java's releases](https://github.com/actions/setup-java/releases).*

> v4.7.0
> ------
> 
> What's Changed
> --------------
> 
> * Configure Dependabot settings by [`@​HarithaVattikuti`](https://github.com/HarithaVattikuti) in [actions/setup-java#722](https://redirect.github.com/actions/setup-java/pull/722)
> * README Update: Added a permissions section by [`@​benwells`](https://github.com/benwells) in [actions/setup-java#723](https://redirect.github.com/actions/setup-java/pull/723)
> * Upgrade `cache` from version 3.2.4 to 4.0.0 by [`@​aparnajyothi-y`](https://github.com/aparnajyothi-y) in [actions/setup-java#724](https://redirect.github.com/actions/setup-java/pull/724)
> * Upgrade `@actions/http-client` from 2.2.1 to 2.2.3 by [`@​dependabot`](https://github.com/dependabot) in [actions/setup-java#728](https://redirect.github.com/actions/setup-java/pull/728)
> * Upgrade `actions/publish-immutable-action` from 0.0.3 to 0.0.4 by [`@​dependabot`](https://github.com/dependabot) in [actions/setup-java#727](https://redirect.github.com/actions/setup-java/pull/727)
> * Upgrade `@types/jest` from 29.5.12 to 29.5.14 by [`@​dependabot`](https://github.com/dependabot) in [actions/setup-java#729](https://redirect.github.com/actions/setup-java/pull/729)
> 
> New Contributors
> ----------------
> 
> * [`@​benwells`](https://github.com/benwells) made their first contribution in [actions/setup-java#723](https://redirect.github.com/actions/setup-java/pull/723)
> 
> **Full Changelog**: <actions/setup-java@v4...v4.7.0>


Commits

* [`3a4f6e1`](actions/setup-java@3a4f6e1) Bump `@​types/jest` from 29.5.12 to 29.5.14 ([#729](https://redirect.github.com/actions/setup-java/issues/729))
* [`25f376e`](actions/setup-java@25f376e) Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 ([#727](https://redirect.github.com/actions/setup-java/issues/727))
* [`d4e4b6b`](actions/setup-java@d4e4b6b) Bump `@​actions/http-client` from 2.2.1 to 2.2.3 ([#728](https://redirect.github.com/actions/setup-java/issues/728))
* [`28b532b`](actions/setup-java@28b532b) Create dependabot.yml ([#722](https://redirect.github.com/actions/setup-java/issues/722))
* [`51ab6d2`](actions/setup-java@51ab6d2) Update cache from 3.2.4 to 4.0.0 ([#724](https://redirect.github.com/actions/setup-java/issues/724))
* [`99d3141`](actions/setup-java@99d3141) Update README.md ([#723](https://redirect.github.com/actions/setup-java/issues/723))
* See full diff in [compare view](actions/setup-java@7a6d8a8...3a4f6e1)

  

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=actions/setup-java&package-manager=github\_actions&previous-version=4.6.0&new-version=4.7.0)](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 merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy