# HG changeset patch # User rfield # Date 1519331161 28800 # Node ID 3390b463d7a205d0b95eed3d9ca1c97028a8aea9 # Parent 20358c9f72c19c89d8bdea9491f1949d84169fe8 8176474: test/jdk/jshell/JdiBogusHostListenExecutionControlTest.java fails with java.net.BindException Reviewed-by: jlahoda diff -r 20358c9f72c1 -r 3390b463d7a2 test/langtools/jdk/jshell/JdiBogusHostListenExecutionControlTest.java --- a/test/langtools/jdk/jshell/JdiBogusHostListenExecutionControlTest.java Thu Feb 22 18:53:28 2018 +0100 +++ b/test/langtools/jdk/jshell/JdiBogusHostListenExecutionControlTest.java Thu Feb 22 12:26:01 2018 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 8169519 8168615 + * @bug 8169519 8168615 8176474 * @summary Tests for JDI connector failure * @modules jdk.jshell/jdk.jshell jdk.jshell/jdk.jshell.spi jdk.jshell/jdk.jshell.execution * @run testng JdiBogusHostListenExecutionControlTest @@ -40,7 +40,9 @@ public class JdiBogusHostListenExecutionControlTest { private static final String EXPECTED_ERROR = - "Launching JShell execution engine threw: Failed remote listen: java.net.SocketException: Unresolved address @ com.sun.jdi.SocketListe"; + "Launching JShell execution engine threw: Failed remote listen:"; + private static final String EXPECTED_LOCATION = + "@ com.sun.jdi.SocketListen"; public void badOptionListenTest() { try { @@ -50,7 +52,10 @@ .executionEngine("jdi:hostname(BattyRumbleBuckets-Snurfle-99-Blip)") .build(); } catch (IllegalStateException ex) { - assertTrue(ex.getMessage().startsWith(EXPECTED_ERROR), ex.getMessage()); + assertTrue(ex.getMessage().startsWith(EXPECTED_ERROR), + ex.getMessage() + "\nExpected: " + EXPECTED_ERROR); + assertTrue(ex.getMessage().contains(EXPECTED_LOCATION), + ex.getMessage() + "\nExpected: " + EXPECTED_LOCATION); return; } fail("Expected IllegalStateException");