Search in sources :

Example 1 with JconttestUtil

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;
    }
}
Also used : DummyComponent(alma.jconttest.DummyComponent) JconttestUtil(alma.jconttest.util.JconttestUtil) AcsJCouldntPerformActionEx(alma.ACSErrTypeCommon.wrappers.AcsJCouldntPerformActionEx)

Example 2 with JconttestUtil

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());
}
Also used : JconttestUtil(alma.jconttest.util.JconttestUtil)

Example 3 with JconttestUtil

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();
}
Also used : Container(alma.maci.containerconfig.Container) JconttestUtil(alma.jconttest.util.JconttestUtil)

Aggregations

JconttestUtil (alma.jconttest.util.JconttestUtil)3 AcsJCouldntPerformActionEx (alma.ACSErrTypeCommon.wrappers.AcsJCouldntPerformActionEx)1 DummyComponent (alma.jconttest.DummyComponent)1 Container (alma.maci.containerconfig.Container)1