[openrtm-commit:01026] r700 - in trunk: . jp.go.aist.rtm.RTC jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext
openrtm @ openrtm.org
openrtm @ openrtm.org
2013年 3月 1日 (金) 23:00:05 JST
Author: ga
Date: 2013-03-01 23:00:05 +0900 (Fri, 01 Mar 2013)
New Revision: 700
Removed:
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaObjectManagerTest.java
Modified:
trunk/buildInstaller.bat
trunk/buildPackage.sh
trunk/buildRTC.bat
trunk/buildRTC.sh
trunk/buildTests.sh
trunk/jp.go.aist.rtm.RTC/build.xml
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/AllTests.java
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConfigSampleTest.java
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleInTest.java
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleOutTest.java
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaNamingTest.java
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ManagerTest.java
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceConsumerTest.java
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceProviderTest.java
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingManagerTest.java
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingOnCorbaTest.java
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqInTest.java
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqOutTest.java
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContextTests.java
Log:
update to 1.1.0.
Modified: trunk/buildInstaller.bat
===================================================================
--- trunk/buildInstaller.bat 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/buildInstaller.bat 2013-03-01 14:00:05 UTC (rev 700)
@@ -1,18 +1,10 @@
-set DUMMY=%ANT_HOME%
- at rem set ANT_HOME=%ECLIPSE_HOME%\plugins\org.apache.ant_1.6.5\
- at rem set ANT_HOME=%ECLIPSE_HOME%\plugins\org.apache.ant_1.7.0.v200706080842\
-set ANT_HOME=%ECLIPSE_HOME%\plugins\org.apache.ant_1.8.3.v20120321-1730\
-
-
cd jp.go.aist.rtm.RTC
-call ant javaInstaller -lib %ECLIPSE_HOME%\plugins\net.sf.ant4eclipse.plugin_0.5.0.rc1\lib\
+call ant javaInstaller -lib %ANT_HOME%\lib\
if ERRORLEVEL 1 goto error_end
cd ..
-set ANT_HOME=%DUMMY%
exit /b 0
:error_end
cd ..
-set ANT_HOME=%DUMMY%
exit /b 1
Modified: trunk/buildPackage.sh
===================================================================
--- trunk/buildPackage.sh 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/buildPackage.sh 2013-03-01 14:00:05 UTC (rev 700)
@@ -2,11 +2,39 @@
#
#
-DUMMY=$ANT_HOME
-export ANT_HOME=$ECLIPSE_HOME/plugins/org.apache.ant_1.6.5/
+#------------------------------------------------------------
+# find_anthome
+#
+# This function estimate ANT_HOME from ant, which usually
+# is a symbolic link to $ANT_HOME/bin/ant.
+#------------------------------------------------------------
+find_anthome()
+{
+ if test ! "x$ANT_HOME" = "x" ; then
+ if test -d $ANT_HOME && test -f $ANT_HOME/bin/ant ; then
+ return 0
+ fi
+ echo "ant cannot be found under ANT_HOME: $ANT_HOME"
+ fi
+ echo "Valid Environment variable ANT_HOME is not set. Searching..."
+ tmp=`readlink -e $(which ant)`
+ ant_path=`dirname $tmp | sed 's/\/bin$//'`
+ if test "x$ant_path" = "x" ; then
+ echo "Ant not found. Please install Ant and set ANT_HOME."
+ exit 1
+ fi
+ export ANT_HOME=$ant_path
+ return 0
+}
-
+find_anthome
+echo "------------------------------------------------------------"
+echo "Environment variables:"
+echo "ANT_HOME: $ANT_HOME"
+echo "------------------------------------------------------------"
+
+
if test $# -eq 0 ; then
var_for="dist"
else
@@ -17,14 +45,10 @@
#
#
cd jp.go.aist.rtm.RTC
-ant $var_for -lib $ECLIPSE_HOME/plugins/net.sf.ant4eclipse.plugin_0.5.0.rc1/lib/ -lib $ECLIPSE_HOME/plugins/org.apache.ant_1.7.0.v200803061910/lib
+ant $var_for -lib $ANT_HOME/lib/
if [ $? -ne 0 ];
then
exit 1
fi
echo "--"
cd ..
-
-export ANT_HOME=$DUMMY
-
-
Modified: trunk/buildRTC.bat
===================================================================
--- trunk/buildRTC.bat 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/buildRTC.bat 2013-03-01 14:00:05 UTC (rev 700)
@@ -1,18 +1,10 @@
-set DUMMY=%ANT_HOME%
- at rem set ANT_HOME=%ECLIPSE_HOME%\plugins\org.apache.ant_1.6.5\
- at rem set ANT_HOME=%ECLIPSE_HOME%\plugins\org.apache.ant_1.7.0.v200706080842\
-set ANT_HOME=%ECLIPSE_HOME%\plugins\org.apache.ant_1.8.3.v20120321-1730\
-
-
cd jp.go.aist.rtm.RTC
-call ant buildAll -lib %ECLIPSE_HOME%\plugins\net.sf.ant4eclipse.plugin_0.5.0.rc1\lib\
+call ant buildAll -lib %ANT_HOME%\lib\
if ERRORLEVEL 1 goto error_end
cd ..
-set ANT_HOME=%DUMMY%
exit /b 0
:error_end
cd ..
-set ANT_HOME=%DUMMY%
exit /b 1
Modified: trunk/buildRTC.sh
===================================================================
--- trunk/buildRTC.sh 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/buildRTC.sh 2013-03-01 14:00:05 UTC (rev 700)
@@ -2,11 +2,39 @@
#
#
-DUMMY=$ANT_HOME
-export ANT_HOME=$ECLIPSE_HOME/plugins/org.apache.ant_1.6.5/
+#------------------------------------------------------------
+# find_anthome
+#
+# This function estimate ANT_HOME from ant, which usually
+# is a symbolic link to $ANT_HOME/bin/ant.
+#------------------------------------------------------------
+find_anthome()
+{
+ if test ! "x$ANT_HOME" = "x" ; then
+ if test -d $ANT_HOME && test -f $ANT_HOME/bin/ant ; then
+ return 0
+ fi
+ echo "ant cannot be found under ANT_HOME: $ANT_HOME"
+ fi
+ echo "Valid Environment variable ANT_HOME is not set. Searching..."
+ tmp=`readlink -e $(which ant)`
+ ant_path=`dirname $tmp | sed 's/\/bin$//'`
+ if test "x$ant_path" = "x" ; then
+ echo "Ant not found. Please install Ant and set ANT_HOME."
+ exit 1
+ fi
+ export ANT_HOME=$ant_path
+ return 0
+}
-
+find_anthome
+echo "------------------------------------------------------------"
+echo "Environment variables:"
+echo "ANT_HOME: $ANT_HOME"
+echo "------------------------------------------------------------"
+
+
if test $# -eq 0 ; then
var_for="buildAllLinux"
else
@@ -17,15 +45,10 @@
#
#
cd jp.go.aist.rtm.RTC
-#ant buildAllLinux -lib $ECLIPSE_HOME/plugins/net.sf.ant4eclipse.plugin_0.5.0.rc1/lib/
-ant $var_for -lib $ECLIPSE_HOME/plugins/net.sf.ant4eclipse.plugin_0.5.0.rc1/lib/ -lib $ECLIPSE_HOME/plugins/org.apache.ant_1.7.0.v200803061910/lib
+ant $var_for -lib $ANT_HOME/lib
if [ $? -ne 0 ];
then
exit 1
fi
echo "--"
cd ..
-
-export ANT_HOME=$DUMMY
-
-
Modified: trunk/buildTests.sh
===================================================================
--- trunk/buildTests.sh 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/buildTests.sh 2013-03-01 14:00:05 UTC (rev 700)
@@ -3,22 +3,48 @@
#
-set DUMMY=$ANT_HOME
-export ANT_HOME=$ECLIPSE_HOME/plugins/org.apache.ant_1.6.5/
+#------------------------------------------------------------
+# find_anthome
+#
+# This function estimate ANT_HOME from ant, which usually
+# is a symbolic link to $ANT_HOME/bin/ant.
+#------------------------------------------------------------
+find_anthome()
+{
+ if test ! "x$ANT_HOME" = "x" ; then
+ if test -d $ANT_HOME && test -f $ANT_HOME/bin/ant ; then
+ return 0
+ fi
+ echo "ant cannot be found under ANT_HOME: $ANT_HOME"
+ fi
+ echo "Valid Environment variable ANT_HOME is not set. Searching..."
+ tmp=`readlink -e $(which ant)`
+ ant_path=`dirname $tmp | sed 's/\/bin$//'`
+ if test "x$ant_path" = "x" ; then
+ echo "Ant not found. Please install Ant and set ANT_HOME."
+ exit 1
+ fi
+ export ANT_HOME=$ant_path
+ return 0
+}
+find_anthome
+
+export JUNIT_HOME=$ANT_HOME/lib
+echo "------------------------------------------------------------"
+echo "Environment variables:"
+echo "ANT_HOME: $ANT_HOME"
+echo "------------------------------------------------------------"
+
+
#
#
#
cd jp.go.aist.rtm.RTC
-ant buildTests -lib $ECLIPSE_HOME/plugins/net.sf.ant4eclipse.plugin_0.5.0.rc1/lib/ -lib $JUNIT_HOME/junit.jar
+ant buildTests -lib $ANT_HOME/lib/
if [ $? -ne 0 ];
then
exit 1
fi
echo "--"
cd ..
-
-set ANT_HOME=$DUMMY
-
-
-
Modified: trunk/jp.go.aist.rtm.RTC/build.xml
===================================================================
--- trunk/jp.go.aist.rtm.RTC/build.xml 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/build.xml 2013-03-01 14:00:05 UTC (rev 700)
@@ -802,8 +802,12 @@
<target name="compile_tests" description="ソースをコンパイルします">
- <javac srcdir="${source.sdo}:${source.rtc}:${source.rtm}:${source.openrtm}:${source.main}:${source.examples}:${source.test}:${source.tests.bind}" destdir="${build.dir.test}" classpath="lib/commons-cli-1.1.jar:${env.JUNIT_HOME}/junit.jar:" encoding="UTF-8" />
+ <javac srcdir="${source.sdo}:${source.rtc}:${source.rtm}:${source.openrtm}" destdir="${build.dir.test}" classpath="lib/commons-cli-1.1.jar" encoding="UTF-8" />
+ <javac srcdir="${source.main}" destdir="${build.dir.test}" classpath="lib/commons-cli-1.1.jar" encoding="UTF-8" includes="go/aist/**" excludes="go/aist/ForSunOrb/**,go/aist/ForJacOrb/**"/>
+
+ <javac srcdir="${source.examples}:${source.extension}:${source.test}:${source.tests.bind}" destdir="${build.dir.test}" classpath="lib/commons-cli-1.1.jar:${env.JUNIT_HOME}/junit.jar" encoding="UTF-8" debug="on"/>
+
</target>
@@ -822,19 +826,21 @@
<pathelement location="${env.JUNIT_HOME}/junit.jar"/>
<pathelement location="${env.ANT_HOME}/lib/ant-junit.jar"/>
</classpath>
+ <test name="jp.go.aist.rtm.AllTest110"/>
<!--
<test name="jp.go.aist.rtm.RTC.FactoryTest"/>
<test name="jp.go.aist.rtm.RTC.StateMachineTests"/>
-->
+ <!--
<batchtest todir="${build.dir.test}/reports">
<fileSet dir="${build.dir.test}">
- <include name="jp/go/aist/rtm/RTC/*Test.class" />
<include name="jp/go/aist/rtm/RTC/*Tests.class" />
<include name="jp/go/aist/rtm/RTC/**/*Test.class" />
<include name="jp/go/aist/rtm/RTC/**/*Tests.class" />
<exclude name="jp/go/aist/rtm/RTC/SampleTest.class" />
</fileSet>
</batchtest>
+ -->
</junit>
<echo>All Test complete!</echo>
</target>
Modified: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/AllTests.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/AllTests.java 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/AllTests.java 2013-03-01 14:00:05 UTC (rev 700)
@@ -6,7 +6,6 @@
import jp.go.aist.rtm.RTC.ConsoleInTest;
import jp.go.aist.rtm.RTC.ConsoleOutTest;
import jp.go.aist.rtm.RTC.CorbaNamingTest;
-import jp.go.aist.rtm.RTC.CorbaObjectManagerTest;
import jp.go.aist.rtm.RTC.FactoryTest;
import jp.go.aist.rtm.RTC.ManagerConfigTest;
import jp.go.aist.rtm.RTC.ManagerTest;
@@ -75,7 +74,6 @@
suite.addTestSuite(ConfigTest.class);
suite.addTestSuite(CorbaConsumerTest.class);
suite.addTestSuite(CorbaNamingTest.class);
- suite.addTestSuite(CorbaObjectManagerTest.class);
suite.addTestSuite(CorbaPortTest.class);
suite.addTestSuite(DataHolderTest.class);
suite.addTestSuite(DataInPortTest.class);
Modified: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConfigSampleTest.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConfigSampleTest.java 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConfigSampleTest.java 2013-03-01 14:00:05 UTC (rev 700)
@@ -67,7 +67,6 @@
}
protected void tearDown() throws Exception {
for(int intIdx=0;intIdx<manager.m_ecs.size();intIdx++) {
- manager.m_ecs.elementAt(intIdx).stop();
Thread.yield();
}
Thread.sleep(300);
Modified: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleInTest.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleInTest.java 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleInTest.java 2013-03-01 14:00:05 UTC (rev 700)
@@ -61,7 +61,6 @@
}
protected void tearDown() throws Exception {
for(int intIdx=0;intIdx<manager.m_ecs.size();intIdx++) {
- manager.m_ecs.elementAt(intIdx).stop();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Modified: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleOutTest.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleOutTest.java 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleOutTest.java 2013-03-01 14:00:05 UTC (rev 700)
@@ -61,7 +61,6 @@
}
protected void tearDown() throws Exception {
for(int intIdx=0;intIdx<manager.m_ecs.size();intIdx++) {
- manager.m_ecs.elementAt(intIdx).stop();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Modified: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaNamingTest.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaNamingTest.java 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaNamingTest.java 2013-03-01 14:00:05 UTC (rev 700)
@@ -93,7 +93,6 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
naming.bindByString("localhost3.host_cxt/mgr3.mgr_cxt/sample3.rtc", rtobj.getObjRef());
@@ -156,7 +155,6 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
// オブジェクトをバインドし、それが正しく設定されるか?
@@ -185,7 +183,6 @@
naming.init("localhost:2809");
assertNotNull(naming.m_rootContext);
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
naming.rebindByString("localhost.host_cxt/mgr.mgr_cxt/sample.rtc", rtobj.getObjRef());
@@ -243,7 +240,6 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
final String fullName0 = "id0-lv0.kind0-lv0/id0-lv1.kind0-lv1";
@@ -274,7 +270,6 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
// オブジェクトをバインドし、それが正しく設定されるか?
@@ -308,7 +303,6 @@
naming.init("localhost:2809");
assertNotNull(naming.m_rootContext);
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
naming.bindByString("localhost.host_cxt", rtobj.getObjRef());
// naming.bindByString("localhost.host_cxt", rtobj.getObjRef());
@@ -345,11 +339,9 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
rtobj2 = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj2);
assertNotNull(rtobj2.getObjRef());
// オブジェクトをバインドし、それが正しく設定されるか?
@@ -379,10 +371,8 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
rtobj2= new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj2);
assertNotNull(rtobj2.getObjRef());
// オブジェクトをバインドし、それが正しく設定されるか?
@@ -422,11 +412,9 @@
// テスト用にバインドするオブジェクトを作成しておく
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
rtobj2 = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj2);
assertNotNull(rtobj2.getObjRef());
// 1つ目のオブジェクトをバインドする
@@ -455,7 +443,6 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
// テストに用いるコンテキストを準備しておく
@@ -499,7 +486,6 @@
// バインドするコンテキストを作成しておく
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
NamingContext nc = naming.newContext();
@@ -531,10 +517,8 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
rtobj2 = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj2);
assertNotNull(rtobj2.getObjRef());
NamingContext nc1 = naming.newContext();
@@ -581,11 +565,9 @@
// テストに用いるコンテキストを準備しておく
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
rtobj2 = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj2);
assertNotNull(rtobj2.getObjRef());
NamingContext nc1 = naming.newContext();
@@ -623,7 +605,6 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
// オブジェクトをバインドする
@@ -661,7 +642,6 @@
naming.init("localhost:2809");
assertNotNull(naming.m_rootContext);
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
naming.rebindByString("localhost2.host_cxt2/mgr2/sample2.rtc2", rtobj.getObjRef());
@@ -884,7 +864,6 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
- manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
// 新しいコンテキストをバインドできるか?
Deleted: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaObjectManagerTest.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaObjectManagerTest.java 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaObjectManagerTest.java 2013-03-01 14:00:05 UTC (rev 700)
@@ -1,112 +0,0 @@
-package jp.go.aist.rtm.RTC;
-
-import junit.framework.TestCase;
-
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.ORBPackage.InvalidName;
-import org.omg.PortableServer.POA;
-import org.omg.PortableServer.POAManager;
-import org.omg.PortableServer.POAManagerPackage.AdapterInactive;
-import org.omg.PortableServer.POAPackage.ObjectNotActive;
-import org.omg.PortableServer.POAPackage.ServantAlreadyActive;
-import org.omg.PortableServer.POAPackage.ServantNotActive;
-import org.omg.PortableServer.POAPackage.WrongPolicy;
-
-/**
-*
-* CORBAオブジェクトマネージャクラス テスト
-* 対象クラス:CorbaObjectManager
-*
-*/
-public class CorbaObjectManagerTest extends TestCase {
- private CorbaObjectManager objManager;
- private POA m_POA;
- private ORB m_ORB;
-
- protected void setUp() throws Exception {
- super.setUp();
- String[] argv = new String[0];
- // (1-1) ORBの初期化
- java.util.Properties props = new java.util.Properties();
- m_ORB = ORB.init(argv, props);
-
- // (1-2) POAManagerのactivate
- try {
- m_POA = org.omg.PortableServer.POAHelper.narrow(
- m_ORB.resolve_initial_references("RootPOA"));
- } catch (InvalidName e1) {
- e1.printStackTrace();
- fail();
- }
- POAManager pman = m_POA.the_POAManager();
- try {
- pman.activate();
- } catch (AdapterInactive e1) {
- e1.printStackTrace();
- fail();
- }
- objManager = new CorbaObjectManager(m_ORB, m_POA);
- }
- protected void tearDown() throws Exception {
- super.tearDown();
- if( m_ORB != null) {
- m_ORB.destroy();
- m_ORB = null;
- }
- }
-
- /**
- * <p>RTObjectのActivate/Deactivate
- * <ul>
- * <li>RTObjectをActivateできるか?</li>
- * <li>RTObjectをDeactivateできるか?</li>
- * </ul>
- * </p>
- */
- public void test_activate_deactivate_rtobject() {
- Manager manager = Manager.instance();
- RTObject_impl rtobject = new RTObject_impl(manager);
- try {
- rtobject._this();
- fail();
- } catch ( Exception ex ) {
- }
- try {
- // RTObjectをアクティブ化する
- objManager.activate(rtobject);
- assertNotNull(rtobject._this());
- // RTObjectに参照が設定されているか確認することでアクティブ化の成功を確認する
- assertNotNull(rtobject.getObjRef());
- rtobject.get_sdo_id();
- } catch (ServantAlreadyActive e) {
- e.printStackTrace();
- fail();
- } catch (WrongPolicy e) {
- e.printStackTrace();
- fail();
- } catch (ObjectNotActive e) {
- e.printStackTrace();
- fail();
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- try {
- // 非アクティブ化する
- objManager.deactivate(rtobject);
- } catch (ServantNotActive e) {
- e.printStackTrace();
- fail();
- } catch (WrongPolicy e) {
- e.printStackTrace();
- fail();
- } catch (ObjectNotActive e) {
- e.printStackTrace();
- fail();
- }
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- }
- }
-}
Modified: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ManagerTest.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ManagerTest.java 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ManagerTest.java 2013-03-01 14:00:05 UTC (rev 700)
@@ -1097,7 +1097,6 @@
assertNotNull(manager.getORB());
assertNotNull(manager.getPOA());
assertNotNull(manager.getPOAManager());
- assertNotNull(manager.m_objManager);
}
/**
@@ -1170,7 +1169,6 @@
assertNotNull(manager.getORB());
assertNotNull(manager.getPOA());
assertNotNull(manager.getPOAManager());
- assertNotNull(manager.m_objManager);
assertNotNull(manager.m_namingManager);
assertNotNull(manager.m_module);
assertNotNull(manager.m_terminator);
Modified: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceConsumerTest.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceConsumerTest.java 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceConsumerTest.java 2013-03-01 14:00:05 UTC (rev 700)
@@ -62,10 +62,6 @@
comp = manager.createComponent("MyServiceConsumer");
}
protected void tearDown() throws Exception {
- for(int intIdx=0;intIdx<manager.m_ecs.size();intIdx++) {
- manager.m_ecs.elementAt(intIdx).stop();
- Thread.yield();
- }
Thread.sleep(300);
manager.shutdownComponents();
manager.shutdownNaming();
Modified: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceProviderTest.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceProviderTest.java 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceProviderTest.java 2013-03-01 14:00:05 UTC (rev 700)
@@ -62,10 +62,6 @@
comp = manager.createComponent("MyServiceProvider");
}
protected void tearDown() throws Exception {
- for(int intIdx=0;intIdx<manager.m_ecs.size();intIdx++) {
- manager.m_ecs.elementAt(intIdx).stop();
- Thread.yield();
- }
Thread.sleep(300);
manager.shutdownComponents();
manager.shutdownNaming();
Modified: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingManagerTest.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingManagerTest.java 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingManagerTest.java 2013-03-01 14:00:05 UTC (rev 700)
@@ -96,10 +96,7 @@
*/
public void test_bindObject_and_unbindObject() throws Exception {
- // バインドするオブジェクトを作成しておく
- CorbaObjectManager objMgr = new CorbaObjectManager(m_pORB, m_pPOA);
RTObject_impl rto = new RTObject_impl(m_pORB, m_pPOA);
-// objMgr.activate(rto);
assertNotNull(rto.getObjRef());
ManagerServant mgs = new ManagerServant();
@@ -127,7 +124,6 @@
mgs = null;
rto = null;
- objMgr = null;
}
/**
@@ -139,15 +135,10 @@
*/
public void test_unbindAll() throws Exception {
- // バインドするオブジェクトを作成しておく
- CorbaObjectManager objMgr = new CorbaObjectManager(m_pORB, m_pPOA);
-
RTObject_impl rto1 = new RTObject_impl(m_pORB, m_pPOA);
-// objMgr.activate(rto1);
assertNotNull(rto1.getObjRef());
RTObject_impl rto2 = new RTObject_impl(m_pORB, m_pPOA);
-// objMgr.activate(rto2);
assertNotNull(rto2.getObjRef());
ManagerServant mgs1 = new ManagerServant();
@@ -187,7 +178,6 @@
mgs1 = null;
rto2 = null;
rto1 = null;
- objMgr = null;
}
/**
@@ -199,15 +189,10 @@
*/
public void test_getObjects() throws Exception {
- // バインドするオブジェクトを作成しておく
- CorbaObjectManager objMgr = new CorbaObjectManager(m_pORB, m_pPOA);
-
RTObject_impl rto1 = new RTObject_impl(m_pORB, m_pPOA);
-// objMgr.activate(rto1);
assertNotNull(rto1.getObjRef());
RTObject_impl rto2 = new RTObject_impl(m_pORB, m_pPOA);
-// objMgr.activate(rto2);
assertNotNull(rto2.getObjRef());
// NamingManagerを生成する
@@ -232,7 +217,6 @@
rto2 = null;
rto1 = null;
- objMgr = null;
}
/**
@@ -255,11 +239,7 @@
String kind = new String("kind"+Integer.toString(num));
String idkind = id + "." + kind;
- // バインドするオブジェクトを作成しておく
- CorbaObjectManager objMgr = new CorbaObjectManager(m_pORB, m_pPOA);
-
RTObject_impl rto = new RTObject_impl(m_pORB, m_pPOA);
-// objMgr.activate(rto);
assertNotNull(rto.getObjRef());
@@ -285,7 +265,6 @@
rto = null;
- objMgr = null;
nmgr = null;
}
Modified: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingOnCorbaTest.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingOnCorbaTest.java 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingOnCorbaTest.java 2013-03-01 14:00:05 UTC (rev 700)
@@ -57,10 +57,7 @@
final String name_server = "localhost:2809";
NamingOnCorba noc = new NamingOnCorba(m_pORB, name_server);
- // バインドするオブジェクトを作成しておく
- CorbaObjectManager objMgr = new CorbaObjectManager(m_pORB, m_pPOA);
RTObject_impl rto = new RTObject_impl(m_pORB, m_pPOA);
-// objMgr.activate(rto);
assertNotNull(rto.getObjRef());
// RTObject_implオブジェクトをバインドできるか?
@@ -83,7 +80,6 @@
nc.resolve(name);
fail("Exception not thrown.");
} catch (Exception expected) {}
- objMgr.deactivate(rto);
}
/**
@@ -98,10 +94,7 @@
final String name_server = "localhost:2809";
NamingOnCorba noc = new NamingOnCorba(m_pORB, name_server);
- // バインドするオブジェクトを作成しておく
- CorbaObjectManager objMgr = new CorbaObjectManager(m_pORB, m_pPOA);
ManagerServant rto = new ManagerServant();
-// objMgr.activate(rto);
assertNotNull(rto.getObjRef());
// RTObject_implオブジェクトをバインドできるか?
@@ -124,7 +117,6 @@
nc.resolve(name);
fail("Exception not thrown.");
} catch (Exception expected) {}
- objMgr.deactivate(rto);
}
}
Modified: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqInTest.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqInTest.java 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqInTest.java 2013-03-01 14:00:05 UTC (rev 700)
@@ -60,10 +60,6 @@
comp = manager.createComponent("SeqIn");
}
protected void tearDown() throws Exception {
- for(int intIdx=0;intIdx<manager.m_ecs.size();intIdx++) {
- manager.m_ecs.elementAt(intIdx).stop();
- Thread.yield();
- }
Thread.sleep(600);
manager.shutdownComponents();
manager.shutdownNaming();
Modified: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqOutTest.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqOutTest.java 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqOutTest.java 2013-03-01 14:00:05 UTC (rev 700)
@@ -60,10 +60,6 @@
comp = manager.createComponent("SeqOut");
}
protected void tearDown() throws Exception {
- for(int intIdx=0;intIdx<manager.m_ecs.size();intIdx++) {
- manager.m_ecs.elementAt(intIdx).stop();
- Thread.yield();
- }
Thread.sleep(600);
manager.shutdownComponents();
manager.shutdownNaming();
Modified: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContextTests.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContextTests.java 2013-02-28 14:36:04 UTC (rev 699)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContextTests.java 2013-03-01 14:00:05 UTC (rev 700)
@@ -461,6 +461,7 @@
// ExecutionContextにRTObjectを登録する
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
+ ec.m_worker.updateComponentList();
try {
Thread.sleep(100);
More information about the openrtm-commit
mailing list