7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @summary NOT A TEST. Captures the network interface configuration.
27 * @library /lib/testlibrary
28 * @build jdk.testlibrary.NetworkConfiguration
29 * @run main NetworkConfigurationProbe
30 */
31
32 import java.net.Inet4Address;
33 import java.net.Inet6Address;
34 import java.net.NetworkInterface;
35 import jdk.testlibrary.NetworkConfiguration;
36 import static java.util.stream.Collectors.joining;
37 import static java.lang.System.out;
38
39 /**
40 * Not a test. Captures the network interface configuration.
41 */
42 public class NetworkConfigurationProbe {
43
44 public static void main(String... args) throws Exception {
45 NetworkConfiguration.printSystemConfiguration(out);
46
47 NetworkConfiguration nc = NetworkConfiguration.probe();
48 String list;
49 list = nc.ip4MulticastInterfaces()
50 .map(NetworkInterface::getName)
51 .collect(joining(" "));
52 out.println("ip4MulticastInterfaces: " + list);
53
54 list = nc.ip4Addresses()
55 .map(Inet4Address::toString)
|
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @summary NOT A TEST. Captures the network interface configuration.
27 * @library /test/lib
28 * @run main NetworkConfigurationProbe
29 */
30
31 import java.net.Inet4Address;
32 import java.net.Inet6Address;
33 import java.net.NetworkInterface;
34 import jdk.test.lib.NetworkConfiguration;
35 import static java.util.stream.Collectors.joining;
36 import static java.lang.System.out;
37
38 /**
39 * Not a test. Captures the network interface configuration.
40 */
41 public class NetworkConfigurationProbe {
42
43 public static void main(String... args) throws Exception {
44 NetworkConfiguration.printSystemConfiguration(out);
45
46 NetworkConfiguration nc = NetworkConfiguration.probe();
47 String list;
48 list = nc.ip4MulticastInterfaces()
49 .map(NetworkInterface::getName)
50 .collect(joining(" "));
51 out.println("ip4MulticastInterfaces: " + list);
52
53 list = nc.ip4Addresses()
54 .map(Inet4Address::toString)
|