[openrtm-commit:00434] r575 - trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/port
openrtm @ openrtm.org
openrtm @ openrtm.org
2011年 9月 29日 (木) 17:58:01 JST
Author: fsi-katami
Date: 2011-09-29 17:58:01 +0900 (Thu, 29 Sep 2011)
New Revision: 575
Modified:
trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/port/InPortBaseTest.java
Log:
Programs for the test have been updated.
Modified: trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/port/InPortBaseTest.java
===================================================================
--- trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/port/InPortBaseTest.java 2011-09-29 07:17:01 UTC (rev 574)
+++ trunk/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/port/InPortBaseTest.java 2011-09-29 08:58:01 UTC (rev 575)
@@ -359,6 +359,28 @@
return true;
}
};
+
+ class MockInPortConnector extends InPortConnector {
+ public MockInPortConnector(ConnectorInfo profile,
+ BufferBase<OutputStream> buffer) {
+ super(profile, buffer);
+ }
+ public void setListener(ConnectorInfo profile,
+ ConnectorListeners listeners){
+ }
+ public ReturnCode disconnect() {
+ return ReturnCode.PORT_OK;
+ }
+ public void deactivate(){}; // do nothing
+ public void activate(){}; // do nothing
+ public ReturnCode read(DataRef<InputStream> data) {
+ return ReturnCode.PORT_OK;
+ }
+ public void write_test_data(double data) {
+ _data = data;
+ }
+ protected double _data = 0.0;
+ }
public static Logger m_mock_logger = null;
private ORB m_orb;
private POA m_poa;
@@ -1580,11 +1602,25 @@
NVUtil.newNV("dataport.subscription_type",
"new"));
prof.properties = holder.value;
+
+ Vector<InPortConnector> cons = inport.connectors();
+ Vector<String> ports = new Vector<String>();
+ ConnectorBase.ConnectorInfo profile
+ = new ConnectorBase.ConnectorInfo("test","id0",ports,prop);
+ InPortConnector inport_conn = null;
+ try{
+ inport_conn = new MockInPortConnector(profile,null);
+ }
+ catch(Exception ex) {
+ }
+ cons.add(inport_conn);
+
+
RTC.ReturnCode_t retcode;
- assertEquals(0,inport.get_m_connectors().size());
+ assertEquals(1,inport.get_m_connectors().size());
ConnectorProfileHolder profh = new ConnectorProfileHolder(prof);
retcode = inport.subscribeInterfaces_public(profh);
- assertEquals(0,inport.get_m_connectors().size());
+ assertEquals(1,inport.get_m_connectors().size());
assertEquals(ReturnCode_t.RTC_OK,retcode);
openrtm-commit メーリングリストの案内