use of alma.jconttest.util.JconttestUtil in project ACS by ACS-Community.
the class DummyComponentWrapperImpl method _callDummyComponentWithTime.
public boolean _callDummyComponentWithTime(int timeInMillisec, String targetComponentName) throws AcsJCouldntPerformActionEx {
DummyComponent dummyComponent = null;
try {
org.omg.CORBA.Object compObj = null;
if (targetComponentName != null) {
compObj = m_containerServices.getComponent(targetComponentName);
} else {
compObj = m_containerServices.getDefaultComponent(DUMMYCOMP_TYPENAME);
}
dummyComponent = DummyComponentHelper.narrow(compObj);
} catch (Exception e) {
m_logger.log(Level.SEVERE, "Failed to access target component.", e);
throw new AcsJCouldntPerformActionEx();
}
targetComponentName = dummyComponent.name();
// If the given time is less than 0, then we call "callThatTakesSomeTime" with a time larger than the ORB-level timeout.
if (timeInMillisec < 0) {
JconttestUtil util = new JconttestUtil(m_containerServices);
int orbLevelTimeoutMillis = util.getSystemLevelOrbTimeoutMillis();
timeInMillisec = orbLevelTimeoutMillis + 1000;
}
try {
dummyComponent.callThatTakesSomeTime(timeInMillisec);
m_logger.info("Did NOT get org.omg.CORBA.TIMEOUT in call " + targetComponentName + "#callThatTakesSomeTime(" + timeInMillisec + ")");
return false;
} catch (org.omg.CORBA.TIMEOUT e) {
m_logger.info("Got org.omg.CORBA.TIMEOUT in call " + targetComponentName + "#callThatTakesSomeTime(" + timeInMillisec + ")");
return true;
}
}
use of alma.jconttest.util.JconttestUtil in project ACS by ACS-Community.
the class ClientPendingReplyTimeoutTest method setUp.
protected void setUp() throws Exception {
super.setUp();
jconttestUtil = new JconttestUtil(getContainerServices());
}
use of alma.jconttest.util.JconttestUtil in project ACS by ACS-Community.
the class ContainerClientPendingReplyTimeoutTest method setUp.
protected void setUp() throws Exception {
super.setUp();
jconttestUtil = new JconttestUtil(getContainerServices());
syslevelOrbTimeoutSec = jconttestUtil.getSystemLevelOrbTimeoutMillis() / 1000;
assertEquals("system-level jacorb timeout has changed (in orb.properties or cmd line). Please verify that this test still works as intended!", syslevelOrbTimeoutSecDefined, syslevelOrbTimeoutSec);
syslevelOrbTimeoutSecDefault = (int) new Container().getTimeout();
}
Aggregations