/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
* @bug 4451522 4460484
* @summary URI and URL getHost() methods don't comform to RFC 2732
*/
// Run in othervm because the tests sets a SecurityManager
public class TestIPv6Addresses {
try {
// testing InetAddress static constructors
throw new RuntimeException("InetAddress.getByName failed for"+
"literal IPv6 addresses");
}
// testing URL constructor, getHost and getAuthority
throw new RuntimeException("URL constructor failed for"+
"literal IPv6 addresses");
}
throw new RuntimeException("URL.getHost() failed for"+
"literal IPv6 addresses");
}
throw new RuntimeException("URL.getAuthority() failed for"+
"literal IPv6 addresses");
}
// need to test URI as well
// testing SocketPermission to see whether it handles unambiguous cases
// testing getIP and getHost etc
throw new RuntimeException("SocketPermission implies doesn't work"+
" for literal IPv6 addresses");
}
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
// bug 4460484
try {
} catch (UnknownHostException e) {
// expected
}
try {
// expected
} catch (UnknownHostException e) {
// expected
}
}
}