diff --git a/src/main/bash/sdkman-use.sh b/src/main/bash/sdkman-use.sh index 5b9e4b9b3..afdeef5dc 100644 --- a/src/main/bash/sdkman-use.sh +++ b/src/main/bash/sdkman-use.sh @@ -42,17 +42,7 @@ function __sdk_use() { elif [[ ${count} -eq 1 ]] then version=$(basename $(ls -d "${SDKMAN_CANDIDATES_DIR}/${candidate}/${major_version}"*)) - if [[ $PATH =~ ${SDKMAN_CANDIDATES_DIR}/${candidate}/([^/]+) ]]; then - local matched_version - - if [[ "$zsh_shell" == "true" ]]; then - matched_version=${match[1]} - else - matched_version=${BASH_REMATCH[1]} - fi - - export PATH=${PATH//${SDKMAN_CANDIDATES_DIR}\/${candidate}\/${matched_version}/${SDKMAN_CANDIDATES_DIR}\/${candidate}\/${version}} - fi + __sdkman_change_candidate_in_path "$candidate" __sdkman_echo_green "Using ${candidate} version ${version} in this shell." else echo "" @@ -74,18 +64,7 @@ function __sdk_use() { # Just update the *_HOME and PATH for this shell. __sdkman_set_candidate_home "$candidate" "$version" - if [[ $PATH =~ ${SDKMAN_CANDIDATES_DIR}/${candidate}/([^/]+) ]]; then - local matched_version - - if [[ "$zsh_shell" == "true" ]]; then - matched_version=${match[1]} - else - matched_version=${BASH_REMATCH[1]} - fi - - export PATH=${PATH//${SDKMAN_CANDIDATES_DIR}\/${candidate}\/${matched_version}/${SDKMAN_CANDIDATES_DIR}\/${candidate}\/${version}} - fi - + __sdkman_change_candidate_in_path "$candidate" if [[ ! (-L "${SDKMAN_CANDIDATES_DIR}/${candidate}/current" || -d "${SDKMAN_CANDIDATES_DIR}/${candidate}/current") ]]; then __sdkman_echo_green "Setting ${candidate} version ${version} as default." __sdkman_link_candidate_version "$candidate" "$version" @@ -95,3 +74,17 @@ function __sdk_use() { __sdkman_echo_green "Using ${candidate} version ${version} in this shell." fi } + +function __sdkman_change_candidate_in_path() { + if [[ $PATH =~ ${SDKMAN_CANDIDATES_DIR}/${1}/([^/]+) ]]; then + local matched_version + + if [[ "$zsh_shell" == "true" ]]; then + matched_version=${match[1]} + else + matched_version=${BASH_REMATCH[1]} + fi + + export PATH=${PATH//${SDKMAN_CANDIDATES_DIR}\/${candidate}\/${matched_version}/${SDKMAN_CANDIDATES_DIR}\/${candidate}\/${version}} + fi +} diff --git a/src/test/resources/features/checksum_verification.feature b/src/test/resources/features/checksum_verification.feature deleted file mode 100644 index 03d3b8986..000000000 --- a/src/test/resources/features/checksum_verification.feature +++ /dev/null @@ -1,82 +0,0 @@ -Feature: Verify checksums - - Background: - Given the internet is reachable - And an initialised environment - And I have configured "sdkman_checksum_enable" to "true" - - Scenario: Install a specific Version with a valid SHA-256 checksum - Given the system is bootstrapped - And the candidate "grails" version "1.3.9" is available for download with checksum "1f9234c8e622ec46d33883ea45b39ede768b92d478fe08f6952548247f7fbb65" using algorithm "SHA-256" - When I enter "sdk install grails 1.3.9" - Then I see "Done installing!" - And the candidate "grails" version "1.3.9" is installed - And the response headers file is created for candidate "grails" and version "1.3.9" - And the exit code is 0 - - Scenario: Install a specific Version with a valid SHA1 checksum - Given the system is bootstrapped - And the candidate "grails" version "1.3.9" is available for download with checksum "c68e386a6deec9fc4c1e18df21f92739ba2ab36e" using algorithm "SHA1" - When I enter "sdk install grails 1.3.9" - Then I see "Done installing!" - And the candidate "grails" version "1.3.9" is installed - And the response headers file is created for candidate "grails" and version "1.3.9" - And the exit code is 0 - - Scenario: Install a specific Version with a valid MD5 checksum - Given the system is bootstrapped - And the candidate "grails" version "1.3.9" is available for download with checksum "1e87a7d982a2f41da96fdec289908552" using algorithm "MD5" - When I enter "sdk install grails 1.3.9" - Then I see "Done installing!" - And the candidate "grails" version "1.3.9" is installed - And the response headers file is created for candidate "grails" and version "1.3.9" - And the exit code is 0 - - Scenario: Do not fail if an unknown algorithm is used - Given the system is bootstrapped - And the candidate "grails" version "1.3.9" is available for download with checksum "abc-checksum-00000" using algorithm "ABC" - When I enter "sdk install grails 1.3.9" - Then I see "Done installing!" - And the candidate "grails" version "1.3.9" is installed - And the response headers file is created for candidate "grails" and version "1.3.9" - And the exit code is 0 - - Scenario: Do not fail if no algorithm is detected - Given the system is bootstrapped - And the candidate "grails" version "1.3.9" is available for download - When I enter "sdk install grails 1.3.9" - Then I see "Done installing!" - And I do not see "Stop! An invalid checksum was detected and the archive removed! Please try re-installing." - And the candidate "grails" version "1.3.9" is installed - And the response headers file is created for candidate "grails" and version "1.3.9" - And the exit code is 0 - - Scenario: Do not fail if checksums are disabled - Given the system is bootstrapped - And I have configured "sdkman_checksum_enable" to "false" - And the candidate "grails" version "1.3.9" is available for download with checksum "abc-checksum-00000" using algorithm "SHA-256" - When I enter "sdk install grails 1.3.9" - Then I see "Checksums are disabled, skipping verification" - And I see "Done installing!" - And the candidate "grails" version "1.3.9" is installed - And the response headers file is created for candidate "grails" and version "1.3.9" - And the exit code is 0 - - @manual - Scenario: Abort installation after download of a binary with invalid SHA checksum - Given the system is bootstrapped - And the candidate "grails" version "1.3.9" is available for download with checksum "c68e386a6deec9fc4c1e18df21f927000000000e" using algorithm "SHA-256" - When I enter "sdk install grails 1.3.9" - Then I see "Stop! An invalid checksum was detected and the archive removed! Please try re-installing." - And the candidate "grails" version "1.3.9" is not installed - And the archive for candidate "grails" version "1.3.9" is removed - And the exit code is 1 - - Scenario: Abort installation after download of a binary with invalid MD5 checksum - Given the system is bootstrapped - And the candidate "grails" version "1.3.9" is available for download with checksum "1e87a7d982a2f41da96fdec289908533" using algorithm "MD5" - When I enter "sdk install grails 1.3.9" - Then I see "Stop! An invalid checksum was detected and the archive removed! Please try re-installing." - And the candidate "grails" version "1.3.9" is not installed - And the archive for candidate "grails" version "1.3.9" is removed - And the exit code is 1 diff --git a/src/test/resources/features/command_line_interop.feature b/src/test/resources/features/command_line_interop.feature deleted file mode 100644 index ce5e0887e..000000000 --- a/src/test/resources/features/command_line_interop.feature +++ /dev/null @@ -1,24 +0,0 @@ -Feature: Command Line Interop - - Background: - Given the internet is reachable - And an initialised environment - And the system is bootstrapped - - Scenario: Enter sdk - When I enter "sdk" - Then I see "Usage: sdk [candidate] [version]" - And I see "sdk offline " - - Scenario: Ask for help - When I enter "sdk help" - Then I see "Usage: sdk [candidate] [version]" - - Scenario: Enter an invalid Command - When I enter "sdk goopoo grails" - Then I see "Invalid command: goopoo" - And I see "Usage: sdk [candidate] [version]" - - Scenario: Enter an invalid Candidate - When I enter "sdk install groffle" - Then I see "Stop! groffle is not a valid candidate." diff --git a/src/test/resources/features/current_candidate.feature b/src/test/resources/features/current_candidate.feature deleted file mode 100644 index 04272f763..000000000 --- a/src/test/resources/features/current_candidate.feature +++ /dev/null @@ -1,39 +0,0 @@ -Feature: Current Candidate - - Background: - Given the internet is reachable - And an initialised environment - - Scenario: Display current candidate version in use - Given the candidate "grails" version "1.3.9" is already installed and default - And the system is bootstrapped - When I enter "sdk current grails" - Then I see "Using grails version 1.3.9" - - Scenario: Display current candidate version when none is in use - Given the candidate "grails" version "1.3.9" is already installed but not default - And the system is bootstrapped - When I enter "sdk current grails" - Then I see "Not using any version of grails" - - Scenario: Display current candidate versions when none is specified and none is in use - Given the candidate "grails" version "1.3.9" is already installed but not default - And the system is bootstrapped - When I enter "sdk current" - Then I see "No candidates are in use" - - Scenario: Display current candidate versions when none is specified and one is in use - Given the candidate "grails" version "2.1.0" is already installed and default - And the system is bootstrapped - When I enter "sdk current" - Then I see "Using:" - And I see "grails: 2.1.0" - - Scenario: Display current candidate versions when none is specified and multiple are in use - Given the candidate "groovy" version "2.0.5" is already installed and default - And the candidate "grails" version "2.1.0" is already installed and default - And the system is bootstrapped - When I enter "sdk current" - Then I see "Using:" - And I see "grails: 2.1.0" - And I see "groovy: 2.0.5" diff --git a/src/test/resources/features/default_version.feature b/src/test/resources/features/default_version.feature deleted file mode 100644 index 85af56901..000000000 --- a/src/test/resources/features/default_version.feature +++ /dev/null @@ -1,35 +0,0 @@ -Feature: Default Version - - Background: - Given the internet is reachable - And an initialised environment - - Scenario: Default a candidate version that is not installed - Given the candidate "groovy" version "2.0.5" is a valid candidate version - And the system is bootstrapped - When I enter "sdk default groovy 2.0.5" - Then I see "Stop! Candidate version is not installed." - And I see "Tip: Run the following to install this version" - And I see "$ sdk install groovy 2.0.5" - - Scenario: Default a candidate version that is installed and not default - Given the candidate "groovy" version "2.0.5" is a valid candidate version - And the candidate "groovy" version "2.0.5" is already installed but not default - And the system is bootstrapped - When I enter "sdk default groovy 2.0.5" - Then I see "Default groovy version set to 2.0.5" - And the candidate "groovy" version "2.0.5" should be the default - - Scenario: Default a candidate version that is installed and already default - Given the candidate "groovy" version "2.0.5" is a valid candidate version - And the candidate "groovy" version "2.0.5" is already installed and default - And the system is bootstrapped - When I enter "sdk default groovy 2.0.5" - Then I see "Default groovy version set to 2.0.5" - And the candidate "groovy" version "2.0.5" should be the default - - Scenario: Default a candidate version that does not exist - Given the candidate "groovy" version "2.9.9" is not available for download - And the system is bootstrapped - When I enter "sdk default groovy 2.9.9" - Then I see "Stop! groovy 2.9.9 is not available." diff --git a/src/test/resources/features/flush.feature b/src/test/resources/features/flush.feature deleted file mode 100644 index 096b3f5dc..000000000 --- a/src/test/resources/features/flush.feature +++ /dev/null @@ -1,33 +0,0 @@ -Feature: Flush - - Background: - Given the internet is reachable - And an initialised environment - And the system is bootstrapped - - Scenario: Clear out the temporary storage and metadata - And the file "res-1.2.0.zip" in temporary storage - And a headers file "grails-1.3.9.headers" in metadata directory with checksum "c68e386a6deec9fc4c1e18df21f92739ba2ab36e" using algorithm "SHA1" - When I enter "sdk flush" - And no "res-1.2.0.zip" file is present in temporary storage - And no metadata is cached - And I see "1 archive(s) flushed" - And I see "1 archive(s) flushed" - - Scenario: Clean up the last known Remote Version - Given a prior version "5.0.0" was detected - When I enter "sdk flush version" - Then no version file can be found - And I see "Version file has been flushed." - - Scenario: Clear out the temporary storage - Given the file "res-1.2.0.zip" in temporary storage - When I enter "sdk flush temp" - Then no "res-1.2.0.zip" file is present in temporary storage - And I see "1 archive(s) flushed" - - Scenario: Clear out the metadata - Given a headers file "grails-1.3.9.headers" in metadata directory with checksum "c68e386a6deec9fc4c1e18df21f92739ba2ab36e" using algorithm "SHA1" - When I enter "sdk flush metadata" - Then no metadata is cached - And I see "1 archive(s) flushed" diff --git a/src/test/resources/features/home.feature b/src/test/resources/features/home.feature deleted file mode 100644 index 6dd80f865..000000000 --- a/src/test/resources/features/home.feature +++ /dev/null @@ -1,45 +0,0 @@ -Feature: Print home path - -* Print home directory -* Printing the home directory does not require reaching out to the internet. -* Printing the home directory also has the hard requirement of not printing -anything else unless it is an actual error. - - Background: - Given the internet is reachable - And an initialised environment without debug prints - - Scenario: Home without providing a Candidate - Given the system is bootstrapped - When I enter "sdk home" - Then I see "Usage: sdk [candidate] [version]" - - Scenario: Home for a candidate version that is installed - Given the candidate "grails" version "2.1.0" is already installed and default - And the candidate "grails" version "1.3.9" is a valid candidate version - And the candidate "grails" version "1.3.9" is already installed but not default - And the system is bootstrapped - When I enter "sdk home grails 1.3.9" - Then the home path ends with ".sdkman/candidates/grails/1.3.9" - - Scenario: Home for a candidate version that is not installed - Given the candidate "grails" version "1.3.9" is available for download - And the system is bootstrapped - When I enter "sdk home grails 1.3.9" - Then I see "Stop! Candidate version is not installed." - And I see "Tip: Run the following to install this version" - And I see "$ sdk install grails 1.3.9" - And the exit code is 1 - - Scenario: Home for a candidate version that does not exist - Given the candidate "groovy" version "1.9.9" is not available for download - And the system is bootstrapped - When I enter "sdk home groovy 1.9.9" - Then I see "Stop! groovy 1.9.9 is not available." - - Scenario: Home for a candidate version that only exists locally - Given the candidate "grails" version "2.0.0.M1" is not available for download - And the candidate "grails" version "2.0.0.M1" is already installed but not default - And the system is bootstrapped - When I enter "sdk home grails 2.0.0.M1" - Then the home path ends with ".sdkman/candidates/grails/2.0.0.M1" diff --git a/src/test/resources/features/hooks.feature b/src/test/resources/features/hooks.feature deleted file mode 100644 index fd47f9bd4..000000000 --- a/src/test/resources/features/hooks.feature +++ /dev/null @@ -1,25 +0,0 @@ -Feature: Hooks - - We can safely remove this feature when `.tar.gz` and `.zip` are supported directly by the backend. - - Background: - Given the internet is reachable - And an initialised environment - - Scenario: Post-installation Hook returns successfully - And an "x86_64" machine with "Linux" installed - And the system is bootstrapped - And the candidate "grails" version "2.1.0" is available for download on "Linux" with architecture "x86_64" - And a post-installation hook is served for "grails" "2.1.0" on "Linux" with architecture "x86_64" that returns successfully - When I enter "sdk install grails 2.1.0" - And I see "Post-installation hook success" - And the exit code is 0 - - Scenario: Post-install Hook returns a non-zero code - And an "x86_64" machine with "Linux" installed - And the system is bootstrapped - And the candidate "grails" version "2.1.0" is available for download on "Linux" with architecture "x86_64" - And a post-installation hook is served for "grails" "2.1.0" on "Linux" with architecture "x86_64" that returns a failure - When I enter "sdk install grails 2.1.0" - Then I see "Post-installation hook failure" - And the exit code is 1 diff --git a/src/test/resources/features/install_candidate.feature b/src/test/resources/features/install_candidate.feature deleted file mode 100644 index 2b855edd4..000000000 --- a/src/test/resources/features/install_candidate.feature +++ /dev/null @@ -1,95 +0,0 @@ -Feature: Install Candidate - - Background: - Given the internet is reachable - And an initialised environment - - Scenario: Install a default Candidate and set to default - Given the system is bootstrapped - And the candidate "grails" version "2.1.0" is a valid candidate version - And the default "grails" version is "2.1.0" - When I enter "sdk install grails" - Then I see "Done installing!" - And I do not see "Do you want grails 2.1.0 to be set as default? (Y/n)" - And the candidate "grails" version "2.1.0" is installed - And the response headers file is created for candidate "grails" and version "2.1.0" - And the exit code is 0 - - Scenario: Install a specific Candidate and set to default - Given the system is bootstrapped - And the candidate "grails" version "1.3.9" is available for download - When I enter "sdk install grails 1.3.9" - Then I see "Done installing!" - And I do not see "Do you want grails 1.3.9 to be set as default? (Y/n)" - And the candidate "grails" version "1.3.9" is installed - And the response headers file is created for candidate "grails" and version "1.3.9" - And the exit code is 0 - - Scenario: Install a Candidate version that does not exist - Given the system is bootstrapped - And the candidate "grails" version "1.4.4" is not available for download - When I enter "sdk install grails 1.4.4" - Then I see "Stop! grails 1.4.4 is not available." - And the exit code is 1 - - Scenario: Install a Candidate version that is already installed - Given the system is bootstrapped - And the candidate "grails" version "1.3.9" is available for download - And the candidate "grails" version "1.3.9" is already installed and default - When I enter "sdk install grails 1.3.9" - Then I see "grails 1.3.9 is already installed." - And no response headers are written for candidate "grails" and version "1.3.9" - And the exit code is 0 - - Scenario: Install a candidate and auto-answer to make it default - Given the system is bootstrapped - And the candidate "grails" version "2.1.0" is available for download - And I have configured "sdkman_auto_answer" to "true" - When I enter "sdk install grails 2.1.0" - Then the candidate "grails" version "2.1.0" is installed - And the response headers file is created for candidate "grails" and version "2.1.0" - And I do not see "Do you want grails 2.1.0 to be set as default?" - And I see "Done installing!" - And I see "Setting grails 2.1.0 as default." - And the candidate "grails" version "2.1.0" should be the default - And the exit code is 0 - - Scenario: Install a candidate and choose to make it default - Given the candidate "grails" version "1.3.9" is already installed and default - And the system is bootstrapped - And the candidate "grails" version "2.1.0" is available for download - When I enter "sdk install grails 2.1.0" and answer "Y" - Then the candidate "grails" version "2.1.0" is installed - And the response headers file is created for candidate "grails" and version "2.1.0" - And I see "Done installing!" - And I see "Do you want grails 2.1.0 to be set as default? (Y/n)" - And I see "Setting grails 2.1.0 as default." - And the candidate "grails" version "2.1.0" should be the default - And the candidate "grails" version "1.3.9" should not be the default - And the exit code is 0 - - Scenario: Install a candidate and choose not to make it default - Given the candidate "grails" version "1.3.9" is already installed and default - And the system is bootstrapped - And the candidate "grails" version "2.1.0" is available for download - When I enter "sdk install grails 2.1.0" and answer "n" - Then the candidate "grails" version "2.1.0" is installed - And the response headers file is created for candidate "grails" and version "2.1.0" - And I see "Done installing!" - And I see "Do you want grails 2.1.0 to be set as default? (Y/n)" - And I do not see "Setting grails 2.1.0 as default." - And the candidate "grails" version "2.1.0" should not be the default - And the candidate "grails" version "1.3.9" should be the default - And the exit code is 0 - - # revisit to redownload automatically - - Scenario: Abort installation on download of a corrupt Candidate archive - Given the system is bootstrapped - And the candidate "grails" version "1.3.6" is available for download - And the archive for candidate "grails" version "1.3.6" is corrupt - When I enter "sdk install grails 1.3.6" - Then I see "Stop! The archive was corrupt and has been removed! Please try installing again." - And the candidate "grails" version "1.3.6" is not installed - And the archive for candidate "grails" version "1.3.6" is removed - And the exit code is 1 diff --git a/src/test/resources/features/install_sdkman.feature b/src/test/resources/features/install_sdkman.feature deleted file mode 100644 index 1318bf8b2..000000000 --- a/src/test/resources/features/install_sdkman.feature +++ /dev/null @@ -1,82 +0,0 @@ -@manual -Feature: Install SDKMAN - - Platform defaults as follows: - * Ubuntu: .profile, .bashrc - * Fedora: .bash_profile, .bashrc - * OS X: no skeleton files in user home (nice one Apple!) - * Cygwin: .bash_profile, .profile and .bashrc - * Solaris: .profile, .bashrc - * FreeBSD: .profile with NO .bashrc or bash pre-installed - - Order of precedence: - Login shells (all new terminals) are initialised with the first file found in this order: - * .bash_profile - * .bash_login - * .profile - Non-login shells (like xterm shells) read the .bashrc file. - - Also important to note that usually the .bash_profile or .profile login shell files - will check for the .bashrc file and invoke if present! - - Background: - Given a user home exists - - Scenario: Creates and initialises .bash_profile on absence of login shell dot files - Given the user home directory contains no ".bash_profile" file - And the user home directory contains no ".profile" file - When I run the installation script - Then the user home contains a ".bash_profile" file - And the ".bash_profile" contains an Initialisation Snippet - - Scenario: Add Init Snippet to the .bash_profile if present - Given the user home contains a ".bash_profile" file - When I run the installation script - Then the ".bash_profile" contains an Initialisation Snippet - - Scenario: Add Init Snippet to the .profile if present - Given the user home contains a ".profile" file - When I run the installation script - Then the ".profile" contains an Initialisation Snippet - - Scenario: Creates and initialises .bashrc on absence of non-login dot files - Given the user home directory contains no ".bashrc" file - When I run the installation script - Then the user home contains a ".bashrc" file - And the ".bashrc" contains an Initialisation Snippet - - Scenario: Always adds Init Snippet to the .bashrc - Given the user home contains a ".bashrc" file - When I run the installation script - Then the ".bashrc" contains an Initialisation Snippet - - Scenario: Creates and initialises .zshrc on absence of the file - Given the user home directory contains no ".zshrc" file - When I run the installation script - Then the user home contains a ".zshrc" file - And the ".zshrc" contains an Initialisation Snippet - - Scenario: Always adds Init Snippet to the .zshrc - Given the user home contains a ".zshrc" file - When I run the installation script - Then the ".zshrc" contains an Initialisation Snippet - - Scenario: Source the Initialisation Script on first invokation of the Init Snippet - Given the user home contains a ".bash_profile" file - And the ".bash_profile" contains an Initialisation Snippet - When I open a new Login Shell - Then the "sdkman-init.sh" script is sourced once only - - Scenario: Do not Source the Initialisation Script on subsequent invocation of the Init Snippet - Given the user home contains a ".bash_profile" file - And the ".bash_profile" contains an Initialisation Snippet - And the user home contains a ".bashrc" file - And the ".bashrc" contains an Initialisation Snippet - When I open a new Login Shell - Then the "sdkman-init.sh" script is sourced once only - - Scenario: Upgrade an installation without configuration - Given an uninitialised system - And the configuration file has not been primed - When I run the installation script - Then the configuration file is present diff --git a/src/test/resources/features/java_installation.feature b/src/test/resources/features/java_installation.feature deleted file mode 100644 index dd7bdc4fe..000000000 --- a/src/test/resources/features/java_installation.feature +++ /dev/null @@ -1,68 +0,0 @@ -Feature: Java Multi Platform Binary Distribution - - Three versions of Java are used to test various installation scenarios. - This feature uses real hooks found in the resources folder under /hooks. - - The following hooks are available: - 8.0.111: post-hook prepared for successful installation - 8.0.101: post-hook aborts with non-zero return code - - Background: - Given the internet is reachable - And an initialised environment - - Scenario: Platform is supported and a specific version of compatible binary is installed - Given an "x86_64" machine with "Linux" installed - And the system is bootstrapped - And the candidate "java" version "8.0.111" is available for download on "Linux" with architecture "x86_64" - And the appropriate multi-platform hook is available for "java" version "8.0.111" on "Linux" with architecture "x86_64" - When I enter "sdk install java 8.0.111" - And I see "Done installing!" - And the candidate "java" version "8.0.111" is installed - - Scenario: Platform is supported and a default version of compatible binary is installed - Given an "x86_64" machine with "Linux" installed - And the system is bootstrapped - And the default "java" version is "8.0.111" - And the candidate "java" version "8.0.111" is available for download on "Linux" with architecture "x86_64" - And the appropriate multi-platform hook is available for "java" version "8.0.111" on "Linux" with architecture "x86_64" - When I enter "sdk install java" - And I see "Done installing!" - And the candidate "java" version "8.0.111" is installed - - Scenario: Platform is supported but download fails - Given an "x86_64" machine with "Linux" installed - And the system is bootstrapped - And the candidate "java" version "8.0.101" is available for download on "Linux" with architecture "x86_64" - And the appropriate multi-platform hook is available for "java" version "8.0.101" on "Linux" with architecture "x86_64" - When I enter "sdk install java 8.0.101" - And I see "Download has failed, aborting!" - And the candidate "java" version "8.0.101" is not installed - And I see "Cannot install java 8.0.101 at this time..." - - Scenario: Platform is not supported for specific version and user is notified - And an "x86_64" machine with "Linux" installed - And the system is bootstrapped - And the candidate "java" version "8.0.111" is not available for download on "Linux" - When I enter "sdk install java 8.0.111" - Then I see "Stop! java 8.0.111 is not available. Possible causes:" - And I see " * 8.0.111 is an invalid version" - And I see " * java binaries are incompatible with your platform" - And I see " * java has not been released yet" - And I see "Tip: see all available versions for your platform:" - And I see "$ sdk list java" - And the candidate "java" version "8.0.111" is not installed - - Scenario: Platform is not supported for default version and user is notified - And an "x86_64" machine with "Linux" installed - And the system is bootstrapped - And the default "java" version is "8.0.111" - And the candidate "java" version "8.0.111" is not available for download on "Linux" - When I enter "sdk install java" - Then I see "Stop! java 8.0.111 is not available. Possible causes:" - And I see " * 8.0.111 is an invalid version" - And I see " * java binaries are incompatible with your platform" - And I see " * java has not been released yet" - And I see "Tip: see all available versions for your platform:" - And I see "$ sdk list java" - And the candidate "java" version "8.0.111" is not installed diff --git a/src/test/resources/features/list_candidate_versions.feature b/src/test/resources/features/list_candidate_versions.feature deleted file mode 100644 index 783efff4b..000000000 --- a/src/test/resources/features/list_candidate_versions.feature +++ /dev/null @@ -1,61 +0,0 @@ -Feature: List Candidate Versions - - A dummy template to be served back that has the following information: - * Candidate: grails - * Current: 2.1.0 - * Versions: 2.1.0,2.1.1,2.1.2 (CSV) - - Background: - Given the internet is reachable - And an initialised environment - - Scenario: List an uninstalled available Version - Given I do not have a "grails" candidate installed - And the candidate "grails" has a version list available - And the system is bootstrapped - When I enter "sdk list grails" - Then I see "Candidate: grails" - - Scenario: List an installed available Version not in use - Given the candidate "grails" version "2.1.0" is already installed but not default - And the candidate "grails" has a version list available - And the system is bootstrapped - When I enter "sdk list grails" - Then I see "Versions: 2.1.0" - And I do not see "Current: 2.1.0" - - Scenario: List an installed available Version in use - Given the candidate "grails" version "2.1.0" is already installed and default - And the candidate "grails" has a version list available - And the system is bootstrapped - When I enter "sdk list grails" - Then I see "Current: 2.1.0" - And I see "Versions: 2.1.0" - - Scenario: List installed multiple Versions - Given the candidate "grails" version "2.1.0" is already installed and default - And the candidate "grails" version "2.0.9" is already installed but not default - And the candidate "grails" has a version list available - And the system is bootstrapped - When I enter "sdk list grails" - Then I see "Current: 2.1.0" - And I see "Versions: 2.0.9,2.1.0" - - Scenario: List an installed local version not in use - Given I have a local candidate "grails" version "2.3-SNAPSHOT" at "/tmp/groovy-core" - And the candidate "groovy" version "2.3-SNAPSHOT" is already linked to "/tmp/groovy-core" - And the candidate "groovy" has a version list available - And the system is bootstrapped - When I enter "sdk list groovy" - Then I see "Versions: 2.3-SNAPSHOT" - And I do not see "Current: 2.3-SNAPSHOT" - - Scenario: List an installed local Version in use - Given I have a local candidate "groovy" version "2.2-SNAPSHOT" at "/tmp/groovy-core" - And the candidate "groovy" version "2.2-SNAPSHOT" is already linked to "/tmp/groovy-core" - And the candidate "groovy" version "2.2-SNAPSHOT" is the default - And the candidate "groovy" has a version list available - And the system is bootstrapped - When I enter "sdk list groovy" - Then I see "Current: 2.2-SNAPSHOT" - And I see "Versions: 2.2-SNAPSHOT" diff --git a/src/test/resources/features/list_candidates.feature b/src/test/resources/features/list_candidates.feature deleted file mode 100644 index 907908207..000000000 --- a/src/test/resources/features/list_candidates.feature +++ /dev/null @@ -1,11 +0,0 @@ -Feature: List Candidates - - Background: - Given the internet is reachable - And an initialised environment - - Scenario: A List of Available Candidates can be viewed - Given the system is bootstrapped - And The candidate list is available - When I enter "sdk list" - Then I see "Candidate List" diff --git a/src/test/resources/features/local_developement_versions.feature b/src/test/resources/features/local_developement_versions.feature deleted file mode 100644 index e2feff11e..000000000 --- a/src/test/resources/features/local_developement_versions.feature +++ /dev/null @@ -1,92 +0,0 @@ -Feature: Local Development Versions - - Background: - Given the internet is reachable - And an initialised environment - - Scenario: Install a new local development version - Given the candidate "groovy" version "2.1-SNAPSHOT" is not available for download - And I have a local candidate "groovy" version "2.1-SNAPSHOT" at "/tmp/groovy-core" - And the system is bootstrapped - When I enter "sdk install groovy 2.1-SNAPSHOT /tmp/groovy-core" - Then I see "Linking groovy 2.1-SNAPSHOT to /tmp/groovy-core" - And the candidate "groovy" version "2.1-SNAPSHOT" is linked to "/tmp/groovy-core" - - Scenario: Attempt installing a local development version that already exists - Given the candidate "groovy" version "2.1-SNAPSHOT" is not available for download - And the candidate "groovy" version "2.1-SNAPSHOT" is already linked to "/tmp/groovy-core" - And the system is bootstrapped - When I enter "sdk install groovy 2.1-SNAPSHOT /tmp/groovy-core" - Then I see "groovy 2.1-SNAPSHOT is already installed." - And the exit code is 0 - And the candidate "groovy" version "2.1-SNAPSHOT" is linked to "/tmp/groovy-core" - - Scenario: Uninstall a local development version - Given the candidate "groovy" version "2.1-SNAPSHOT" is already linked to "/tmp/groovy-core" - And the system is bootstrapped - When I enter "sdk uninstall groovy 2.1-SNAPSHOT" - Then I see "Uninstalling groovy 2.1-SNAPSHOT" - And the candidate "groovy" version "2.1-SNAPSHOT" is not installed - - Scenario: Attempt uninstalling a local development version that is not installed - Given the candidate "groovy" version "2.1-SNAPSHOT" is not installed - And the system is bootstrapped - When I enter "sdk uninstall groovy 2.1-SNAPSHOT" - Then I see "groovy 2.1-SNAPSHOT is not installed." - - Scenario: Make the local development version the default for the candidate - Given the candidate "groovy" version "2.0.6" is already installed and default - And the candidate "groovy" version "2.1-SNAPSHOT" is not available for download - And the candidate "groovy" version "2.1-SNAPSHOT" is already linked to "/tmp/groovy-core" - And the system is bootstrapped - When I enter "sdk default groovy 2.1-SNAPSHOT" - Then I see "Default groovy version set to 2.1-SNAPSHOT" - And the candidate "groovy" version "2.1-SNAPSHOT" should be the default - - Scenario: Use a local development version - Given the candidate "groovy" version "2.0.6" is already installed and default - And the candidate "groovy" version "2.1-SNAPSHOT" is not available for download - And the candidate "groovy" version "2.1-SNAPSHOT" is already linked to "/tmp/groovy-core" - And the system is bootstrapped - When I enter "sdk use groovy 2.1-SNAPSHOT" - Then I see "Using groovy version 2.1-SNAPSHOT in this shell" - And the candidate "groovy" version "2.1-SNAPSHOT" should be in use - - Scenario: Install a local development version from a valid relative path - Given the candidate "groovy" version "2.1-SNAPSHOT" is not available for download - And I have a local candidate "groovy" version "2.1-SNAPSHOT" at relative path "some/relative/path/to/groovy" - And the system is bootstrapped - When I enter "sdk install groovy 2.1-SNAPSHOT some/relative/path/to/groovy" - Then I see "Linking groovy 2.1-SNAPSHOT" - And the candidate "groovy" version "2.1-SNAPSHOT" is linked to the relative path "some/relative/path/to/groovy" - - Scenario: Prevent installation of a local development version for an invalid path - Given the candidate "groovy" version "2.1-SNAPSHOT" is not available for download - And the system is bootstrapped - When I enter "sdk install groovy 2.1-SNAPSHOT /some/bogus/path/to/groovy" - Then I see "Invalid path! Refusing to link groovy 2.1-SNAPSHOT to /some/bogus/path/to/groovy." - And the candidate "groovy" version "2.1-SNAPSHOT" is not installed - - Scenario: Prevent installation of a local development version for a long version - Given the candidate "groovy" version "2.1-SNAPSHOTLONG" is not available for download - And I have a local candidate "groovy" version "2.1-SNAPSHOTLONG" at relative path "some/relative/path/to/groovy" - And the system is bootstrapped - When I enter "sdk install groovy 2.1-SNAPSHOTLONG some/relative/path/to/groovy" - Then I see "Invalid version! 2.1-SNAPSHOTLONG with length 16 exceeds max of 15!" - And the candidate "groovy" version "2.1-SNAPSHOTLONG" is not installed - - Scenario: Allow installation of a local development version for longest possible version - Given the candidate "groovy" version "2.1-SNAPSHOT-XX" is not available for download - And I have a local candidate "groovy" version "2.1-SNAPSHOT-XX" at "/tmp/groovy-core" - And the system is bootstrapped - When I enter "sdk install groovy 2.1-SNAPSHOT-XX /tmp/groovy-core" - Then I see "Linking groovy 2.1-SNAPSHOT-XX to /tmp/groovy-core" - And the candidate "groovy" version "2.1-SNAPSHOT-XX" is linked to "/tmp/groovy-core" - - Scenario: Allow installation of a local development version for a short version - Given the candidate "java" version "graal" is not available for download - And I have a local candidate "java" version "graal" at "/tmp/graalvm-1.0.0-rc4-graal" - And the system is bootstrapped - When I enter "sdk install java graal /tmp/graalvm-1.0.0-rc4-graal" - Then I see "Linking java graal to /tmp/graalvm-1.0.0-rc4-graal" - And the candidate "java" version "graal" is linked to "/tmp/graalvm-1.0.0-rc4-graal" diff --git a/src/test/resources/features/mnemonics.feature b/src/test/resources/features/mnemonics.feature deleted file mode 100644 index 0f25ca4c4..000000000 --- a/src/test/resources/features/mnemonics.feature +++ /dev/null @@ -1,88 +0,0 @@ -Feature: Mnemonics - - Background: - Given the internet is reachable - And an initialised environment - - Scenario: Shortcut for listing an uninstalled available Version - Given I do not have a "grails" candidate installed - And a "grails" list view is available for consumption - And the system is bootstrapped - When I enter "sdk l grails" - Then I see "Available Grails Versions" - - Scenario: Alternate shortcut for listing uninstalled available Version - Given I do not have a "grails" candidate installed - And a "grails" list view is available for consumption - And the system is bootstrapped - When I enter "sdk ls grails" - Then I see "Available Grails Versions" - - Scenario: Shortcut for displaying current Candidate Version in use - Given the candidate "grails" version "1.3.9" is already installed and default - And the system is bootstrapped - When I enter "sdk c grails" - Then I see "Using grails version 1.3.9" - - Scenario: Shortcut for displaying current Candidate Versions - Given the candidate "groovy" version "2.0.5" is already installed and default - And the candidate "grails" version "2.1.0" is already installed and default - And the system is bootstrapped - When I enter "sdk c" - Then I see "Using:" - And I see "grails: 2.1.0" - And I see "groovy: 2.0.5" - - Scenario: Shortcut for displaying upgradable Candidate Version in use - Given the candidate "grails" version "1.3.9" is already installed and default - And the default "grails" version is "2.4.4" - And the system is bootstrapped - When I enter "sdk ug grails" and answer "n" - Then I see "Available defaults:" - And I see "grails (local: 1.3.9; default: 2.4.4)" - - Scenario: Shortcut for installing a Candidate Version - Given the candidate "grails" version "2.1.0" is not installed - And the candidate "grails" version "2.1.0" is available for download - And the system is bootstrapped - When I enter "sdk i grails 2.1.0" and answer "Y" - Then I see "Installing: grails 2.1.0" - And the candidate "grails" version "2.1.0" is installed - - Scenario: Shortcut for uninstalling a Candidate Version - Given the candidate "groovy" version "2.0.5" is already installed and default - And the system is bootstrapped - When I enter "sdk rm groovy 2.0.5" - Then I see "Uninstalling groovy 2.0.5" - And the candidate "groovy" version "2.0.5" is not installed - - Scenario: Shortcut for showing the current Version of sdkman - Given the system is bootstrapped - When I enter "sdk v" - Then I see "SDKMAN 5.0.0" - - Scenario: Shortcut for using a candidate version that is installed - Given the candidate "grails" version "2.1.0" is already installed and default - And the candidate "grails" version "2.1.0" is a valid candidate version - And the candidate "grails" version "1.3.9" is already installed but not default - And the candidate "grails" version "1.3.9" is a valid candidate version - And the system is bootstrapped - When I enter "sdk u grails 1.3.9" - Then I see "Using grails version 1.3.9 in this shell." - Then the candidate "grails" version "1.3.9" should be in use - And the candidate "grails" version "2.1.0" should be the default - - Scenario: Shortcut for defaulting a Candidate Version that is installed and not default - Given the candidate "groovy" version "2.0.5" is already installed but not default - And the candidate "groovy" version "2.0.5" is a valid candidate version - And the system is bootstrapped - When I enter "sdk d groovy 2.0.5" - Then I see "Default groovy version set to 2.0.5" - And the candidate "groovy" version "2.0.5" should be the default - - Scenario: Shortcut for displaying Home directory - Given the candidate "grails" version "2.1.0" is already installed and default - And the candidate "grails" version "2.1.0" is a valid candidate version - And the system is bootstrapped - When I enter "sdk h grails 2.1.0" - Then the home path ends with ".sdkman/candidates/grails/2.1.0" diff --git a/src/test/resources/features/offline_mode.feature b/src/test/resources/features/offline_mode.feature deleted file mode 100644 index 064f96797..000000000 --- a/src/test/resources/features/offline_mode.feature +++ /dev/null @@ -1,125 +0,0 @@ -Feature: Offline Mode - - # offline modes - - Scenario: Enter an invalid offline mode - Given offline mode is disabled with reachable internet - And an initialised environment - And the system is bootstrapped - When I enter "sdk offline grails" - Then I see "Stop! grails is not a valid offline mode." - - Scenario: Issue Offline command without qualification - Given offline mode is disabled with reachable internet - And an initialised environment - And the system is bootstrapped - When I enter "sdk offline" - Then I see "Offline mode enabled." - - Scenario: Enable Offline Mode with internet reachable - Given offline mode is disabled with reachable internet - And an initialised environment - And the system is bootstrapped - When I enter "sdk offline enable" - Then I see "Offline mode enabled." - And I do not see "INTERNET NOT REACHABLE!" - When I enter "sdk install grails 2.1.0" - Then I do not see "INTERNET NOT REACHABLE!" - And I see "Stop! grails 2.1.0 is not available while offline." - - Scenario: Disable Offline Mode with internet reachable - Given offline mode is enabled with reachable internet - And the candidate "grails" version "2.1.0" is available for download - And an initialised environment - And the system is bootstrapped - When I enter "sdk offline disable" - Then I see "Online mode re-enabled!" - When I enter "sdk install grails 2.1.0" and answer "Y" - Then I see "Done installing!" - And the candidate "grails" version "2.1.0" is installed - - Scenario: Disable Offline Mode with internet unreachable - Given offline mode is enabled with unreachable internet - And an initialised environment - And the system is bootstrapped - When I enter "sdk offline disable" - Then I see "Online mode re-enabled!" - When I enter "sdk install grails 2.1.0" - Then I see "INTERNET NOT REACHABLE!" - And I see "Stop! grails 2.1.0 is not available while offline." - - # sdk version - - Scenario: Determine the sdkman version while in Offline Mode - Given offline mode is enabled with reachable internet - And an initialised environment - And the system is bootstrapped - When I enter "sdk version" - Then I see the current sdkman version - - # list candidate version - - Scenario: List candidate versions found while in Offline Mode - Given offline mode is enabled with reachable internet - And an initialised environment - And the system is bootstrapped - When I enter "sdk list grails" - Then I see "Offline: only showing installed grails versions" - - # default version - - Scenario: Set the default to an uninstalled candidate version while in Offline Mode - Given offline mode is enabled with reachable internet - And the candidate "grails" version "1.3.9" is already installed and default - And an initialised environment - And the system is bootstrapped - When I enter "sdk default grails 2.1.0" - Then I see "Stop! grails 2.1.0 is not available while offline." - - # install command - - Scenario: Install a candidate version that is not installed while in Offline Mode - Given offline mode is enabled with reachable internet - And the candidate "grails" version "2.1.0" is not installed - And an initialised environment - And the system is bootstrapped - When I enter "sdk install grails 2.1.0" - Then I see "Stop! grails 2.1.0 is not available while offline." - - # uninstall command - - Scenario: Uninstall a candidate version while in Offline Mode - Given offline mode is enabled with reachable internet - And the candidate "grails" version "2.1.0" is already installed and default - And an initialised environment - And the system is bootstrapped - When I enter "sdk uninstall grails 2.1.0" - And the candidate "grails" version "2.1.0" is not installed - - # current command - - Scenario: Display the current version of a candidate while in Offline Mode - Given offline mode is enabled with reachable internet - And the candidate "grails" version "2.1.0" is already installed and default - And an initialised environment - And the system is bootstrapped - When I enter "sdk current grails" - Then I see "Using grails version 2.1.0" - - # help command - - Scenario: Request help while in Offline Mode - Given offline mode is enabled with reachable internet - And an initialised environment - And the system is bootstrapped - When I enter "sdk help" - Then I see "Usage: sdk [candidate] [version]" - - # selfupdate command - - Scenario: Attempt self-update while in Offline Mode - Given offline mode is enabled with reachable internet - And an initialised environment - And the system is bootstrapped - When I enter "sdk selfupdate" - Then I see "This command is not available while offline." diff --git a/src/test/resources/features/path_initialisation.feature b/src/test/resources/features/path_initialisation.feature deleted file mode 100644 index b146d2bab..000000000 --- a/src/test/resources/features/path_initialisation.feature +++ /dev/null @@ -1,39 +0,0 @@ -Feature: Path Initialisation - - Background: - Given the internet is reachable - And an initialised environment - - Scenario: sdkman is initialised for the first time - Given the candidate "grails" version "2.1.0" is already installed and default - And the system is bootstrapped - When I enter "echo $PATH" - Then I see a single occurrence of "grails" - - Scenario: sdkman is initialised a subsequent time - Given the candidate "grails" version "2.1.0" is already installed and default - And the system is bootstrapped - And the system is bootstrapped again - And I enter "echo $PATH" - Then I see a single occurrence of "grails" - - Scenario: sdkman is initialised without candidates - Given the system is bootstrapped - When I enter "echo $PATH" - Then I see no occurrences of "grails" - - Scenario: Install a candidate and see it on the PATH - And the candidate "grails" version "2.1.0" is available for download - And the system is bootstrapped - And I enter "sdk install grails 2.1.0" and answer "Y" - When I enter "echo $PATH" - Then I see a single occurrence of "grails" - - Scenario: Install multiple candidate versions and see it once on the PATH - Given the candidate "grails" version "1.3.9" is available for download - And the candidate "grails" version "2.1.0" is available for download - And the system is bootstrapped - And I enter "sdk install grails 1.3.9" and answer "Y" - And I enter "sdk install grails 2.1.0" and answer "Y" - When I enter "echo $PATH" - Then I see a single occurrence of "grails" diff --git a/src/test/resources/features/per_project_configuration.feature b/src/test/resources/features/per_project_configuration.feature deleted file mode 100644 index d932fb785..000000000 --- a/src/test/resources/features/per_project_configuration.feature +++ /dev/null @@ -1,69 +0,0 @@ -Feature: Per-project configuration - - Background: - Given the internet is reachable - And an initialised environment - - Scenario: An sdkman project configuration is generated - Given the system is bootstrapped - When I enter "sdk env init" - Then I see ".sdkmanrc created." - - Scenario: The env command is issued without an sdkman project configuration present - Given the system is bootstrapped - When I enter "sdk env" - Then I see "Could not find .sdkmanrc in the current directory." - And I see "Run 'sdk env init' to create it." - And the exit code is 1 - - Scenario: The env command is issued with an sdkman project configuration present - Given the file ".sdkmanrc" exists and contains "groovy=2.4.1" - And the candidate "groovy" version "2.0.5" is already installed and default - And the candidate "groovy" version "2.4.1" is a valid candidate version - And the candidate "groovy" version "2.4.1" is already installed but not default - And the system is bootstrapped - When I enter "sdk env" - Then I see "Using groovy version 2.4.1 in this shell." - And the candidate "groovy" version "2.4.1" should be in use - And the candidate "groovy" version "2.0.5" should be the default - - Scenario: The env install subcommand is issued with an sdkman project configuration present - Given the system is bootstrapped - And the file ".sdkmanrc" exists and contains "groovy=2.4.1" - And the candidate "groovy" version "2.0.5" is already installed and default - And the candidate "groovy" version "2.4.1" is available for download - When I enter "sdk env install" - Then I see "Done installing!" - And the candidate "groovy" version "2.4.1" is installed - And the candidate "groovy" version "2.4.1" is in use - And the candidate "groovy" version "2.0.5" should be the default - - Scenario: The env install subcommand is issued without an sdkman project configuration present - Given the system is bootstrapped - When I enter "sdk env install" - Then I see "Could not find .sdkmanrc in the current directory." - And I see "Run 'sdk env init' to create it." - And the exit code is 1 - - Scenario: The env clear subcommand is issued without an active project configuration - Given the system is bootstrapped - When I enter "sdk env clear" - Then I see "No environment currently set!" - And the exit code is 1 - - Scenario: The env clear subcommand is issued and the active project configuration is missing - Given the system is bootstrapped - And a project configuration is active but points to a directory without configuration - When I enter "sdk env clear" - Then I see "Could not find" - And the exit code is 1 - - Scenario: The current project configuration is cleared and the default versions restored - Given the file ".sdkmanrc" exists and contains "groovy=2.0.5" - And the candidate "groovy" version "2.4.1" is already installed and default - And the candidate "groovy" version "2.0.5" is in use - And the system is bootstrapped - And a project configuration is active - When I enter "sdk env clear" - Then I see "Restored groovy version to 2.4.1 (default)" - And the candidate "groovy" version "2.4.1" should be in use diff --git a/src/test/resources/features/self_update.feature b/src/test/resources/features/self_update.feature deleted file mode 100644 index 1d0ef7bc2..000000000 --- a/src/test/resources/features/self_update.feature +++ /dev/null @@ -1,34 +0,0 @@ -Feature: Self Update - - Background: - Given the internet is reachable - And the sdkman scripts version is "5.0.0" - And the sdkman native version is "0.0.1" - And an initialised environment - And the system is bootstrapped - And an available selfupdate endpoint - - Scenario: Attempt Self Update with out dated scripts components - Given the sdkman script version "6.0.0" is available for download - And the sdkman native version "0.0.1" is available for download - When I enter "sdk selfupdate" - Then I see "Successfully upgraded SDKMAN." - - Scenario: Attempt Self Update with out dated native components - Given the sdkman script version "5.0.0" is available for download - And the sdkman native version "0.0.2" is available for download - When I enter "sdk selfupdate" - Then I see "Successfully upgraded SDKMAN." - - Scenario: Attempt Self Update on an up to date system - Given the sdkman script version "5.0.0" is available for download - And the sdkman native version "0.0.1" is available for download - When I enter "sdk selfupdate" - Then I see "No update available at this time." - - Scenario: Force Self Update on an up to date system - Given the sdkman script version "5.0.0" is available for download - And the sdkman native version "0.0.1" is available for download - When I enter "sdk selfupdate force" - Then I see "Successfully upgraded SDKMAN." - \ No newline at end of file diff --git a/src/test/resources/features/service_unavailable.feature b/src/test/resources/features/service_unavailable.feature deleted file mode 100644 index 98289803f..000000000 --- a/src/test/resources/features/service_unavailable.feature +++ /dev/null @@ -1,127 +0,0 @@ -Feature: Service Unavailable - - Background: - Given the internet is not reachable - And an initialised environment - - # list commands - - Scenario: List candidate versions found while Offline - Given the candidate "grails" version "2.1.0" is already installed and default - And the candidate "grails" version "1.3.9" is already installed but not default - And the system is bootstrapped - When I enter "sdk list grails" - Then I see "Offline: only showing installed grails versions" - And I see "> 2.1.0" - And I see "* 1.3.9" - - Scenario: List candidate versions not found while Offline - Given the system is bootstrapped - When I enter "sdk list grails" - Then I see "Offline: only showing installed grails versions" - And I see "None installed!" - - Scenario: List Available Candidates while Offline - Given the system is bootstrapped - When I enter "sdk list" - Then I see "This command is not available while offline." - - # use command - - Scenario: Use an installed candidate version while Offline - Given the candidate "grails" version "2.1.0" is already installed and default - And the candidate "grails" version "1.3.9" is already installed but not default - And the system is bootstrapped - When I enter "sdk use grails 1.3.9" - Then I see "Using grails version 1.3.9 in this shell." - - # default command - - Scenario: Set the default to an uninstalled candidate version while Offline - Given the candidate "grails" version "1.3.9" is already installed and default - And the system is bootstrapped - When I enter "sdk default grails 2.1.0" - Then I see "Stop! grails 2.1.0 is not available while offline." - - Scenario: Set the default to an invalid candidate version while Offline - Given the candidate "grails" version "1.3.9" is already installed and default - And the system is bootstrapped - When I enter "sdk default grails 999" - Then I see "Stop! grails 999 is not available while offline." - - Scenario: Set the default to an installed candidate version while Offline - Given the candidate "grails" version "2.1.0" is already installed and default - And the candidate "grails" version "1.3.9" is already installed but not default - And the system is bootstrapped - When I enter "sdk default grails 1.3.9" - Then I see "Default grails version set to 1.3.9" - - # install command - - Scenario: Install a candidate version that is not installed while Offline - Given the candidate "grails" version "2.1.0" is not installed - And the system is bootstrapped - When I enter "sdk install grails 2.1.0" - Then I see "Stop! grails 2.1.0 is not available while offline." - - Scenario: Install a candidate version that is already installed while Offline - Given the candidate "grails" version "2.1.0" is already installed and default - And the system is bootstrapped - When I enter "sdk install grails 2.1.0" - Then I see "grails 2.1.0 is already installed." - And the exit code is 0 - - # uninstall command - - Scenario: Uninstall a candidate version while Offline - Given the candidate "grails" version "2.1.0" is already installed and default - And the system is bootstrapped - When I enter "sdk uninstall grails 2.1.0" - Then I see "Deselecting grails 2.1.0..." - And I see "Uninstalling grails 2.1.0..." - And the candidate "grails" version "2.1.0" is not in use - And the candidate "grails" version "2.1.0" is not installed - - Scenario: Uninstall a candidate version that is not installed while Offline - Given the candidate "grails" version "2.1.0" is not installed - And the system is bootstrapped - When I enter "sdk uninstall grails 2.1.0" - Then I see "grails 2.1.0 is not installed." - - # current command - - Scenario: Display the current version of a candidate while Offline - Given the candidate "grails" version "2.1.0" is already installed and default - And the system is bootstrapped - When I enter "sdk current grails" - Then I see "Using grails version 2.1.0" - - Scenario: Display the current version of all candidates while Offline - Given the candidate "grails" version "2.1.0" is already installed and default - And the candidate "groovy" version "2.0.5" is already installed and default - And the system is bootstrapped - When I enter "sdk current" - Then I see "Using:" - And I see "grails: 2.1.0" - And I see "groovy: 2.0.5" - - # version command - - Scenario: Determine the sdkman version when Offline - Given the system is bootstrapped - When I enter "sdk version" - Then I see the current sdkman version - - # help command - - Scenario: Request help while Offline - Given the system is bootstrapped - When I enter "sdk help" - Then I see "Usage: sdk [candidate] [version]" - - # selfupdate command - - Scenario: Attempt self-update while Offline - Given the system is bootstrapped - When I enter "sdk selfupdate" - Then I see "This command is not available while offline." diff --git a/src/test/resources/features/uninstall_candidate.feature b/src/test/resources/features/uninstall_candidate.feature deleted file mode 100644 index aea833a1c..000000000 --- a/src/test/resources/features/uninstall_candidate.feature +++ /dev/null @@ -1,43 +0,0 @@ -Feature: Uninstall Candidate - - Background: - Given the internet is reachable - And an initialised environment - - Scenario: Uninstall an installed Candidate Version not in use - Given the candidate "grails" version "2.1.0" is already installed but not default - And the system is bootstrapped - When I enter "sdk uninstall grails 2.1.0" - Then I do not see "Deselecting grails 2.1.0" - Then I see "Uninstalling grails 2.1.0" - And the candidate "grails" version "2.1.0" is not installed - - Scenario: Uninstall a Candidate Version in use - Given the candidate "grails" version "2.1.0" is already installed and default - And the system is bootstrapped - When I enter "sdk uninstall grails 2.1.0" - Then I see "Deselecting grails 2.1.0" - And I see "Uninstalling grails 2.1.0" - And the candidate "grails" version "2.1.0" is not installed - And the candidate "grails" is no longer selected - - Scenario: Attempt uninstalling a Candidate Version that is not installed - Given the candidate "grails" version "1.3.9" is not installed - And the system is bootstrapped - When I enter "sdk uninstall grails 1.3.9" - Then I see "grails 1.3.9 is not installed." - - Scenario: Attempt uninstalling with no Candidate specified - Given the system is bootstrapped - When I enter "sdk uninstall" - Then I see "No candidate provided." - - Scenario: Attempt uninstalling with an invalid Candidate specified - Given the system is bootstrapped - When I enter "sdk uninstall groffle" - Then I see "Stop! groffle is not a valid candidate." - - Scenario: Attempt uninstalling without a version provided - Given the system is bootstrapped - When I enter "sdk uninstall grails" - Then I see "No candidate version provided." diff --git a/src/test/resources/features/update.feature b/src/test/resources/features/update.feature deleted file mode 100644 index a90725edc..000000000 --- a/src/test/resources/features/update.feature +++ /dev/null @@ -1,52 +0,0 @@ -Feature: Update - - Background: - Given the internet is reachable - And the following candidates are available for installation in local cache: - | candidate | - | activator | - | groovy | - | scala | - And an initialised environment - And the system is bootstrapped - - Scenario: A new candidate is available - And the following candidates are currently available from remote API: - | candidate | - | activator | - | groovy | - | kotlin | - | scala | - When I enter "sdk update" - Then I see "Adding new candidates(s): kotlin" - And the Candidates cache should contain "activator,groovy,kotlin,scala" - - Scenario: A candidate has been removed - And the following candidates are currently available from remote API: - | candidate | - | groovy | - | scala | - When I enter "sdk update" - Then I see "Removing obsolete candidates(s): activator" - And the Candidates cache should contain "groovy,scala" - - Scenario: A new candidate is available and a candidate has been removed - And the following candidates are currently available from remote API: - | candidate | - | groovy | - | kotlin | - | scala | - When I enter "sdk update" - Then I see "Removing obsolete candidates(s): activator" - And I see "Adding new candidates(s): kotlin" - And the Candidates cache should contain "groovy,kotlin,scala" - - Scenario: No new candidate is available - And the following candidates are currently available from remote API: - | candidate | - | activator | - | groovy | - | scala | - When I enter "sdk update" - Then I see "No new candidates found at this time." - And the Candidates cache should contain "activator,groovy,scala" diff --git a/src/test/resources/features/upgrade_candidate.feature b/src/test/resources/features/upgrade_candidate.feature deleted file mode 100644 index baec6ef9f..000000000 --- a/src/test/resources/features/upgrade_candidate.feature +++ /dev/null @@ -1,130 +0,0 @@ -Feature: Upgrade Candidate - - Background: - Given the internet is reachable - And the candidates cache is initialised with "grails" - And an initialised environment - - Scenario: Display upgradable candidate version in use when it is upgradable - Given the candidate "grails" version "1.3.9" is already installed and default - And the default "grails" version is "2.4.4" - And the system is bootstrapped - When I enter "sdk upgrade grails" and answer "n" - Then I see "Available defaults:" - And I see "grails (local: 1.3.9; default: 2.4.4)" - - Scenario: Display upgradable candidate version in use when it is not upgradable - Given the candidate "grails" version "1.3.9" is already installed and default - And the default "grails" version is "1.3.9" - And the system is bootstrapped - When I enter "sdk upgrade grails" - Then I see "grails is up-to-date" - - Scenario: Display upgradable candidate version when none is in use - Given the candidate "grails" does not exist locally - And the system is bootstrapped - When I enter "sdk upgrade grails" - Then I see "Not using any version of grails" - - Scenario: Display upgradable candidate versions when none is specified and none is in use - Given the candidate "grails" does not exist locally - And the system is bootstrapped - When I enter "sdk upgrade" - Then I see "No candidates are in use" - - Scenario: Display upgradable candidate versions when none is specified and one is in use - Given the candidate "grails" version "1.3.9" is already installed and default - And the default "grails" version is "2.4.4" - And the system is bootstrapped - When I enter "sdk upgrade" and answer "n" - Then I see "Available defaults:" - And I see "grails (local: 1.3.9; default: 2.4.4)" - - Scenario: Display upgradable candidate versions when none is specified and multiple are in use - Given the candidate "grails" version "1.3.9" is already installed and default - And the default "grails" version is "2.4.4" - And the candidate "groovy" version "2.0.5" is already installed and default - And the default "groovy" version is "2.4.1" - And the system is bootstrapped - When I enter "sdk upgrade" and answer "n" - Then I see "Available defaults:" - And I see "grails (local: 1.3.9; default: 2.4.4)" - And I see "groovy (local: 2.0.5; default: 2.4.1)" - - Scenario: Display upgradable candidate versions when none specified and multiple in use but not upgradable - Given the candidate "grails" version "1.3.9" is already installed and default - And the default "grails" version is "1.3.9" - And the candidate "groovy" version "2.0.5" is already installed and default - And the default "groovy" version is "2.0.5" - And the system is bootstrapped - When I enter "sdk upgrade" - Then I see "All candidates are up-to-date" - - Scenario: Update all upgradable candidates versions and set them as default - Given the candidate "grails" version "1.3.9" is already installed and default - And the default "grails" version is "2.1.0" - And the candidate "grails" version "2.1.0" is available for download - And the candidate "groovy" version "2.0.5" is already installed and default - And the default "groovy" version is "2.4.1" - And the candidate "groovy" version "2.4.1" is available for download - And the system is bootstrapped - When I enter "sdk upgrade" and answer "Y" - Then I see "Available defaults:" - And I see "grails (local: 1.3.9; default: 2.1.0)" - And I see "groovy (local: 2.0.5; default: 2.4.1)" - And I see "Use prescribed default version(s)? (Y/n)" - And I do not see "Do you want grails 2.1.0 to be set as default? (Y/n)" - And I see "Setting grails 2.1.0 as default." - And I do not see "Do you want groovy 2.4.1 to be set as default? (Y/n)" - And I see "Setting groovy 2.4.1 as default." - Then the candidate "grails" version "2.1.0" should be the default - And the candidate "groovy" version "2.4.1" should be the default - - Scenario: Don't update all upgradable candidates versions and set them as default - Given the candidate "grails" version "1.3.9" is already installed and default - And the default "grails" version is "2.1.0" - And the candidate "grails" version "2.1.0" is available for download - And the system is bootstrapped - When I enter "sdk upgrade" and answer "N" - Then I see "Available defaults:" - And I see "grails (local: 1.3.9; default: 2.1.0)" - And I see "Use prescribed default version(s)? (Y/n)" - Then the candidate "grails" version "1.3.9" should be the default - - Scenario: Update upgradable candidate version and set it as default - Given the candidate "grails" version "1.3.9" is already installed and default - And the default "grails" version is "2.1.0" - And the candidate "grails" version "2.1.0" is available for download - And the system is bootstrapped - When I enter "sdk upgrade grails" and answer "Y" - Then I see "Available defaults:" - And I see "grails (local: 1.3.9; default: 2.1.0)" - And I see "Use prescribed default version(s)? (Y/n): " - And I do not see "Do you want grails 2.1.0 to be set as default? (Y/n)" - And I see "Setting grails 2.1.0 as default." - Then the candidate "grails" version "2.1.0" should be the default - - Scenario: Update upgradable candidate version and auto-answer to make it default - Given the candidate "grails" version "1.3.9" is already installed and default - And the default "grails" version is "2.1.0" - And the candidate "grails" version "2.1.0" is available for download - And I have configured "sdkman_auto_answer" to "true" - And the system is bootstrapped - When I enter "sdk upgrade grails" - Then I see "Available defaults:" - And I see "grails (local: 1.3.9; default: 2.1.0)" - And I do not see "Use prescribed default version(s)? (Y/n): " - And I do not see "Do you want grails 2.1.0 to be set as default? (Y/n)" - And I see "Setting grails 2.1.0 as default." - Then the candidate "grails" version "2.1.0" should be the default - - Scenario: Don't update upgradable candidate version and set it as default - Given the candidate "grails" version "1.3.9" is already installed and default - And the default "grails" version is "2.1.0" - And the candidate "grails" version "2.1.0" is available for download - And the system is bootstrapped - When I enter "sdk upgrade grails" and answer "N" - Then I see "Available defaults:" - And I see "grails (local: 1.3.9; default: 2.1.0)" - And I see "Use prescribed default version(s)? (Y/n)" - Then the candidate "grails" version "1.3.9" should be the default