[openrtm-commit:01630] r733 - in branches/RELENG_1_1: . jp.go.aist.rtm.RTC jp.go.aist.rtm.RTC/Source/examples jp.go.aist.rtm.RTC/Source/examples/RTMExamples/ConfigSample jp.go.aist.rtm.RTC/installer/win32 jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/log jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/buffer jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/log jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util
openrtm @ openrtm.org
openrtm @ openrtm.org
2015年 10月 28日 (水) 11:08:55 JST
Author: kawauchi
Date: 2015-10-28 11:08:55 +0900 (Wed, 28 Oct 2015)
New Revision: 733
Added:
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/clock/
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/AdjustedClockTest.java
Modified:
branches/RELENG_1_1/
branches/RELENG_1_1/jp.go.aist.rtm.RTC/
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConfigSample.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/Connector.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleIn.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleOut.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConnector.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleIn.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleOut.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/GUIIn.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceConsumer.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceProvider.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/RTMExamples/ConfigSample/rtc.conf
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqIn.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqOut.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SinCosOut.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTM-aist-Java.wxs.in
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/TimeMeasure.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer/RingBuffer.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/log/Logbuf.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/buffer/RingBufferTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContextTests.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContextTests.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/log/LogbufTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/TimeValueTest.java
Log:
[compat,merge] r678,680-685,688 merged from trunk.
Property changes on: branches/RELENG_1_1
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/RELENG_1_0_0:60-401
/branches/work/ConfigurationCallback:631-635
/branches/work/DesignChangeOfEC:648-660
/branches/work/ForComponentActionListener:521-522
/branches/work/ForComponentObserverConsumer:534-543
/branches/work/ForConfigurationListener:524-526
/branches/work/ForLogFormat:518-519
/branches/work/ForPortConnectListener:528-532
/branches/work/ForSDOServiceAdminClass:505-507
/branches/work/LoggerService:666-669
/branches/work/SourceSharing:591-603
/branches/work/ToGetProperties:545-548
/branches/work/ToIFR_ID:509-514
/trunk:622,630-637,639-658,661,663,670,672-673
+ /branches/RELENG_1_0_0:60-401
/branches/work/ConfigurationCallback:631-635
/branches/work/DesignChangeOfEC:648-660
/branches/work/ForComponentActionListener:521-522
/branches/work/ForComponentObserverConsumer:534-543
/branches/work/ForConfigurationListener:524-526
/branches/work/ForLogFormat:518-519
/branches/work/ForPortConnectListener:528-532
/branches/work/ForSDOServiceAdminClass:505-507
/branches/work/LoggerService:666-669
/branches/work/SourceSharing:591-603
/branches/work/ToGetProperties:545-548
/branches/work/ToIFR_ID:509-514
/trunk:622,630-637,639-658,661,663,670,672-673,678,680-685,688
Property changes on: branches/RELENG_1_1/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/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/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/jp.go.aist.rtm.RTC:622,630-637,639-658,661,663,670,672-673
+ /branches/RELENG_1_0/jp.go.aist.rtm.RTC:408-498
/branches/RELENG_1_0_0/jp.go.aist.rtm.RTC:60-401
/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/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/jp.go.aist.rtm.RTC:622,630-637,639-658,661,663,670,672-673,678,680-685,688
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConfigSample.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConfigSample.bat 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConfigSample.bat 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.ConfigSample.ConfigSampleComp -f RTMExamples/ConfigSample/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/Connector.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/Connector.bat 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/Connector.bat 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SimpleIO.ConnectorComp
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleIn.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleIn.bat 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleIn.bat 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SimpleIO.ConsoleInComp -f RTMExamples/SimpleIO/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleOut.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleOut.bat 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleOut.bat 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SimpleIO.ConsoleOutComp -f RTMExamples/SimpleIO/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConnector.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConnector.bat 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConnector.bat 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.ExtTrigger.ConnectorComp
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleIn.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleIn.bat 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleIn.bat 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.ExtTrigger.ConsoleInComp -f RTMExamples/ExtTrigger/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleOut.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleOut.bat 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleOut.bat 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.ExtTrigger.ConsoleOutComp -f RTMExamples/ExtTrigger/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/GUIIn.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/GUIIn.bat 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/GUIIn.bat 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.GUIIn.GUIInComp -f RTMExamples/GUIIn/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceConsumer.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceConsumer.bat 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceConsumer.bat 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SimpleService.MyServiceConsumerComp -f RTMExamples/SimpleService/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceProvider.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceProvider.bat 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceProvider.bat 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SimpleService.MyServiceProviderComp -f RTMExamples/SimpleService/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/RTMExamples/ConfigSample/rtc.conf
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/RTMExamples/ConfigSample/rtc.conf 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/RTMExamples/ConfigSample/rtc.conf 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,4 +1,4 @@
corba.nameservers: localhost:2809
naming.formats: %n.rtc
logger.log_level: PARANOID
-example.ConfigSample.config_file: C:\\Tech-Arts\\Robot\\2007JavaÅRTM\\[i¨\\0_4_1Î\\RTM_Sample\\RTMExamples\\ConfigSample\\configsample.conf
+#example.ConfigSample.config_file: configsample.conf
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqIn.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqIn.bat 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqIn.bat 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SeqIO.SeqInComp -f RTMExamples/SeqIO/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqOut.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqOut.bat 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqOut.bat 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SeqIO.SeqOutComp -f RTMExamples/SeqIO/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SinCosOut.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SinCosOut.bat 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SinCosOut.bat 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SinCosOut.SinCosOutComp -f RTMExamples/SinCosOut/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTM-aist-Java.wxs.in
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTM-aist-Java.wxs.in 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTM-aist-Java.wxs.in 2015-10-28 02:08:55 UTC (rev 733)
@@ -32,19 +32,25 @@
Name="JavaHome"
Type="raw" />
</Property>
-
+ <Property Id="JDK17">
+ <RegistrySearch Id="JDK17"
+ Root="HKLM"
+ Key="SOFTWARE\JavaSoft\Java Development Kit\1.7"
+ Name="JavaHome"
+ Type="raw" />
+ </Property>
<!-- RTSE Property-->
-<!--
- <Property Id="FILEEXISTS">
- <DirectorySearch Id="CheckFileDir" Path="C:\Program Files">
+
+ <Property Id="RTSE_FILEEXISTS">
+ <DirectorySearch Id="CheckFileDir" Path="C:\Program Files\OpenRTM-aist\{% Product.ShortVersion %}">
<DirectorySearch Id="CheckFileDir2" Path ="OpenRTP">
- <DirectorySearch Id="CheckFileDir3" Path ="RTSystemEditor">
+ <DirectorySearch Id="CheckFileDir3" Path ="{% Product.ShortVersion %}\RTSystemEditor">
<FileSearch Id="CheckFile" Name="RTSystemEditorRCP.exe" />
</DirectorySearch>
</DirectorySearch>
</DirectorySearch>
</Property>
--->
+
<!-- <SetProperty Id="FILEEXISTSDIR" After="AppSearch" Value="[FILEEXISTS]">
</SetProperty>-->
@@ -74,8 +80,8 @@
<!-- <Property Id="ALLUSERS" Value="1" /> -->
<!-- Check Conditions -->
- <Condition Message="[ProductName] requires JDK 1.5 or 1.6">
- <![CDATA[Installed OR (JDK15 <> "" OR JDK16 <> "")]]>
+ <Condition Message="[ProductName] requires JDK 1.5 or 1.6 or 1.7">
+ <![CDATA[Installed OR (JDK15 <> "" OR JDK16 <> "" OR JDK17 <> "")]]>
</Condition>
<Directory Id="TARGETDIR" Name="SourceDir">
@@ -1350,23 +1356,19 @@
<!-- OpenRTP tools -->
<?if $(env.INCLUDE_OPENRTP) = YES ?>
- <Feature Id="OpenRTP" Level="1" Title="OpenRT Platform Tool Chain">
- <!--
- <Condition Level ="1"><![CDATA[ (FILEEXISTS = "") ]]></Condition>
- <Condition Level ="0"><![CDATA[ (FILEEXISTS <> "") ]]></Condition>
- -->
+ <Feature Id="OpenRTP" Level="1" Title="OpenRT Platform Tool Chain"
+ ConfigurableDirectory="INSTALLLOCATION">
+ <Condition Level ="1"><![CDATA[ (RTSE_FILEEXISTS = "") ]]></Condition>
+ <Condition Level ="0"><![CDATA[ (RTSE_FILEEXISTS <> "") ]]></Condition>
+
<!-- rtse rcp -->
<Feature Id="RTSystemEditor" Level="1" Title="RTSystemEditor">
<ComponentRef Id="Openrtp" />
<ComponentRef Id="OpenrtpConfiguration" />
<ComponentRef Id="OpenrtpPlugins" />
- <!-- <ComponentRef Id="org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610" /> -->
<ComponentRef Id="OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v20080610" />
- <!-- <ComponentRef Id="META_INF" /> -->
<ComponentRef Id="Meta_inf" />
- <!-- <ComponentRef Id="org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731" /> -->
<ComponentRef Id="OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v20080731" />
- <!-- <ComponentRef Id="META_INF_2" /> -->
<ComponentRef Id="Meta_inf_2" />
</Feature>
</Feature>
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2015-10-28 02:08:55 UTC (rev 733)
@@ -232,6 +232,24 @@
}
/**
+ * {@.ja ããã¼ã¸ã£ã¤ã³ã¹ã¿ã³ã¹ãçææ¸ã¿ããã§ãã¯ã}
+ * {@.en Check Manager Instance}
+ *
+ * <p>
+ * {@.ja ããã¼ã¸ã£ã¤ã³ã¹ã¿ã³ã¹ãçææ¸ã¿ãã©ãã確èªããã}
+ * {@.en Check manager instance}
+ *
+ * @return
+ * {@.ja Manager ã®å¯ä¸ã®ã¤ã³ã¹ã¿ã³ã¹ã®æç¡}
+ * {@.en Existence of the only instance reference of the manager}
+ */
+ public static boolean isActive() {
+ if(manager==null)
+ return false;
+ return true;
+ }
+
+ /**
* {@.ja ããã¼ã¸ã£ã»ã·ã£ãããã¦ã³}
* {@.en Shutdown Manager}
*
@@ -1990,6 +2008,8 @@
// Set date format for log entry header
rtcout.setDateFormat(m_config.getProperty("logger.date_format"));
+ rtcout.setClockType(m_config.getProperty("logger.clock_type"));
+
// Loglevel was set from configuration file.
rtcout.setLevel(m_config.getProperty("logger.log_level"));
@@ -2085,12 +2105,12 @@
* {@.en ORB launch options}
*/
protected String createORBOptions() {
-
+
String opt = m_config.getProperty("corba.args");
rtcout.println(Logbuf.DEBUG, "corba.args: "+opt);
String dumpString = new String();
- dumpString = m_config._dump(dumpString, m_config, 0);
- rtcout.println(Logbuf.DEBUG, dumpString);
+ //dumpString = m_config._dump(dumpString, m_config, 0);
+ //rtcout.println(Logbuf.DEBUG, dumpString);
Vector<String> endpoints = new Vector<String>();
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/TimeMeasure.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/TimeMeasure.java 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/TimeMeasure.java 2015-10-28 02:08:55 UTC (rev 733)
@@ -108,8 +108,8 @@
*
*/
public void tick() {
- double dtm = (double)System.currentTimeMillis();
- m_begin.convert(dtm/1000); // [TimeValue]
+ double dtm = (double)System.nanoTime();
+ m_begin.convert(dtm/1000000000.0); // [TimeValue]
}
@@ -124,8 +124,8 @@
if (m_begin.sec() == 0) {
return;
}
- double dtm = (double)System.currentTimeMillis();
- m_interval.convert((dtm/1000) - m_begin.toDouble());
+ double dtm = (double)System.nanoTime();
+ m_interval.convert((dtm/1000000000.0) - m_begin.toDouble());
m_record.set(m_count,m_interval);
++m_count;
if (m_count == m_countMax)
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer/RingBuffer.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer/RingBuffer.java 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer/RingBuffer.java 2015-10-28 02:08:55 UTC (rev 733)
@@ -225,7 +225,6 @@
*/
public ReturnCode write(final DataType value, int sec, int nsec) {
synchronized (m_full.mutex) {
-
if (full()) {
boolean timedwrite = m_timedwrite;
@@ -245,15 +244,17 @@
else if (!overwrite && timedwrite) { // "block" mode
if (sec < 0) {
sec =
- (int)(m_rtimeout.sec()*1000+m_rtimeout.usec()/1000);
- nsec = (int)(m_rtimeout.usec() % 1000)*1000;
+ (int)(m_wtimeout.sec()*1000+m_wtimeout.usec()/1000);
+ nsec = (int)(m_wtimeout.usec() % 1000)*1000;
}
try {
if(sec==0 && nsec==0){
return ReturnCode.TIMEOUT;
}
m_full.mutex.wait(sec, (int)nsec);
- return ReturnCode.TIMEOUT;
+ if (full()) {
+ return ReturnCode.TIMEOUT;
+ }
}
catch(InterruptedException e ){
throw new RuntimeException(e.toString());
@@ -266,20 +267,21 @@
return ReturnCode.PRECONDITION_NOT_MET;
}
}
-
- boolean empty_ = empty();
-
+
put(value);
synchronized (m_empty.mutex) {
- advanceWptr(1);
- if (empty_) {
+ if (empty()) {
+ advanceWptr(1);
try {
m_empty.mutex.notify();
}
catch(IllegalMonitorStateException e) {
}
}
+ else {
+ advanceWptr(1);
+ }
}
return ReturnCode.BUFFER_OK;
}
@@ -422,8 +424,15 @@
return ReturnCode.BUFFER_EMPTY;
}
else if (!readback && timedread) { // "block" mode
- // true: signaled, false: timeout
+ if (sec < 0) {
+ local_msec =
+ (int)(m_rtimeout.sec()*1000+m_rtimeout.usec()/1000);
+ local_nsec = (int)(m_rtimeout.usec() % 1000)*1000;
+ }
try {
+ if(local_msec==0 && local_nsec==0){
+ return ReturnCode.TIMEOUT;
+ }
m_empty.mutex.wait(local_msec, local_nsec);
if (empty()) {
return ReturnCode.TIMEOUT;
@@ -445,19 +454,20 @@
}
}
- boolean full_ = full();
-
get(valueRef);
synchronized(m_full.mutex){
- advanceRptr(1);
- if (full_) {
+ if (full()) {
+ advanceRptr(1);
try {
m_full.mutex.notify();
}
catch(IllegalMonitorStateException e) {
}
}
+ else {
+ advanceRptr(1);
+ }
}
return ReturnCode.BUFFER_OK;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/log/Logbuf.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/log/Logbuf.java 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/log/Logbuf.java 2015-10-28 02:08:55 UTC (rev 733)
@@ -9,6 +9,12 @@
import java.util.logging.LogRecord;
import java.util.logging.Logger;
+import jp.go.aist.rtm.RTC.Manager;
+import jp.go.aist.rtm.RTC.util.TimeValue;
+import jp.go.aist.rtm.RTC.util.clock.ClockManager;
+import jp.go.aist.rtm.RTC.util.clock.IClock;
+import jp.go.aist.rtm.RTC.util.clock.LogicalClock;
+
/**
* <p>ãã°åéONæã®ãã®ã³ã°ã¯ã©ã¹ã§ãã</p>
* ãã°åºåã®å¯å¦ã¯ãããã©ã«ãã§ç¡å¹ã¨ãã
@@ -47,16 +53,28 @@
public Logbuf(String name) {
m_LogLock = false;
m_Suffix = name;
+ m_clock = ClockManager.getInstance().getClock("system");
+ if(Manager.isActive() ) {
+ if( Manager.instance().getConfig().getNode("logger.date_format")!=null ) {
+ setDateFormat(Manager.instance().getConfig().getProperty("logger.date_format"));
+ }
+ if( Manager.instance().getConfig().getNode("logger.clock_type")!=null ) {
+ setClockType(Manager.instance().getConfig().getProperty("logger.clock_type"));
+ }
+ }
+
int parent = name.indexOf("Manager.");
String str;
if(name.equals("Manager")) {
str = "OpenRTM-aist.logging." + name;
m_Logger = Logger.getLogger(str);
this.addStream(new NullHandler());
+
} else if(parent >= 0) {
m_Suffix = this.getLastName(name);
str = "OpenRTM-aist.logging.Manager." + m_Suffix;
m_Logger = Logger.getLogger(str);
+
} else {
str = "OpenRTM-aist.logging.Manager." + name;
m_Logger = Logger.getLogger(str);
@@ -80,6 +98,16 @@
public Logbuf(String name, String parent) {
m_LogLock = false;
m_Suffix = name;
+ m_clock = ClockManager.getInstance().getClock("system");
+ if(Manager.isActive() ) {
+ if( Manager.instance().getConfig().getNode("logger.date_format")!=null ) {
+ setDateFormat(Manager.instance().getConfig().getProperty("logger.date_format"));
+ }
+ if( Manager.instance().getConfig().getNode("logger.clock_type")!=null ) {
+ setClockType(Manager.instance().getConfig().getProperty("logger.clock_type"));
+ }
+ }
+
String str;
if((parent.length() == 0) || (parent == null)) {
str = "OpenRTM-aist.logging." + name;
@@ -119,20 +147,30 @@
// System.err.println("Logbuf.println() destination handler was not registered.");
return;
}
- StringBuilder sb = new StringBuilder();
+// StringBuilder sb = new StringBuilder();
+//
+// // Send all output to the Appendable object sb
+// java.util.Formatter formatter = new java.util.Formatter(sb, java.util.Locale.US);
+//
+// // Explicit argument indices may be used to re-order output.
+// Date date = new Date();
- // Send all output to the Appendable object sb
- java.util.Formatter formatter = new java.util.Formatter(sb, java.util.Locale.US);
-
- // Explicit argument indices may be used to re-order output.
- Date date = new Date();
-
String str = logLevelToStr(level);
Level clevel = Level.parse(str);
- m_Logger.log(clevel,
- formatter.format(m_dateFormat,date,date,date,date,date,date,date,date,date,date)
- + " " + m_Suffix + " " + logLevelToStr(level) + " " + contents);
+// m_Logger.log(clevel,
+// formatter.format(m_dateFormat,date,date,date,date,date,date,date,date,date,date)
+// + " " + m_Suffix + " " + logLevelToStr(level) + " " + contents);
+ m_Logger.log(clevel, getDate() + " " + m_Suffix + " " + logLevelToStr(level) + " " + contents);
}
+
+ protected String getDate() {
+ //æ¡è½ã¡ãé²ãããã«å¾®å°å¤ãå ç®
+ long sec = (long)(m_clock.getTime().toDouble()*1000+0.0000005);
+ Date date = new Date(sec);
+ StringBuilder sb = new StringBuilder();
+ java.util.Formatter formatter = new java.util.Formatter(sb, java.util.Locale.US);
+ return formatter.format(m_dateFormat,date,date,date,date,date,date,date,date,date,date).toString();
+ }
/**
* <p>RTMç¨ãã°ã¬ãã«ã®è¨å®</p>
@@ -408,6 +446,45 @@
}
/**
+ * {@.ja ãã°è¨é²æã«ä½¿ç¨ããã¯ããã¯ãæå®ãã}
+ * {@.en Specifying clock type to be used for logging}
+ *
+ * <p>
+ * {@.ja ãã°è¨é²æã«æå»ãåå¾ããããã®ã¯ããã¯ã®ç¨®é¡ãæå®ãããã¨ãã§ããã
+ * <li> system: ã·ã¹ãã ã¯ããã¯ãããã©ã«ã
+ * <li> logical: è«çæéã¯ããã¯ã
+ * <li> adjusted: 調æ´æ¸ã¿ã¯ããã¯ã
+ * <li> initTimer: Timer åæå</li>
+ * è«çæéã¯ããã¯ã«ã¤ãã¦ã¯
+ * <pre>
+ * ClockManager::instance().getClock("logical").settime()
+ * </pre>
+ * ã§æå»ãè¨å®ããå¿
è¦ãããã
+ *
+ * {@.en This function sets a clock type getting time when it is used
+ * for logging. Available clock types are,
+ * <li> system: System clock. Default option.
+ * <li> logical: Logical time clock.
+ * <li> adjusted: Adjusted clock.
+ * To use logical time clock, call and set time by the following
+ * function in somewhere.
+ * <pre>
+ * coil::ClockManager::instance().getClock("logical").settime()
+ * </pre>}
+ *
+ * @param clocktype
+ * {@.ja ä¸è¿°ã®ã¯ããã¯ã¿ã¤ã}
+ * {@.en A clock type above mentioned.}
+ */
+ public void setClockType(String clocktype) {
+ m_clock = ClockManager.getInstance().getClock(clocktype);
+ //è«çæéã®å ´åã¯åºåæ¸å¼ã®ããã©ã«ãè¨å®ãå¤æ´
+ if(m_clock instanceof LogicalClock) {
+ setDateFormat("%S %L");
+ }
+ }
+
+ /**
* <p>ãã°ã»ã¬ãã«ãè¨å®ãã¾ãã</p>
*
* @param level ãã°ã»ã¬ãã«
@@ -453,6 +530,8 @@
* <p>åºåå
ãã³ãã©ã®æ°</p>
*/
private int m_HandlerCount = 0;
+
+ private IClock m_clock;
/**
* <p>ãã°åºåã®è¨å®</p>
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/buffer/RingBufferTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/buffer/RingBufferTest.java 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/buffer/RingBufferTest.java 2015-10-28 02:08:55 UTC (rev 733)
@@ -5,6 +5,8 @@
import jp.go.aist.rtm.RTC.util.Properties;
import junit.framework.TestCase;
+import java.util.*;
+
/**
* <p>RingBufferã®ããã®ãã¹ãã±ã¼ã¹ã§ãã</p>
*/
@@ -531,6 +533,8 @@
}
return;
}
+
+
public void test_write_read2() {
//(2)Can the buffer correctly read one written data
//in the state of full?
@@ -540,7 +544,7 @@
for (int i = 0; i < length2; i++) {
buff2.write(i + 123);
}
-
+
// ï¼ãã¼ã¿æ¸è¾¼ã»èªåºãè¡ã
for (int writeValue = 0; writeValue < 100; writeValue++) {
// æ¸è¾¼ã¿
@@ -561,7 +565,7 @@
readValue.v.intValue());
}
}
-
+
// (3) ãããã¡ã«å¹¾åãã¼ã¿ãæ¸ãè¾¼ã¾ãã¦ããç¶æ
ã§ï¼ãã¼ã¿æ¸è¾¼ã»èªåºãè¡ããæ¸ãè¾¼ãã ãã¼ã¿ãæ£ããèªã¿åºãããï¼
int length3 = 10;
RingBuffer<Integer> buff3 = new RingBuffer<Integer>(length3);
@@ -590,6 +594,71 @@
}
}
}
+
+
+ class writing_thread extends Thread {
+ RingBuffer<Integer> m_buff;
+ int m_loopcnt;
+ public writing_thread(RingBuffer<Integer> buff, int loop) {
+ m_buff = buff;
+ m_loopcnt = loop;
+ }
+
+ public void start() {
+ super.start();
+ }
+
+ public void run() {
+ //DataRef<Integer> readValue = new DataRef<Integer>(0);
+ for (int i = 0; i < m_loopcnt; ++i) {
+ //m_buff.read(readValue);
+ m_buff.write(i);
+ }
+ }
+
+ ArrayList m_data = new ArrayList();
+ public ArrayList getData() {
+ return m_data;
+ }
+ }
+
+ public void test_write_read3() {
+ int loopcnt = 1000000;
+ Properties prop = new Properties();
+ prop.setProperty("write.full_policy","block");
+ prop.setProperty("write.timeout","5.0");
+ prop.setProperty("read.empty_policy","block");
+ prop.setProperty("read.timeout","5.0");
+ RingBuffer<Integer> buff = new RingBuffer<Integer>(8);
+ DataRef<Integer> readValue = new DataRef<Integer>(0);
+ buff.init(prop);
+ writing_thread wt = new writing_thread(buff, loopcnt);
+ wt.start();
+ try {
+ Thread.sleep(10);
+ }
+ catch(InterruptedException e) {
+ }
+ ArrayList rdata = new ArrayList();
+ for (int i = 0; i < loopcnt; i++) {
+ buff.read(readValue);
+ rdata.add(i);
+ //buff.write(i);
+ }
+ try {
+ wt.join();
+ } catch (InterruptedException e) {
+ System.out.println(e);
+ }
+ ArrayList wdata = wt.getData();
+ Iterator w_ite = wdata.iterator();
+ Iterator r_ite = rdata.iterator();
+ while(w_ite.hasNext()) {
+ assertEquals("rdata==wdata",w_ite.next(),r_ite.next());
+ }
+ }
+
+
/**
* <p>write()ã¡ã½ããããã³read()ã¡ã½ããã®ãã¹ãï¼ãããã¡é·ï¼ã®å ´åï¼
* <ul>
@@ -648,7 +717,7 @@
//and the increment does the pointer on the reading side.
buff2.write(0);
- assertEquals("(2)-2",true, buff2.full());
+ assertEquals("(2)-2",true, buff2.full());
//Readinfg
// Because it reads out data from the reading side and
// the number of pointers is increased,
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContextTests.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContextTests.java 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContextTests.java 2015-10-28 02:08:55 UTC (rev 733)
@@ -51,7 +51,6 @@
* </p>
*/
public void test_tick() {
-/*
// RTObjectãçæãã
Manager manager = Manager.instance();
DataFlowComponentMock rto = new DataFlowComponentMock(manager); // will be deleted automatically
@@ -61,27 +60,36 @@
// ExecutionContextãçæãã
ExtTrigExecutionContext ec = new ExtTrigExecutionContext(); // will be deleted automatically
assertEquals(ReturnCode_t.RTC_OK, ec.start());
- assertEquals(ReturnCode_t.RTC_OK, ec.add(rto.getObjRef()));
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ assertEquals(ReturnCode_t.RTC_OK, ec.add_component(rto._this()));
+ ec.m_worker.updateComponentList();
assertEquals(ReturnCode_t.RTC_OK, ec.activate_component(rto.getObjRef()));
ec.tick();
-
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
// tick()å¼åºãè¡ãããã®åæ°ã¨on_execute()ã®å¼åºåæ°ãä¸è´ãã¦ãããã¨ã確èªãã
- for (int tickCalledCount = 0; tickCalledCount < 10; tickCalledCount++) {
+ for (int tickCalledCount = 2; tickCalledCount < 5; tickCalledCount++) {
try {
- Thread.sleep(10);
+ Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
assertEquals(tickCalledCount, mock.countLog("on_execute"));
try {
- Thread.sleep(10);
+ Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
ec.tick();
}
-*/
- }
+}
/**
* <p>name()ã¡ã½ããã®ãã¹ã
@@ -91,14 +99,12 @@
* </p>
*/
public void test_name() {
-/*
String name = "jp.go.aist.rtm.RTC.executionContext.ExtTrigExecutionContext";
ECFactoryBase factory = new ECFactoryJava(name);
// ã³ã³ã¹ãã©ã¯ã¿ã§æå®ããå称ããname()ã¡ã½ããã§æ£ããåå¾ã§ãããï¼
assertEquals(name, factory.name());
-*/
}
/**
@@ -110,16 +116,14 @@
* </p>
*/
public void test_create_destroy() {
-/*
ECFactoryJava factory = new ECFactoryJava("jp.go.aist.rtm.RTC.executionContext.ExtTrigExecutionContext");
assertEquals("jp.go.aist.rtm.RTC.executionContext.ExtTrigExecutionContext", factory.m_name);
ExecutionContextBase base = factory.create();
assertNotNull(base);
- assertEquals(ExecutionKind.PERIODIC, base.get_kind());
- assertEquals(Double.valueOf(0.0), Double.valueOf(base.get_rate()));
+ //assertEquals(ExecutionKind.PERIODIC, base.get_kind());
+ assertEquals(Double.valueOf(1000.0), Double.valueOf(base.getRate()));
base = factory.destroy(base);
assertNull(base);
-*/
}
private class LightweightRTObjectMock extends DataFlowComponentBase {
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContextTests.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContextTests.java 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContextTests.java 2015-10-28 02:08:55 UTC (rev 733)
@@ -120,8 +120,8 @@
// ExecutionContextãçæãã
PeriodicExecutionContext ec = new PeriodicExecutionContext(); // will be deleted automatically
- // ExecutionContextã«RTObjectãç»é²ãã
- assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
+ // ExecutionContextã«RTObjectããã¤ã³ããã
+ ec.bindComponent(mock);
// ãã®æç¹ã§ã¯ãã¾ã on_startup()ã¯å¼ã³åºããã¦ããªãã¯ã
assertEquals(0, mock.countLog("on_startup"));
@@ -172,15 +172,15 @@
// ExecutionContextãçæãã
PeriodicExecutionContext ec = new PeriodicExecutionContext(); // will be deleted automatically
- // ExecutionContextã«RTObjectãç»é²ãã
- assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
+ // ExecutionContextã«RTObjectããã¤ã³ããã
+ ec.bindComponent(mock);
// éAliveç¶æ
ã«ãã¦ãã
mock.setAlive(false);
assertFalse(mock.is_alive());
// start()å¼åºããè¡ããæå³ã©ããã®ã¨ã©ã¼ã³ã¼ãã§æ»ããã¨ã確èªãã
- // assertEquals(ReturnCode_t.PRECONDITION_NOT_MET, ec.start());
+ //assertEquals(ReturnCode_t.PRECONDITION_NOT_MET, ec.start());
}
/**
@@ -200,8 +200,8 @@
// ExecutionContextãçæãã
PeriodicExecutionContext ec = new PeriodicExecutionContext(); // will be deleted automatically
- // ExecutionContextã«RTObjectãç»é²ãã
- assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
+ // ExecutionContextã«RTObjectããã¤ã³ããã
+ ec. bindComponent(mock);
// start()ãå¼ã³åºã
assertEquals(ReturnCode_t.RTC_OK, ec.start());
@@ -325,8 +325,8 @@
PeriodicExecutionContext ec = new PeriodicExecutionContext(); // will be deleted automatically
assertEquals(ExecutionKind.PERIODIC, ec.get_kind());
- // ExecutionContextã«RTObjectãç»é²ãã
- assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
+ // ExecutionContextã«RTObjectããã¤ã³ããã
+ ec.bindComponent(mock);
// ãã®æç¹ã§ã¯ãon_rate_changed()ã¯1åãå¼ã³åºããã¦ããªãã¯ã
assertEquals(0, mock.countLog("on_rate_changed"));
@@ -335,7 +335,7 @@
assertEquals(ReturnCode_t.RTC_OK, ec.set_rate(1.0d));
// ãã®æç¹ã§ãon_rate_changed()ã1åã ãå¼ã³åºããã¦ããã¯ã
- assertEquals(1, mock.countLog("on_rate_changed"));
+ //assertEquals(1, mock.countLog("on_rate_changed"));
}
/**
@@ -383,7 +383,8 @@
// LightweightRTObjectã§ã¯ããããDataFlowComponentã§ã¯ãªãRTObjectãç¨ãã¦ã
// add()å¼åºãã試ã¿ã¦ãæå³ã©ããã¨ã©ã¼ã³ã¼ãã§æ»ããã¨ã確èªãã
- assertEquals(ReturnCode_t.BAD_PARAMETER, ec.add_component(mock._this()));
+ // narrowã§ä¾å¤çºç
+ //assertEquals(ReturnCode_t.BAD_PARAMETER, ec.add_component(mock._this()));
}
/**
@@ -406,12 +407,13 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals("2:",ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
-
+ ec.m_worker.updateComponentList();
// ãã®æç¹ã§ã¯ãattach_executioncontext()ã¯1åãå¼ã³åºããã¦ããªãã¯ã
assertEquals("3:",0, mock.countLog("detach_executioncontext"));
// ExecutionContextã¸ã®ç»é²ã解é¤ãã
assertEquals("4:",ReturnCode_t.RTC_OK, ec.remove_component(mock._this()));
+ ec.m_worker.updateComponentList();
// ãã®æç¹ã§ãdetach_executioncontext()ã1åã ãå¼ã³åºããã¦ããã¯ã
assertEquals("5:",1, mock.countLog("detach_executioncontext"));
@@ -461,8 +463,13 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ }
// ã³ã³ãã¼ãã³ããActiveã«ãã
assertEquals(ReturnCode_t.RTC_OK, ec.activate_component(mock._this()));
+ ec.m_worker.updateComponentList();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
@@ -470,7 +477,8 @@
assertEquals(LifeCycleState.ACTIVE_STATE, ec.get_component_state(mock._this()));
// ã³ã³ãã¼ãã³ããActiveã®ã¾ã¾ã§remove()ã試ã¿ã¦ãæå³ã©ããã®ã¨ã©ã¼ã³ã¼ããæ»ããã¨ã確èªãã
- // assertEquals(ReturnCode_t.PRECONDITION_NOT_MET, ec.remove_component(mock._this()));
+ // 1.1.0ã§ã¯ç¶æ
ã¯ãã§ãã¯ãã¦ããªãã
+ //assertEquals(ReturnCode_t.PRECONDITION_NOT_MET, ec.remove_component(mock._this()));
}
/**
@@ -493,12 +501,17 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
+ ec.m_worker.updateComponentList();
// ãã®æç¹ã§ã¯ãã¾ã on_activated()ã¯1åãå¼ã³åºããã¦ããªãã¯ã
assertEquals(0, mock.countLog("on_activated"));
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ }
// ã³ã³ãã¼ãã³ããActiveã«ãã
- assertEquals(ReturnCode_t.RTC_OK, ec.activate_component(mock._this()));
+ ec.activate_component(mock._this());
try {
Thread.sleep(100);
} catch (InterruptedException e) {
@@ -557,6 +570,7 @@
// ã³ã³ãã¼ãã³ããErrorç¶æ
ã«ã¾ã§é·ç§»ããã
mock.setError(true);
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
+ ec.m_worker.updateComponentList();
assertEquals(ReturnCode_t.RTC_OK, ec.activate_component(mock._this()));
// Errorç¶æ
ã¸é·ç§»ããã¾ã§å¾
ã¤ãæ¬æ¥ããã®ã¹ãªã¼ããä»æ§ä¸å¿
è¦ãå¦ãï¼
try {
@@ -589,13 +603,14 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
+ ec.m_worker.updateComponentList();
// éAliveç¶æ
ã«ãã¦ãã
mock.setAlive(false);
assertFalse(mock.is_alive());
// activate_component()å¼åºããè¡ããæå³ã©ããã®ã¨ã©ã¼ã³ã¼ãã§æ»ããã¨ã確èªãã
- // assertEquals(ReturnCode_t.BAD_PARAMETER, ec.activate_component(mock._this()));
+ //assertEquals(ReturnCode_t.BAD_PARAMETER, ec.activate_component(mock._this()));
}
/**
@@ -618,6 +633,7 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
+ ec.m_worker.updateComponentList();
// ã³ã³ãã¼ãã³ããactivateãã
assertEquals(ReturnCode_t.RTC_OK, ec.activate_component(mock._this()));
@@ -685,6 +701,7 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
+ ec.m_worker.updateComponentList();
// ã³ã³ãã¼ãã³ããactivateãã
assertEquals(ReturnCode_t.RTC_OK, ec.activate_component(mock._this()));
@@ -726,6 +743,7 @@
// ã³ã³ãã¼ãã³ããErrorç¶æ
ã«ã¾ã§é·ç§»ããã
mock.setError(true);
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
+ ec.m_worker.updateComponentList();
assertEquals(ReturnCode_t.RTC_OK, ec.activate_component(mock._this()));
// Errorç¶æ
ã¸é·ç§»ããã¾ã§å¾
ã¤ãæ¬æ¥ããã®ã¹ãªã¼ããä»æ§ä¸å¿
è¦ãå¦ãï¼
try {
@@ -768,6 +786,7 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
+ ec.m_worker.updateComponentList();
// ãã®ç¶æ
(Inactive)ã§reset_component()å¼åºããè¡ããæå³ã©ããã®ã¨ã©ã¼ã³ã¼ãã§æ»ããã¨ã確èªãã
assertEquals(LifeCycleState.INACTIVE_STATE, ec.get_component_state(mock._this()));
@@ -794,6 +813,7 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
+ ec.m_worker.updateComponentList();
// éAliveç¶æ
(Createç¶æ
)ã«ãã¦ãã
mock.setAlive(false);
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/log/LogbufTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/log/LogbufTest.java 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/log/LogbufTest.java 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,16 +1,15 @@
package jp.go.aist.rtm.RTC.log;
-import junit.framework.TestCase;
-
import java.io.BufferedReader;
-import java.io.File;
import java.io.FileReader;
import java.io.IOException;
+import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
-import java.util.logging.ConsoleHandler;
+import java.util.logging.Handler;
+import java.util.logging.LogRecord;
-import jp.go.aist.rtm.RTC.log.Logbuf;
import jp.go.aist.rtm.RTC.Manager;
+import junit.framework.TestCase;
/**
*
@@ -40,60 +39,74 @@
// STDOUT
// Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
System.err.println("\n\n--- test_case0() setLevel() Not Set ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT 0");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT 0");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT 0");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT 0");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT 0");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT 0");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT 0");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT 0");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT 0");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT 0");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT 0");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT 0");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT 0");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT 0");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT 0");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT 0");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT 0");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT 0");
// addStream()ãã¦ããªãã®ã§ãprintlnã®æååãåºåãããªããã°OK.
// "Logbuf.println() destination handler was not registered."ã®åºåããã°OK.
rtcout.setLevel("PARANOID"); //å
¨ã¦
System.err.println("--- test_case0() setLevel(PARANOID), addStream(STDOUT) Not set ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT 1");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT 1");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT 1");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT 1");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT 1");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT 1");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT 1");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT 1");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT 1");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT 1");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT 1");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT 1");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT 1");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT 1");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT 1");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT 1");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT 1");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT 1");
// addStream()ãã¦ããªãã®ã§ãprintlnã®æååãåºåãããªããã°OK.
// "Logbuf.println() destination handler was not registered."ã®åºåããã°OK.
- rtcout.addStream(new ConsoleHandler());
+ LocalHandler handler = new LocalHandler();
+ rtcout.addStream(handler);
+ rtcout.setClockType("logical");
+// rtcout.addStream(new ConsoleHandler());
System.err.println("--- test_case0() addStream(STDOUT) set ---");
rtcout.setDisabled();
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT 2");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT 2");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT 2");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT 2");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT 2");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT 2");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT 2");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT 2");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT 2");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT 2");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT 2");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT 2");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT 2");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT 2");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT 2");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT 2");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT 2");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT 2");
// ä½ãåºåãããªããã°OK.
+ String expected = "";
+ assertEquals(expected, handler.getStr());
rtcout.setEnabled();
System.err.println("--- test_case0() addStream(STDOUT) set ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT 2");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT 2");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT 2");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT 2");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT 2");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT 2");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT 2");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT 2");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT 2");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT 2");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT 2");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT 2");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT 2");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT 2");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT 2");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT 2");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT 2");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT 2");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
-
+ expected = "00 000 test0 PARANOID : PARANOID string to STDOUT 2" + System.getProperty("line.separator") +
+ "00 000 test0 VERBOSE : VERBOSE string to STDOUT 2" + System.getProperty("line.separator") +
+ "00 000 test0 TRACE : TRACE string to STDOUT 2" + System.getProperty("line.separator") +
+ "00 000 test0 DEBUG : DEBUG string to STDOUT 2" + System.getProperty("line.separator") +
+ "00 000 test0 INFO : INFO string to STDOUT 2" + System.getProperty("line.separator") +
+ "00 000 test0 WARN : WARN string to STDOUT 2" + System.getProperty("line.separator") +
+ "00 000 test0 ERROR : ERROR string to STDOUT 2" + System.getProperty("line.separator") +
+ "00 000 test0 FATAL : FATAL string to STDOUT 2" + System.getProperty("line.separator") +
+ "00 000 test0 SILENT : SILENT string to STDOUT 2" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
}
/**
@@ -106,138 +119,212 @@
rtcout.setEnabled();
// STDOUT
- // Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
- rtcout.addStream(new ConsoleHandler());
+// // Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
+// rtcout.addStream(new ConsoleHandler());
+ rtcout.setEnabled();
+ rtcout.setClockType("logical");
+ rtcout.setLevel("PARANOID");
+ LocalHandler handler = new LocalHandler();
+ rtcout.addStream(handler);
rtcout.setLevel("PARANOID");
- System.err.println("\n\n--- setLevel:PARANOID check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ String expected =
+ "00 000 test1 PARANOID : PARANOID string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 VERBOSE : VERBOSE string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 TRACE : TRACE string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
+ handler.clear();
rtcout.setLevel("VERBOSE");
- System.err.println("--- setLevel:VERBOSE check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ expected =
+ "00 000 test1 VERBOSE : VERBOSE string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 TRACE : TRACE string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
+ handler.clear();
rtcout.setLevel("TRACE");
- System.err.println("--- setLevel:TRACE check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ expected =
+ "00 000 test1 TRACE : TRACE string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
+ handler.clear();
rtcout.setLevel("DEBUG");
System.err.println("--- setLevel:DEBUG check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ expected =
+ "00 000 test1 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
+ handler.clear();
rtcout.setLevel("INFO");
- System.err.println("--- setLevel:INFO check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ expected =
+ "00 000 test1 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
+ handler.clear();
rtcout.setLevel("WARN");
System.err.println("--- setLevel:WARN check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ expected =
+ "00 000 test1 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
+ handler.clear();
rtcout.setLevel("ERROR");
System.err.println("--- setLevel:ERROR check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ expected =
+ "00 000 test1 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
+ handler.clear();
rtcout.setLevel("FATAL");
System.err.println("--- setLevel:FATAL check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ expected =
+ "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
+ handler.clear();
rtcout.setLevel("SILENT");
System.err.println("--- setLevel:SILENT check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// ä½ãåºåãããªããã°OK.
+ expected = "";
+ assertEquals(expected, handler.getStr());
+ handler.clear();
rtcout.setLevel("other");
System.err.println("--- setLevel:other check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// ä½ãåºåãããªããã°OK.
+ expected = "";
+ assertEquals(expected, handler.getStr());
}
@@ -251,139 +338,207 @@
rtcout.setEnabled();
// STDOUT
- // Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
- rtcout.addStream(new ConsoleHandler());
+// // Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
+// rtcout.addStream(new ConsoleHandler());
+ rtcout.setEnabled();
+ rtcout.setClockType("logical");
+ rtcout.setLevel("PARANOID");
+ LocalHandler handler = new LocalHandler();
+ rtcout.addStream(handler);
- rtcout.setLevel(rtcout.PARANOID);
- System.err.println("\n\n--- setLevel:int PARANOID check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ rtcout.setLevel(Logbuf.PARANOID);
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ String expected =
+ "00 000 test2 PARANOID : PARANOID string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 VERBOSE : VERBOSE string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 TRACE : TRACE string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
- rtcout.setLevel(rtcout.VERBOSE);
- System.err.println("--- setLevel:int VERBOSE check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ handler.clear();
+ rtcout.setLevel(Logbuf.VERBOSE);
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ expected =
+ "00 000 test2 VERBOSE : VERBOSE string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 TRACE : TRACE string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
- rtcout.setLevel(rtcout.TRACE);
- System.err.println("--- setLevel:int TRACE check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ handler.clear();
+ rtcout.setLevel(Logbuf.TRACE);
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ expected =
+ "00 000 test2 TRACE : TRACE string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
- rtcout.setLevel(rtcout.DEBUG);
- System.err.println("--- setLevel:int DEBUG check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ handler.clear();
+ rtcout.setLevel(Logbuf.DEBUG);
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ expected =
+ "00 000 test2 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
- rtcout.setLevel(rtcout.INFO);
- System.err.println("--- setLevel:int INFO check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ handler.clear();
+ rtcout.setLevel(Logbuf.INFO);
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ expected =
+ "00 000 test2 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
- rtcout.setLevel(rtcout.WARN);
- System.err.println("--- setLevel:int WARN check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ handler.clear();
+ rtcout.setLevel(Logbuf.WARN);
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ expected =
+ "00 000 test2 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
- rtcout.setLevel(rtcout.ERROR);
- System.err.println("--- setLevel:int ERROR check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ handler.clear();
+ rtcout.setLevel(Logbuf.ERROR);
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ expected =
+ "00 000 test2 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
- rtcout.setLevel(rtcout.FATAL);
- System.err.println("--- setLevel:int FATAL check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ handler.clear();
+ rtcout.setLevel(Logbuf.FATAL);
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
+ expected =
+ "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
+ "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
+ assertEquals(expected, handler.getStr());
- rtcout.setLevel(rtcout.SILENT);
- System.err.println("--- setLevel:int SILENT check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ handler.clear();
+ rtcout.setLevel(Logbuf.SILENT);
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// ä½ãåºåãããªããã°OK.
+ expected = "";
+ assertEquals(expected, handler.getStr());
+ handler.clear();
rtcout.setLevel(999);
- System.err.println("--- setLevel:int 999 check ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
- rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(rtcout.INFO, "INFO string to STDOUT");
- rtcout.println(rtcout.WARN, "WARN string to STDOUT");
- rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
- rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
- rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
+ rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
+ rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
+ rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
+ rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
// ä½ãåºåãããªããã°OK.
-
+ expected = "";
+ assertEquals(expected, handler.getStr());
+
}
/**
@@ -407,15 +562,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("PARANOID");
- rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
- rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(rtcout.INFO, "INFO string to rtc.log");
- rtcout.println(rtcout.WARN, "WARN string to rtc.log");
- rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
- rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
- rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
+ rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
+ rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
+ rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
+ rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -464,15 +619,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("VERBOSE");
- rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
- rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(rtcout.INFO, "INFO string to rtc.log");
- rtcout.println(rtcout.WARN, "WARN string to rtc.log");
- rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
- rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
- rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
+ rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
+ rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
+ rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
+ rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -521,15 +676,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("TRACE");
- rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
- rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(rtcout.INFO, "INFO string to rtc.log");
- rtcout.println(rtcout.WARN, "WARN string to rtc.log");
- rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
- rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
- rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
+ rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
+ rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
+ rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
+ rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -577,15 +732,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("DEBUG");
- rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
- rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(rtcout.INFO, "INFO string to rtc.log");
- rtcout.println(rtcout.WARN, "WARN string to rtc.log");
- rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
- rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
- rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
+ rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
+ rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
+ rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
+ rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -633,15 +788,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("INFO");
- rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
- rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(rtcout.INFO, "INFO string to rtc.log");
- rtcout.println(rtcout.WARN, "WARN string to rtc.log");
- rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
- rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
- rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
+ rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
+ rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
+ rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
+ rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -689,15 +844,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("WARN");
- rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
- rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(rtcout.INFO, "INFO string to rtc.log");
- rtcout.println(rtcout.WARN, "WARN string to rtc.log");
- rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
- rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
- rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
+ rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
+ rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
+ rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
+ rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -745,15 +900,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("ERROR");
- rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
- rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(rtcout.INFO, "INFO string to rtc.log");
- rtcout.println(rtcout.WARN, "WARN string to rtc.log");
- rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
- rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
- rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
+ rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
+ rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
+ rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
+ rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -801,15 +956,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("FATAL");
- rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
- rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(rtcout.INFO, "INFO string to rtc.log");
- rtcout.println(rtcout.WARN, "WARN string to rtc.log");
- rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
- rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
- rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
+ rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
+ rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
+ rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
+ rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -857,15 +1012,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("SILENT");
- rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
- rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(rtcout.INFO, "INFO string to rtc.log");
- rtcout.println(rtcout.WARN, "WARN string to rtc.log");
- rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
- rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
- rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
+ rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
+ rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
+ rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
+ rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -905,35 +1060,35 @@
rtcout.setLevel("PARANOID");
int lv = 0;
- lv = rtcout.strToLogLevel("SILENT");
- assertEquals(rtcout.SILENT, lv);
+ lv = Logbuf.strToLogLevel("SILENT");
+ assertEquals(Logbuf.SILENT, lv);
- lv = rtcout.strToLogLevel("FATAL");
- assertEquals(rtcout.FATAL, lv);
+ lv = Logbuf.strToLogLevel("FATAL");
+ assertEquals(Logbuf.FATAL, lv);
- lv = rtcout.strToLogLevel("ERROR");
- assertEquals(rtcout.ERROR, lv);
+ lv = Logbuf.strToLogLevel("ERROR");
+ assertEquals(Logbuf.ERROR, lv);
- lv = rtcout.strToLogLevel("WARN");
- assertEquals(rtcout.WARN, lv);
+ lv = Logbuf.strToLogLevel("WARN");
+ assertEquals(Logbuf.WARN, lv);
- lv = rtcout.strToLogLevel("INFO");
- assertEquals(rtcout.INFO, lv);
+ lv = Logbuf.strToLogLevel("INFO");
+ assertEquals(Logbuf.INFO, lv);
- lv = rtcout.strToLogLevel("DEBUG");
- assertEquals(rtcout.DEBUG, lv);
+ lv = Logbuf.strToLogLevel("DEBUG");
+ assertEquals(Logbuf.DEBUG, lv);
- lv = rtcout.strToLogLevel("TRACE");
- assertEquals(rtcout.TRACE, lv);
+ lv = Logbuf.strToLogLevel("TRACE");
+ assertEquals(Logbuf.TRACE, lv);
- lv = rtcout.strToLogLevel("VERBOSE");
- assertEquals(rtcout.VERBOSE, lv);
+ lv = Logbuf.strToLogLevel("VERBOSE");
+ assertEquals(Logbuf.VERBOSE, lv);
- lv = rtcout.strToLogLevel("PARANOID");
- assertEquals(rtcout.PARANOID, lv);
+ lv = Logbuf.strToLogLevel("PARANOID");
+ assertEquals(Logbuf.PARANOID, lv);
- lv = rtcout.strToLogLevel("other");
- assertEquals(rtcout.SILENT, lv);
+ lv = Logbuf.strToLogLevel("other");
+ assertEquals(Logbuf.SILENT, lv);
System.err.println("--- test_strToLogLevel() is OK ---");
}
@@ -955,14 +1110,14 @@
// "logger.date_format", "%b %d %H:%M:%S",
format = "%b %d %H:%M:%S";
rtcout.setDateFormat(format);
- rtcout.println(rtcout.TRACE, "DateFormat Month day HH:MI:SS");
+ rtcout.println(Logbuf.TRACE, "DateFormat Month day HH:MI:SS");
// Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
// æ¥ä»ã¨æå»ã®ãã¿ã¼ã³ããMonth day hh:mi:ss ã§ãããOK
//Sep 29 16:36:53 TEST1 TRACE : TRACE string to rtc.log
format = "%Y/%m/%d %p %I:%M:%S";
rtcout.setDateFormat(format);
- rtcout.println(rtcout.TRACE, "DateFormat YYYY/MM/DD pp II:MI:SS");
+ rtcout.println(Logbuf.TRACE, "DateFormat YYYY/MM/DD pp II:MI:SS");
// Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
// æ¥ä»ã¨æå»ã®ãã¿ã¼ã³ããYYYY/MM/DD pp II:MI:SS ã§ãããOK
@@ -1008,75 +1163,75 @@
rtcout.setLevel("INFO");
System.err.println("--- Logbuf(Manager) set ---");
- rtcout.println(rtcout.INFO, "--- setLevel(INFO), addStream(STDOUT) set ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string 1");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string 1");
- rtcout.println(rtcout.TRACE, "TRACE string 1");
- rtcout.println(rtcout.DEBUG, "DEBUG string 1");
- rtcout.println(rtcout.INFO, "INFO string 1");
- rtcout.println(rtcout.WARN, "WARN string 1");
- rtcout.println(rtcout.ERROR, "ERROR string 1");
- rtcout.println(rtcout.FATAL, "FATAL string 1");
- rtcout.println(rtcout.SILENT, "SILENT string 1");
+ rtcout.println(Logbuf.INFO, "--- setLevel(INFO), addStream(STDOUT) set ---");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string 1");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string 1");
+ rtcout.println(Logbuf.TRACE, "TRACE string 1");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string 1");
+ rtcout.println(Logbuf.INFO, "INFO string 1");
+ rtcout.println(Logbuf.WARN, "WARN string 1");
+ rtcout.println(Logbuf.ERROR, "ERROR string 1");
+ rtcout.println(Logbuf.FATAL, "FATAL string 1");
+ rtcout.println(Logbuf.SILENT, "SILENT string 1");
// setLevel(INFO)以ä¸ã®å
容ããåºåãããã°OK.
Logbuf rtcout2 = new Logbuf("Manager.hoge1");
rtcout2.setEnabled();
System.err.println("--- Logbuf(Manager.hoge1) set ---");
- rtcout2.println(rtcout2.INFO, "--- setLevel(INFO) Not set ---");
- rtcout2.println(rtcout2.PARANOID, "PARANOID string 2");
- rtcout2.println(rtcout2.VERBOSE, "VERBOSE string 2");
- rtcout2.println(rtcout2.TRACE, "TRACE string 2");
- rtcout2.println(rtcout2.DEBUG, "DEBUG string 2");
- rtcout2.println(rtcout2.INFO, "INFO string 2");
- rtcout2.println(rtcout2.WARN, "WARN string 2");
- rtcout2.println(rtcout2.ERROR, "ERROR string 2");
- rtcout2.println(rtcout2.FATAL, "FATAL string 2");
- rtcout2.println(rtcout2.SILENT, "SILENT string 2");
+ rtcout2.println(Logbuf.INFO, "--- setLevel(INFO) Not set ---");
+ rtcout2.println(Logbuf.PARANOID, "PARANOID string 2");
+ rtcout2.println(Logbuf.VERBOSE, "VERBOSE string 2");
+ rtcout2.println(Logbuf.TRACE, "TRACE string 2");
+ rtcout2.println(Logbuf.DEBUG, "DEBUG string 2");
+ rtcout2.println(Logbuf.INFO, "INFO string 2");
+ rtcout2.println(Logbuf.WARN, "WARN string 2");
+ rtcout2.println(Logbuf.ERROR, "ERROR string 2");
+ rtcout2.println(Logbuf.FATAL, "FATAL string 2");
+ rtcout2.println(Logbuf.SILENT, "SILENT string 2");
// setLevel(INFO)以ä¸ã®å
容ããåºåãããã°OK.
rtcout2.setLevel("PARANOID");
System.err.println("--- Logbuf(Manager.hoge1) set ---");
- rtcout2.println(rtcout2.INFO, "--- setLevel(PARANOID) set ---");
- rtcout2.println(rtcout2.PARANOID, "PARANOID string 3");
- rtcout2.println(rtcout2.VERBOSE, "VERBOSE string 3");
- rtcout2.println(rtcout2.TRACE, "TRACE string 3");
- rtcout2.println(rtcout2.DEBUG, "DEBUG string 3");
- rtcout2.println(rtcout2.INFO, "INFO string 3");
- rtcout2.println(rtcout2.WARN, "WARN string 3");
- rtcout2.println(rtcout2.ERROR, "ERROR string 3");
- rtcout2.println(rtcout2.FATAL, "FATAL string 3");
- rtcout2.println(rtcout2.SILENT, "SILENT string 3");
+ rtcout2.println(Logbuf.INFO, "--- setLevel(PARANOID) set ---");
+ rtcout2.println(Logbuf.PARANOID, "PARANOID string 3");
+ rtcout2.println(Logbuf.VERBOSE, "VERBOSE string 3");
+ rtcout2.println(Logbuf.TRACE, "TRACE string 3");
+ rtcout2.println(Logbuf.DEBUG, "DEBUG string 3");
+ rtcout2.println(Logbuf.INFO, "INFO string 3");
+ rtcout2.println(Logbuf.WARN, "WARN string 3");
+ rtcout2.println(Logbuf.ERROR, "ERROR string 3");
+ rtcout2.println(Logbuf.FATAL, "FATAL string 3");
+ rtcout2.println(Logbuf.SILENT, "SILENT string 3");
// setLevel(PARANOID)以ä¸ã®å
容ããåºåãããã°OK.
Logbuf rtcout3 = new Logbuf("hoge2");
rtcout3.setEnabled();
System.err.println("--- Logbuf(hoge2) set ---");
- rtcout3.println(rtcout3.INFO, "--- setLevel(INFO) Not set ---");
- rtcout3.println(rtcout3.PARANOID, "PARANOID string 4");
- rtcout3.println(rtcout3.VERBOSE, "VERBOSE string 4");
- rtcout3.println(rtcout3.TRACE, "TRACE string 4");
- rtcout3.println(rtcout3.DEBUG, "DEBUG string 4");
- rtcout3.println(rtcout3.INFO, "INFO string 4");
- rtcout3.println(rtcout3.WARN, "WARN string 4");
- rtcout3.println(rtcout3.ERROR, "ERROR string 4");
- rtcout3.println(rtcout3.FATAL, "FATAL string 4");
- rtcout3.println(rtcout3.SILENT, "SILENT string 4");
+ rtcout3.println(Logbuf.INFO, "--- setLevel(INFO) Not set ---");
+ rtcout3.println(Logbuf.PARANOID, "PARANOID string 4");
+ rtcout3.println(Logbuf.VERBOSE, "VERBOSE string 4");
+ rtcout3.println(Logbuf.TRACE, "TRACE string 4");
+ rtcout3.println(Logbuf.DEBUG, "DEBUG string 4");
+ rtcout3.println(Logbuf.INFO, "INFO string 4");
+ rtcout3.println(Logbuf.WARN, "WARN string 4");
+ rtcout3.println(Logbuf.ERROR, "ERROR string 4");
+ rtcout3.println(Logbuf.FATAL, "FATAL string 4");
+ rtcout3.println(Logbuf.SILENT, "SILENT string 4");
// setLevel(INFO)以ä¸ã®å
容ããåºåãããã°OK.
rtcout3.setLevel("PARANOID");
System.err.println("--- Logbuf(hoge2) set ---");
- rtcout3.println(rtcout3.INFO, "--- setLevel(PARANOID) set ---");
- rtcout3.println(rtcout3.PARANOID, "PARANOID string 5");
- rtcout3.println(rtcout3.VERBOSE, "VERBOSE string 5");
- rtcout3.println(rtcout3.TRACE, "TRACE string 5");
- rtcout3.println(rtcout3.DEBUG, "DEBUG string 5");
- rtcout3.println(rtcout3.INFO, "INFO string 5");
- rtcout3.println(rtcout3.WARN, "WARN string 5");
- rtcout3.println(rtcout3.ERROR, "ERROR string 5");
- rtcout3.println(rtcout3.FATAL, "FATAL string 5");
- rtcout3.println(rtcout3.SILENT, "SILENT string 5");
+ rtcout3.println(Logbuf.INFO, "--- setLevel(PARANOID) set ---");
+ rtcout3.println(Logbuf.PARANOID, "PARANOID string 5");
+ rtcout3.println(Logbuf.VERBOSE, "VERBOSE string 5");
+ rtcout3.println(Logbuf.TRACE, "TRACE string 5");
+ rtcout3.println(Logbuf.DEBUG, "DEBUG string 5");
+ rtcout3.println(Logbuf.INFO, "INFO string 5");
+ rtcout3.println(Logbuf.WARN, "WARN string 5");
+ rtcout3.println(Logbuf.ERROR, "ERROR string 5");
+ rtcout3.println(Logbuf.FATAL, "FATAL string 5");
+ rtcout3.println(Logbuf.SILENT, "SILENT string 5");
// setLevel(PARANOID)以ä¸ã®å
容ããåºåãããã°OK.
@@ -1084,30 +1239,30 @@
Logbuf rtcout4 = new Logbuf("hoge3", "Manager");
rtcout4.setEnabled();
System.err.println("--- Logbuf(Manager.hoge3) set ---");
- rtcout4.println(rtcout4.INFO, "--- setLevel(INFO) Not set ---");
- rtcout4.println(rtcout4.PARANOID, "PARANOID string 6");
- rtcout4.println(rtcout4.VERBOSE, "VERBOSE string 6");
- rtcout4.println(rtcout4.TRACE, "TRACE string 6");
- rtcout4.println(rtcout4.DEBUG, "DEBUG string 6");
- rtcout4.println(rtcout4.INFO, "INFO string 6");
- rtcout4.println(rtcout4.WARN, "WARN string 6");
- rtcout4.println(rtcout4.ERROR, "ERROR string 6");
- rtcout4.println(rtcout4.FATAL, "FATAL string 6");
- rtcout4.println(rtcout4.SILENT, "SILENT string 6");
+ rtcout4.println(Logbuf.INFO, "--- setLevel(INFO) Not set ---");
+ rtcout4.println(Logbuf.PARANOID, "PARANOID string 6");
+ rtcout4.println(Logbuf.VERBOSE, "VERBOSE string 6");
+ rtcout4.println(Logbuf.TRACE, "TRACE string 6");
+ rtcout4.println(Logbuf.DEBUG, "DEBUG string 6");
+ rtcout4.println(Logbuf.INFO, "INFO string 6");
+ rtcout4.println(Logbuf.WARN, "WARN string 6");
+ rtcout4.println(Logbuf.ERROR, "ERROR string 6");
+ rtcout4.println(Logbuf.FATAL, "FATAL string 6");
+ rtcout4.println(Logbuf.SILENT, "SILENT string 6");
// setLevel(INFO)以ä¸ã®å
容ããåºåãããã°OK.
rtcout4.setLevel("PARANOID");
System.err.println("--- Logbuf(Manager.hoge3) set ---");
- rtcout4.println(rtcout4.INFO, "--- setLevel(PARANOID) set ---");
- rtcout4.println(rtcout4.PARANOID, "PARANOID string 7");
- rtcout4.println(rtcout4.VERBOSE, "VERBOSE string 7");
- rtcout4.println(rtcout4.TRACE, "TRACE string 7");
- rtcout4.println(rtcout4.DEBUG, "DEBUG string 7");
- rtcout4.println(rtcout4.INFO, "INFO string 7");
- rtcout4.println(rtcout4.WARN, "WARN string 7");
- rtcout4.println(rtcout4.ERROR, "ERROR string 7");
- rtcout4.println(rtcout4.FATAL, "FATAL string 7");
- rtcout4.println(rtcout4.SILENT, "SILENT string 7");
+ rtcout4.println(Logbuf.INFO, "--- setLevel(PARANOID) set ---");
+ rtcout4.println(Logbuf.PARANOID, "PARANOID string 7");
+ rtcout4.println(Logbuf.VERBOSE, "VERBOSE string 7");
+ rtcout4.println(Logbuf.TRACE, "TRACE string 7");
+ rtcout4.println(Logbuf.DEBUG, "DEBUG string 7");
+ rtcout4.println(Logbuf.INFO, "INFO string 7");
+ rtcout4.println(Logbuf.WARN, "WARN string 7");
+ rtcout4.println(Logbuf.ERROR, "ERROR string 7");
+ rtcout4.println(Logbuf.FATAL, "FATAL string 7");
+ rtcout4.println(Logbuf.SILENT, "SILENT string 7");
// setLevel(PARANOID)以ä¸ã®å
容ããåºåãããã°OK.
rtcout.removeStream(stdout);
@@ -1141,30 +1296,30 @@
Logbuf rtcout = new Logbuf("FileOuttest");
System.err.println("--- Logbuf(FileOuttest) set ---");
- rtcout.println(rtcout.INFO, "--- setLevel(INFO) Not set ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string 10");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string 10");
- rtcout.println(rtcout.TRACE, "TRACE string 10");
- rtcout.println(rtcout.DEBUG, "DEBUG string 10");
- rtcout.println(rtcout.INFO, "INFO string 10");
- rtcout.println(rtcout.WARN, "WARN string 10");
- rtcout.println(rtcout.ERROR, "ERROR string 10");
- rtcout.println(rtcout.FATAL, "FATAL string 10");
- rtcout.println(rtcout.SILENT, "SILENT string 10");
+ rtcout.println(Logbuf.INFO, "--- setLevel(INFO) Not set ---");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string 10");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string 10");
+ rtcout.println(Logbuf.TRACE, "TRACE string 10");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string 10");
+ rtcout.println(Logbuf.INFO, "INFO string 10");
+ rtcout.println(Logbuf.WARN, "WARN string 10");
+ rtcout.println(Logbuf.ERROR, "ERROR string 10");
+ rtcout.println(Logbuf.FATAL, "FATAL string 10");
+ rtcout.println(Logbuf.SILENT, "SILENT string 10");
// setLevel(INFO)以ä¸ã®å
容ããåºåãããã°OK.
rtcout.setLevel("PARANOID");
System.err.println("--- Logbuf(Manager.FileOuttest) set ---");
- rtcout.println(rtcout.INFO, "--- setLevel(PARANOID) set ---");
- rtcout.println(rtcout.PARANOID, "PARANOID string 11");
- rtcout.println(rtcout.VERBOSE, "VERBOSE string 11");
- rtcout.println(rtcout.TRACE, "TRACE string 11");
- rtcout.println(rtcout.DEBUG, "DEBUG string 11");
- rtcout.println(rtcout.INFO, "INFO string 11");
- rtcout.println(rtcout.WARN, "WARN string 11");
- rtcout.println(rtcout.ERROR, "ERROR string 11");
- rtcout.println(rtcout.FATAL, "FATAL string 11");
- rtcout.println(rtcout.SILENT, "SILENT string 11");
+ rtcout.println(Logbuf.INFO, "--- setLevel(PARANOID) set ---");
+ rtcout.println(Logbuf.PARANOID, "PARANOID string 11");
+ rtcout.println(Logbuf.VERBOSE, "VERBOSE string 11");
+ rtcout.println(Logbuf.TRACE, "TRACE string 11");
+ rtcout.println(Logbuf.DEBUG, "DEBUG string 11");
+ rtcout.println(Logbuf.INFO, "INFO string 11");
+ rtcout.println(Logbuf.WARN, "WARN string 11");
+ rtcout.println(Logbuf.ERROR, "ERROR string 11");
+ rtcout.println(Logbuf.FATAL, "FATAL string 11");
+ rtcout.println(Logbuf.SILENT, "SILENT string 11");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
@@ -1187,61 +1342,85 @@
rtcout2.setLevel("INFO");
System.err.println("--- Logbuf(PortBase) set ---");
- rtcout2.println(rtcout2.INFO, "--- setLevel(INFO) Not set ---");
- rtcout2.println(rtcout2.PARANOID, "PARANOID string 20");
- rtcout2.println(rtcout2.VERBOSE, "VERBOSE string 20");
- rtcout2.println(rtcout2.TRACE, "TRACE string 20");
- rtcout2.println(rtcout2.DEBUG, "DEBUG string 20");
- rtcout2.println(rtcout2.INFO, "INFO string 20");
- rtcout2.println(rtcout2.WARN, "WARN string 20");
- rtcout2.println(rtcout2.ERROR, "ERROR string 20");
- rtcout2.println(rtcout2.FATAL, "FATAL string 20");
- rtcout2.println(rtcout2.SILENT, "SILENT string 20");
+ rtcout2.println(Logbuf.INFO, "--- setLevel(INFO) Not set ---");
+ rtcout2.println(Logbuf.PARANOID, "PARANOID string 20");
+ rtcout2.println(Logbuf.VERBOSE, "VERBOSE string 20");
+ rtcout2.println(Logbuf.TRACE, "TRACE string 20");
+ rtcout2.println(Logbuf.DEBUG, "DEBUG string 20");
+ rtcout2.println(Logbuf.INFO, "INFO string 20");
+ rtcout2.println(Logbuf.WARN, "WARN string 20");
+ rtcout2.println(Logbuf.ERROR, "ERROR string 20");
+ rtcout2.println(Logbuf.FATAL, "FATAL string 20");
+ rtcout2.println(Logbuf.SILENT, "SILENT string 20");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
rtcout2.setLevel("PARANOID");
System.err.println("--- Logbuf(PortBase) set ---");
- rtcout2.println(rtcout2.INFO, "--- setLevel(PARANOID) set ---");
- rtcout2.println(rtcout2.PARANOID, "PARANOID string 21");
- rtcout2.println(rtcout2.VERBOSE, "VERBOSE string 21");
- rtcout2.println(rtcout2.TRACE, "TRACE string 21");
- rtcout2.println(rtcout2.DEBUG, "DEBUG string 21");
- rtcout2.println(rtcout2.INFO, "INFO string 21");
- rtcout2.println(rtcout2.WARN, "WARN string 21");
- rtcout2.println(rtcout2.ERROR, "ERROR string 21");
- rtcout2.println(rtcout2.FATAL, "FATAL string 21");
- rtcout2.println(rtcout2.SILENT, "SILENT string 21");
+ rtcout2.println(Logbuf.INFO, "--- setLevel(PARANOID) set ---");
+ rtcout2.println(Logbuf.PARANOID, "PARANOID string 21");
+ rtcout2.println(Logbuf.VERBOSE, "VERBOSE string 21");
+ rtcout2.println(Logbuf.TRACE, "TRACE string 21");
+ rtcout2.println(Logbuf.DEBUG, "DEBUG string 21");
+ rtcout2.println(Logbuf.INFO, "INFO string 21");
+ rtcout2.println(Logbuf.WARN, "WARN string 21");
+ rtcout2.println(Logbuf.ERROR, "ERROR string 21");
+ rtcout2.println(Logbuf.FATAL, "FATAL string 21");
+ rtcout2.println(Logbuf.SILENT, "SILENT string 21");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
Logbuf rtcout3 = new Logbuf("PublisherFlush", "PortBase");
System.err.println("--- Logbuf(PortBase.PublisherFlush) set ---");
- rtcout3.println(rtcout3.PARANOID, "PARANOID string 22");
- rtcout3.println(rtcout3.VERBOSE, "VERBOSE string 22");
- rtcout3.println(rtcout3.TRACE, "TRACE string 22");
- rtcout3.println(rtcout3.DEBUG, "DEBUG string 22");
- rtcout3.println(rtcout3.INFO, "INFO string 22");
- rtcout3.println(rtcout3.WARN, "WARN string 22");
- rtcout3.println(rtcout3.ERROR, "ERROR string 22");
- rtcout3.println(rtcout3.FATAL, "FATAL string 22");
- rtcout3.println(rtcout3.SILENT, "SILENT string 22");
+ rtcout3.println(Logbuf.PARANOID, "PARANOID string 22");
+ rtcout3.println(Logbuf.VERBOSE, "VERBOSE string 22");
+ rtcout3.println(Logbuf.TRACE, "TRACE string 22");
+ rtcout3.println(Logbuf.DEBUG, "DEBUG string 22");
+ rtcout3.println(Logbuf.INFO, "INFO string 22");
+ rtcout3.println(Logbuf.WARN, "WARN string 22");
+ rtcout3.println(Logbuf.ERROR, "ERROR string 22");
+ rtcout3.println(Logbuf.FATAL, "FATAL string 22");
+ rtcout3.println(Logbuf.SILENT, "SILENT string 22");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
rtcout3.setLevel("PARANOID");
System.err.println("--- Logbuf(PortBase.PublisherFlush) set ---");
- rtcout3.println(rtcout3.INFO, "--- setLevel(PARANOID) set ---");
- rtcout3.println(rtcout3.PARANOID, "PARANOID string 23");
- rtcout3.println(rtcout3.VERBOSE, "VERBOSE string 23");
- rtcout3.println(rtcout3.TRACE, "TRACE string 23");
- rtcout3.println(rtcout3.DEBUG, "DEBUG string 23");
- rtcout3.println(rtcout3.INFO, "INFO string 23");
- rtcout3.println(rtcout3.WARN, "WARN string 23");
- rtcout3.println(rtcout3.ERROR, "ERROR string 23");
- rtcout3.println(rtcout3.FATAL, "FATAL string 23");
- rtcout3.println(rtcout3.SILENT, "SILENT string 23");
+ rtcout3.println(Logbuf.INFO, "--- setLevel(PARANOID) set ---");
+ rtcout3.println(Logbuf.PARANOID, "PARANOID string 23");
+ rtcout3.println(Logbuf.VERBOSE, "VERBOSE string 23");
+ rtcout3.println(Logbuf.TRACE, "TRACE string 23");
+ rtcout3.println(Logbuf.DEBUG, "DEBUG string 23");
+ rtcout3.println(Logbuf.INFO, "INFO string 23");
+ rtcout3.println(Logbuf.WARN, "WARN string 23");
+ rtcout3.println(Logbuf.ERROR, "ERROR string 23");
+ rtcout3.println(Logbuf.FATAL, "FATAL string 23");
+ rtcout3.println(Logbuf.SILENT, "SILENT string 23");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
System.err.println("--- test_manager_logbuf2() end ---");
}
+ private class LocalHandler extends Handler {
+ StringBuilder builder = new StringBuilder();
+
+ @Override
+ public void close() throws SecurityException {
+ }
+
+ @Override
+ public void flush() {
+ }
+
+ @Override
+ public void publish(LogRecord record) {
+ builder.append(record.getMessage()).append(System.getProperty("line.separator"));
+ }
+
+ public String getStr() {
+ return builder.toString();
+ }
+
+ public void clear() {
+ builder = new StringBuilder();
+ }
+ }
}
Copied: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/AdjustedClockTest.java (from rev 685, trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/AdjustedClockTest.java)
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/AdjustedClockTest.java (rev 0)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/AdjustedClockTest.java 2015-10-28 02:08:55 UTC (rev 733)
@@ -0,0 +1,44 @@
+package jp.go.aist.rtm.RTC.util;
+
+import jp.go.aist.rtm.RTC.util.clock.AdjustedClock;
+import junit.framework.TestCase;
+
+/**
+* AdjustedClockã¯ã©ã¹ããã¹ã
+* 対象ã¯ã©ã¹ï¼AdjustedClock
+*
+*/
+public class AdjustedClockTest extends TestCase {
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ /**
+ * æéãªãã»ããã®ãã¹ã
+ * setTime()ã§è¨å®ããããªãã»ãããæå¹ã¨ãªã£ã¦ããã確èªãã
+ */
+ public void test_offset() {
+ AdjustedClock clock = new AdjustedClock();
+ long msec = System.currentTimeMillis();
+ long sec = msec/1000;
+ long usec = (msec - sec*1000)*1000;
+ TimeValue time = new TimeValue(sec-30, usec);
+ clock.setTime(time);
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ //
+ long msec2 = System.currentTimeMillis();
+ long sec2 = msec2/1000;
+ long usec2 = (msec2 - sec2*1000)*1000;
+ assertEquals(sec2-30, clock.getTime().getSec());
+ assertEquals(usec2, clock.getTime().getUsec());
+ }
+
+}
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/TimeValueTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/TimeValueTest.java 2015-10-28 01:44:04 UTC (rev 732)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/TimeValueTest.java 2015-10-28 02:08:55 UTC (rev 733)
@@ -1,5 +1,8 @@
package jp.go.aist.rtm.RTC.util;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
import jp.go.aist.rtm.RTC.util.TimeValue;
import junit.framework.TestCase;
@@ -276,4 +279,25 @@
res = tm1.toDouble();
assertEquals(Double.valueOf(1.000001), Double.valueOf(res));
}
+ /**
+ * <p>ç¾å¨æå»ã®å¤æããã§ãã¯
+ * <ul>
+ * <li>ç¾å¨æå»ã®å¤æãæ£å¸¸ã«è¡ãããï¼</li>
+ * </ul>
+ */
+ public void test_date() {
+ Date date = new Date();
+ long msec = System.currentTimeMillis();
+ long sec = msec/1000;
+ long usec = (msec - sec*1000)*1000;
+ TimeValue base = new TimeValue(sec, usec);
+ double curr = base.toDouble();
+ assertEquals(sec, (long)curr);
+
+ Date convdate = new Date((long)(curr*1000));
+ SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSSSS");
+ String strCurrent = sdf1.format(date);
+ String strConv = sdf1.format(convdate);
+ assertTrue(strCurrent.equals(strConv));
+ }
}
More information about the openrtm-commit
mailing list