[openrtm-commit:02441] r946 - in branches/RELENG_1_2/OpenRTM-aist-Java: . jp.go.aist.rtm.RTC jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 2月 14日 (火) 16:19:32 JST
Author: kawauchi
Date: 2017-02-14 16:19:32 +0900 (Tue, 14 Feb 2017)
New Revision: 946
Added:
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/etc/
Modified:
branches/RELENG_1_2/OpenRTM-aist-Java/
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/StringUtilTests.java
Log:
[merge] r929-930 have been merged from trunk.
Property changes on: branches/RELENG_1_2/OpenRTM-aist-Java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/RELENG_1_1/OpenRTM-aist-Java:806
+ /branches/RELENG_1_1/OpenRTM-aist-Java:806
/trunk/OpenRTM-aist-Java:929-930
Property changes on: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/RELENG_1_0/jp.go.aist.rtm.RTC:408-498
/branches/RELENG_1_0_0/jp.go.aist.rtm.RTC:60-401
/branches/RELENG_1_1/OpenRTM-aist-Java/jp.go.aist.rtm.RTC:806
/branches/work/ConfigurationCallback/jp.go.aist.rtm.RTC:631-635
/branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC:648-660
/branches/work/ForComponentActionListener/jp.go.aist.rtm.RTC:521-522
/branches/work/ForComponentObserverConsumer/jp.go.aist.rtm.RTC:534-543
/branches/work/ForConfigurationListener/jp.go.aist.rtm.RTC:524-526
/branches/work/ForFileNameservice/jp.go.aist.rtm.RTC:623-628
/branches/work/ForLogFormat/jp.go.aist.rtm.RTC:518-519
/branches/work/ForPortConnectListener/jp.go.aist.rtm.RTC:528-532
/branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC:505-507
/branches/work/LoggerService/jp.go.aist.rtm.RTC:666-669
/branches/work/SourceSharing/jp.go.aist.rtm.RTC:591-603
/branches/work/ToGetProperties/jp.go.aist.rtm.RTC:545-548
/branches/work/ToIFR_ID/jp.go.aist.rtm.RTC:509-514
+ /branches/RELENG_1_0/jp.go.aist.rtm.RTC:408-498
/branches/RELENG_1_0_0/jp.go.aist.rtm.RTC:60-401
/branches/RELENG_1_1/OpenRTM-aist-Java/jp.go.aist.rtm.RTC:806
/branches/work/ConfigurationCallback/jp.go.aist.rtm.RTC:631-635
/branches/work/DesignChangeOfEC/jp.go.aist.rtm.RTC:648-660
/branches/work/ForComponentActionListener/jp.go.aist.rtm.RTC:521-522
/branches/work/ForComponentObserverConsumer/jp.go.aist.rtm.RTC:534-543
/branches/work/ForConfigurationListener/jp.go.aist.rtm.RTC:524-526
/branches/work/ForFileNameservice/jp.go.aist.rtm.RTC:623-628
/branches/work/ForLogFormat/jp.go.aist.rtm.RTC:518-519
/branches/work/ForPortConnectListener/jp.go.aist.rtm.RTC:528-532
/branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC:505-507
/branches/work/LoggerService/jp.go.aist.rtm.RTC:666-669
/branches/work/SourceSharing/jp.go.aist.rtm.RTC:591-603
/branches/work/ToGetProperties/jp.go.aist.rtm.RTC:545-548
/branches/work/ToIFR_ID/jp.go.aist.rtm.RTC:509-514
/trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC:929-930
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/StringUtilTests.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/StringUtilTests.java 2017-02-14 06:09:55 UTC (rev 945)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/StringUtilTests.java 2017-02-14 07:19:32 UTC (rev 946)
@@ -1,9 +1,10 @@
package jp.go.aist.rtm.RTC.util;
+import junit.framework.TestCase;
+
import java.util.Vector;
import jp.go.aist.rtm.RTC.util.StringUtil;
-import junit.framework.TestCase;
/**
* 文字列操作クラス テスト
@@ -88,7 +89,6 @@
* </ul>
*/
public void test_unescape() {
-
final String[][] pairs = {
{"\\t", "\t"},
{"\\n", "\n"},
@@ -299,5 +299,81 @@
String expected = "normalizeteststring.";
assertEquals(expected, normalized);
}
+ /**
+ *
+ */
+ public void test_isIPv4() {
+ String addr = new String();
+ addr = "255.250.255.255"; // OK
+ assertEquals(StringUtil.isIPv4(addr), true);
+ addr = "0.0.0.0"; // OK
+ assertEquals(StringUtil.isIPv4(addr), true);
+ addr = "192.168.0.1"; // OK
+ assertEquals(StringUtil.isIPv4(addr), true);
+ addr = "192.168.100.0"; // OK
+ assertEquals(StringUtil.isIPv4(addr), true);
+ addr = "255.250.255"; // NG
+ assertEquals(StringUtil.isIPv4(addr), false);
+ addr = "255,250.255.0"; // NG
+ assertEquals(StringUtil.isIPv4(addr), false);
+ addr = "192.168.0.256"; // NG
+ assertEquals(StringUtil.isIPv4(addr), false);
+ addr = "ff.ff.ff.ff"; // NG
+ assertEquals(StringUtil.isIPv4(addr), false);
+ addr = "xx.yy.zz.00"; // NG
+ assertEquals(StringUtil.isIPv4(addr), false);
+
+ addr = "255.250.255.255:92183"; // OK
+ assertEquals(StringUtil.isIPv4(addr), true);
+ addr = "0.0.0.0:97763"; // OK
+ assertEquals(StringUtil.isIPv4(addr), true);
+ addr = "192.168.0.1:98657"; // OK
+ assertEquals(StringUtil.isIPv4(addr), true);
+ addr = "192.168.100.0:4689"; // OK
+ assertEquals(StringUtil.isIPv4(addr), true);
+
+ addr = "255.250.255:8686"; // NG
+ assertEquals(StringUtil.isIPv4(addr), false);
+ addr = "255,250.255.0:86545"; // NG
+ assertEquals(StringUtil.isIPv4(addr), false);
+ addr = "1293:192.168.0.1"; // NG
+ assertEquals(StringUtil.isIPv4(addr), false);
+ addr = "ff.ff.ff.ff.ff:9763"; // NG
+ assertEquals(StringUtil.isIPv4(addr), false);
+ addr = "xx.yy.zz.00:98767"; // NG
+ assertEquals(StringUtil.isIPv4(addr), false);
+ }
+
+ /**
+ *
+ */
+ public void test_isIPv6() {
+ String addr = new String();
+ addr = "fe80:0:0:0:21c:42ff:fe87:d3d4"; // OK
+ assertEquals(StringUtil.isIPv6(addr), true);
+ addr = "::1"; // OK
+ assertEquals(StringUtil.isIPv6(addr), true);
+ addr = "fe80::21c:42ff:fe87:d3d4"; // OK
+ assertEquals(StringUtil.isIPv6(addr), true);
+
+ addr = "fe80::21c:42ff:fe87:1ffff"; // NG
+ assertEquals(StringUtil.isIPv6(addr), false);
+ addr = "ffe80::21c:42ff:fe87:d3d4"; // NG
+ assertEquals(StringUtil.isIPv6(addr), false);
+
+ addr = "[fe80:0:0:0:21c:42ff:fe87:d3d4]"; // OK
+ assertEquals(StringUtil.isIPv6(addr), true);
+ addr = "[::1]:9679"; // OK
+ assertEquals(StringUtil.isIPv6(addr), true);
+ addr = "[fe80::21c:42ff:fe87:d3d4]:7657"; // OK
+ assertEquals(StringUtil.isIPv6(addr), true);
+
+ addr = "[ffe80::21c:42ff:fe87:d3d4]:5678"; // NG
+ assertEquals(StringUtil.isIPv6(addr), false);
+ addr = "fe80::21c:42ff:fe87:d3d4]:87654"; // NG
+ assertEquals(StringUtil.isIPv6(addr), false);
+
+ }
+
}
More information about the openrtm-commit
mailing list