3909N/A * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * @summary Change default DNS caching behavior for code not running under 3406N/A * @run main/othervm/timeout=200 -Dsun.net.inetaddr.ttl=20 -Dsun.net.spi.nameservice.provider.1=simple,sun DefaultCaching 0N/A // name service needs to resolve this. 0N/A test (
"theclub",
"129.156.220.219",
true);
// lk: 1 0N/A test (
"luster",
"1.16.20.2",
false);
// lk: 2 0N/A // name service now needs to know about luster 0N/A test (
"luster",
"1.16.20.2",
false);
// lk: 2 0N/A test(
"luster",
"10.5.18.21",
true,
3);
// lk: 3 0N/A test (
"theclub",
"129.156.220.219",
true,
3);
0N/A test (
"luster",
"10.5.18.21",
true,
3);
0N/A test (
"bar",
"10.5.18.22",
false,
4);
0N/A test (
"foo",
"10.5.18.22",
true,
5);
0N/A // now delay to see if theclub has expired 0N/A test (
"foo",
"10.5.18.22",
true,
5);
0N/A test (
"theclub",
"129.156.220.1",
true,
6);
0N/A // now see if luster has expired 0N/A test (
"luster",
"10.5.18.21",
true,
7);
0N/A test (
"theclub",
"129.156.220.1",
true,
7);
0N/A // now delay to see if 3rd has expired 0N/A test (
"theclub",
"129.156.220.1",
true,
8);
0N/A test (
"luster",
"10.5.18.21",
true,
8);
0N/A test (
"foo",
"10.5.18.22",
true,
9);
0N/A /* throws RuntimeException if it fails */