Skip to content

Commit

Permalink
For z/OS, set attach.enable=yes running testJpsSanity
Browse files Browse the repository at this point in the history
Allow jps utility to be visible to itself on zOS, like other platforms.

On z/OS running `jps` doesn't show itself running since attach API is
disabled by default, while running
`jps -J-Dcom.ibm.tools.attach.enable=yes` works like other platforms and
shows output like `83886940 Jps`. testJpsSanity expects to find jps in
the output.

[ci skip]

Signed-off-by: Peter Shipton <Peter_Shipton@ca.ibm.com>
  • Loading branch information
pshipton committed Nov 27, 2020
1 parent bf729d3 commit acac3d6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public class TestJps extends AttachApiTest {
public void testJpsSanity() throws IOException {
TargetManager tgtMgr = new TargetManager(TARGET_VM_CLASS, null);
assertTrue(CHILD_PROCESS_DID_NOT_LAUNCH, tgtMgr.syncWithTarget());
List<String> jpsOutput = runCommand();
// Allow jps to be attached on z/OS, like other platforms
List<String> jpsOutput = runCommand(Collections.singletonList("-J-Dcom.ibm.tools.attach.enable=yes"));
assertTrue(TEST_PROCESS_ID_MISSING, StringUtilities.searchSubstring(vmId, jpsOutput).isPresent());
assertTrue("jps is missing", StringUtilities.searchSubstring(JPS_Class, jpsOutput).isPresent()); //$NON-NLS-1$
assertTrue(CHILD_IS_MISSING, StringUtilities.searchSubstring(tgtMgr.targetId, jpsOutput).isPresent());
Expand Down

0 comments on commit acac3d6

Please sign in to comment.