Search in sources :

Example 56 with CBDescIn

use of alma.ACS.CBDescIn in project ACS by ACS-Community.

the class PropertySeqTest method testCreateMonitorLong.

public void testCreateMonitorLong() {
    // TODO do test with null callback ;)
    // TODO implement...
    CBlongSeqImpl cb = new CBlongSeqImpl();
    CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
    Monitorlong monitor = ROpropertyLongSeq.create_monitor(cb._this(orb), descIn);
    try {
        // 10.5 sec
        Thread.sleep(10500);
    } catch (InterruptedException ie) {
    }
    synchronized (cb) {
        try {
            monitor.destroy();
            // wait for 3s
            cb.wait(3000);
        } catch (InterruptedException ie) {
        }
    }
// TODO test if done was called
}
Also used : Monitorlong(alma.ACS.Monitorlong) CBDescIn(alma.ACS.CBDescIn)

Example 57 with CBDescIn

use of alma.ACS.CBDescIn in project ACS by ACS-Community.

the class MyTestCBvoid method testActivateOffShoot.

public void testActivateOffShoot() throws Exception {
    // activate callback object
    MyTestCBvoid cb = new MyTestCBvoid(m_logger);
    m_logger.info("MyTestCBvoid instantiated...");
    CBvoid cbvoid = alma.ACS.CBvoidHelper.narrow(getContainerServices().activateOffShoot(cb));
    m_logger.info("MyTestCBvoid activated.");
    // activate dal listener object
    m_logger.info("activating dal listener offshoot...");
    DALChangeListenerPOA dalListenerSrv = new MyTestDALChangeListener();
    OffShoot offshoot2 = getContainerServices().activateOffShoot(dalListenerSrv);
    DALChangeListener dalListenerRef = DALChangeListenerHelper.narrow(offshoot2);
    m_logger.info("done activating dal listener offshoot.");
    // check if dal listener works...
    m_logger.info("calling dal listener...");
    dalListenerRef.object_changed("happyCurl");
    m_logger.info("done calling dal listener.");
    // check if callback works...
    RWdouble brightness = null;
    Lamp lamp = LampHelper.narrow(getContainerServices().getComponent(m_lampCurl));
    assertNotNull("reference to Lamp component not null", lamp);
    brightness = lamp.brightness();
    assertNotNull("brightness property of lamp not null", brightness);
    CBDescIn desc = new CBDescIn();
    m_logger.info("m_desc instantiated...");
    m_logger.info("before setting callback...");
    brightness.set_async(7.345, cbvoid, desc);
    m_logger.finer("callback set...");
//todo: do something and get feedback from the callback object		
//		m_logger.finer("changing value (sync)...");
//		brightness.set_sync(8.456);
}
Also used : DALChangeListenerPOA(com.cosylab.CDB.DALChangeListenerPOA) RWdouble(alma.ACS.RWdouble) OffShoot(alma.ACS.OffShoot) DALChangeListener(com.cosylab.CDB.DALChangeListener) Lamp(alma.acsexmplLamp.Lamp) CBvoid(alma.ACS.CBvoid) CBDescIn(alma.ACS.CBDescIn)

Aggregations

CBDescIn (alma.ACS.CBDescIn)57 CompletionHolder (alma.ACSErr.CompletionHolder)11 Monitordouble (alma.ACS.Monitordouble)10 Completion (alma.ACSErr.Completion)7 Callback (alma.ACS.Callback)6 BACIDispatchAction (alma.ACS.jbaci.BACIDispatchAction)6 NO_IMPLEMENT (org.omg.CORBA.NO_IMPLEMENT)6 RWdouble (alma.ACS.RWdouble)5 Monitorfloat (alma.ACS.Monitorfloat)4 Monitorlong (alma.ACS.Monitorlong)4 ROdouble (alma.ACS.ROdouble)3 OffShoot (alma.ACS.OffShoot)2 LampUnavailable (alma.demo.LampUnavailable)2 NoPermissionEx (alma.maciErrType.NoPermissionEx)2 POAManager (org.omg.PortableServer.POAManager)2 ClientInfo (si.ijs.maci.ClientInfo)2 Manager (si.ijs.maci.Manager)2 CBDescOut (alma.ACS.CBDescOut)1 CBdouble (alma.ACS.CBdouble)1 CBlongPOA (alma.ACS.CBlongPOA)1