Cross Reference: IiopUrlIPv6.java
xref
: /
openjdk7
/
jdk
/
test
/
com
/
sun
/
jndi
/
cosnaming
/
IiopUrlIPv6.java
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
IiopUrlIPv6.java revision 0
0
N/A
/* @test
0
N/A
* @bug 5042453
0
N/A
* @summary Ipv6 address throws Non-numeric port number error
0
N/A
*/
0
N/A
0
N/A
import
com
.
sun
.
jndi
.
cosnaming
.*;
0
N/A
import
com
.
sun
.
jndi
.
cosnaming
.
IiopUrl
.
Address
;
0
N/A
import
java
.
util
.*;
0
N/A
import
java
.
net
.
MalformedURLException
;
0
N/A
0
N/A
public
class
IiopUrlIPv6
{
0
N/A
0
N/A
public
static
void
main
(
String
[]
args
) {
0
N/A
0
N/A
String
[]
urls
= {
"iiop://[::1]:2809"
,
0
N/A
"iiop://[::1]"
,
0
N/A
"iiop://:2890"
,
0
N/A
"iiop://129.158.2.2:80"
0
N/A
};
0
N/A
0
N/A
for
(
int
u =
0
; u <
urls
.
length
; u++) {
0
N/A
try
{
0
N/A
IiopUrl
url
=
new
IiopUrl
(
urls
[u]);
0
N/A
Vector
addrs
=
url
.
getAddresses
();
0
N/A
0
N/A
for
(
int
i =
0
; i <
addrs
.
size
(); i++) {
0
N/A
Address
addr
= (
Address
)
addrs
.
elementAt
(i);
0
N/A
System
.
out
.
println
(
"================"
);
0
N/A
System
.
out
.
println
(
"url: "
+
urls
[u]);
0
N/A
System
.
out
.
println
(
"host: "
+
addr
.
host
);
0
N/A
System
.
out
.
println
(
"port: "
+
addr
.
port
);
0
N/A
System
.
out
.
println
(
"version: "
+
addr
.
major
0
N/A
+
" "
+
addr
.
minor
);
0
N/A
}
0
N/A
}
catch
(
MalformedURLException
e) {
0
N/A
e.
printStackTrace
();
0
N/A
}
0
N/A
}
0
N/A
}
0
N/A
}