-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8279995: jpackage --add-launcher option should allow overriding description #7399
Changes from 4 commits
a764be5
dbb3690
c5fea59
6d4b4d3
401db24
e4893e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. | ||
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
|
@@ -40,7 +40,7 @@ | |
* AddLauncherTest*.* installer. The output installer should provide the | ||
* same functionality as the default installer (see description of the default | ||
* installer in SimplePackageTest.java) plus install three extra application | ||
* launchers. | ||
* launchers with unique description ("LauncherName Description"). | ||
*/ | ||
|
||
/* | ||
|
@@ -80,7 +80,8 @@ public void test() { | |
PackageTest packageTest = new PackageTest().configureHelloApp(); | ||
packageTest.addInitializer(cmd -> { | ||
cmd.addArguments("--arguments", "Duke", "--arguments", "is", | ||
"--arguments", "the", "--arguments", "King"); | ||
"--arguments", "the", "--arguments", "King", | ||
"--description", "AddLauncherTest Description"); | ||
}); | ||
|
||
new FileAssociations( | ||
|
@@ -89,14 +90,17 @@ public void test() { | |
|
||
new AdditionalLauncher("Baz2") | ||
.setDefaultArguments() | ||
.addRawProperties(Map.entry("description", "Baz2 Description")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How expected description is verified in the test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not think that we have ability to check description on executable files. I added it for manual verification. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Powershell can be used to extract the description from an executable. E.g.:
You can create jdk.jpackage.test.AdditionalLauncher.verifyDescription() function that will call this script and call this function from jdk.jpackage.test.AdditionalLauncher.verify(). |
||
.applyTo(packageTest); | ||
|
||
new AdditionalLauncher("foo") | ||
.setDefaultArguments("yep!") | ||
.addRawProperties(Map.entry("description", "foo Description")) | ||
.applyTo(packageTest); | ||
|
||
new AdditionalLauncher("Bar") | ||
.setDefaultArguments("one", "two", "three") | ||
.addRawProperties(Map.entry("description", "Bar Description")) | ||
.setIcon(GOLDEN_ICON) | ||
.applyTo(packageTest); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this:
Added
Executor.dumpOutput()
call to save the output of powershell command in the test log for easier debugging.No null initialized
description
variable. No iteration over the list using the index. Check for the end of the output.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Except I removed if (lineIt.hasNext()) { throw new RuntimeException("Unexpected input"); }, since there are empty lines after description in output and this check triggers exception.