-
Notifications
You must be signed in to change notification settings - Fork 66
#1869: Improve windows helper to search windows registry #1876
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
Open
jakozian
wants to merge
12
commits into
devonfw:main
Choose a base branch
from
jakozian:feature/#1869-improve-windows-helper-to-search-windows-registry
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
faa6b1b
#1869: Extract process of running reg into private method
jakozian 53fff3f
#1869: Extend WindowsHelper interface with methods to retrieve entrie…
jakozian d123088
#1869: Add interface methods to WindowsHelperImpl
jakozian 7c8f432
#1869: Add interface methods to WindowsHelperMock
jakozian 9693b95
#1869: Add test-seam class to simulate running of reg.exe command
jakozian ccb14d3
#1869: Add tests for WindowsHelperImpl
jakozian 8b4d51d
Update cli/src/main/java/com/devonfw/tools/ide/os/WindowsHelperImpl.java
jakozian a35910b
#1869: Replace string with constant
jakozian 68e09fc
Merge branch 'main' of https://github.com/devonfw/IDEasy into feature…
jakozian 6ed1306
#1869: Change display name to display version
jakozian 2d40318
#1869: Change search to find exact path first and the keys in this path
jakozian e05473a
#1870: Fix mock logic of runReg
jakozian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
cli/src/test/java/com/devonfw/tools/ide/os/WindowsHelperImplTestable.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| package com.devonfw.tools.ide.os; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import com.devonfw.tools.ide.context.IdeContext; | ||
|
|
||
| /** | ||
| * Test-specific subclass of {@link WindowsHelperImpl}. | ||
| * | ||
| * <p> | ||
| * Mainly used as a test seam to simulate the reg.exe command for test purposes. | ||
| * </p> | ||
| */ | ||
| public class WindowsHelperImplTestable extends WindowsHelperImpl { | ||
|
|
||
| /** | ||
| * The constructor. | ||
| * | ||
| * @param context the {@link IdeContext}. | ||
| */ | ||
| public WindowsHelperImplTestable(IdeContext context) { | ||
|
|
||
| super(context); | ||
| } | ||
|
|
||
| @Override | ||
| protected List<String> runReg(String... args) { | ||
|
jakozian marked this conversation as resolved.
|
||
|
|
||
| // simulate reg.exe filtering: "/f <appName>" | ||
| String searchValue = null; | ||
| for (int i = 0; i < args.length - 1; i++) { | ||
| if ("/f".equalsIgnoreCase(args[i])) { | ||
| searchValue = args[i + 1]; | ||
| break; | ||
| } | ||
| } | ||
| if (!"TestApp".equalsIgnoreCase(searchValue)) { | ||
| return List.of(); | ||
| } | ||
| return List.of( | ||
| "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\TestApp", | ||
| " DisplayName REG_SZ Test Application", | ||
| " DisplayIcon REG_SZ C:\\Program Files\\TestApp\\testapp.exe,0", | ||
| " InstallLocation REG_SZ C:\\Program Files\\TestApp", | ||
| " UninstallString REG_SZ \"C:\\Program Files\\TestApp\\uninstall.exe\"" | ||
| ); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.