You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2006/07/26 13:23:47 UTC
svn commit: r425705 -
/lenya/trunk/src/impl/test/org/apache/lenya/net/InetAddressUtilTest.java
Author: andreas
Date: Wed Jul 26 04:23:46 2006
New Revision: 425705
URL: http://svn.apache.org/viewvc?rev=425705&view=rev
Log:
Throw exception instead of System.out when InetAddressUtilTest has errors
Modified:
lenya/trunk/src/impl/test/org/apache/lenya/net/InetAddressUtilTest.java
Modified: lenya/trunk/src/impl/test/org/apache/lenya/net/InetAddressUtilTest.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/impl/test/org/apache/lenya/net/InetAddressUtilTest.java?rev=425705&r1=425704&r2=425705&view=diff
==============================================================================
--- lenya/trunk/src/impl/test/org/apache/lenya/net/InetAddressUtilTest.java (original)
+++ lenya/trunk/src/impl/test/org/apache/lenya/net/InetAddressUtilTest.java Wed Jul 26 04:23:46 2006
@@ -1,21 +1,22 @@
/*
-* Copyright 1999-2004 The Apache Software Foundation
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright 1999-2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.lenya.net;
import java.net.InetAddress;
+import java.net.UnknownHostException;
import junit.framework.TestCase;
@@ -23,23 +24,19 @@
* Inet address util test
*/
public class InetAddressUtilTest extends TestCase {
-
- public void testInetAddressUtil() {
-
+
+ public void testInetAddressUtil() throws UnknownHostException {
+
String[] args = { "195.226.6.64", "255.255.255.0", "195.226.6.70" };
-
+
if (args.length != 3) {
System.out.println("Usage: InetAddressUtilTest network subnet ip");
return;
}
- try {
- InetAddress network = InetAddress.getByName(args[0]); // "195.226.6.64");
- InetAddress subnet = InetAddress.getByName(args[1]); // "255.255.255.0");
- InetAddress ip = InetAddress.getByName(args[2]); // "195.226.6.70");
- System.out.println(InetAddressUtil.contains(network, subnet, ip));
- } catch(Exception e) {
- System.err.println(e);
- }
+ InetAddress network = InetAddress.getByName(args[0]); // "195.226.6.64");
+ InetAddress subnet = InetAddress.getByName(args[1]); // "255.255.255.0");
+ InetAddress ip = InetAddress.getByName(args[2]); // "195.226.6.70");
+ System.out.println(InetAddressUtil.contains(network, subnet, ip));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org