use of alma.ACS.Monitorlong in project ACS by ACS-Community.
the class PropertyPrimTest method testCreateMonitorLong.
public void testCreateMonitorLong() {
// TODO do test with null callback ;)
// TODO implement...
CBlongImpl cb = new CBlongImpl();
CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
Monitorlong monitor = ROpropertyLong.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
}
use of alma.ACS.Monitorlong in project ACS by ACS-Community.
the class BCTClient method createMonitor.
/**
* TEST_2_3_3
* @param loop
*/
public void createMonitor(long loop) {
Monitorlong[] monitors = new Monitorlong[(int) loop];
ORB orb = ComponentClientSingleton.getInstance().getORB();
m_startTime = System.currentTimeMillis();
for (int i = 0; i < loop; i++) monitors[i] = m_property.create_monitor(m_cbReturned._this(orb), descIn);
m_midTime = System.currentTimeMillis();
for (int i = 0; i < loop; i++) monitors[i].destroy();
m_endTime = System.currentTimeMillis();
}
use of alma.ACS.Monitorlong in project ACS by ACS-Community.
the class BCTClient method monitors.
/**
* TEST_2_3_2 & TEST_3_3_2
* @param loop
* @param delayIn100ns
* @return
*/
public boolean monitors(long loop, long delayIn100ns) {
ORB orb = ComponentClientSingleton.getInstance().getORB();
Monitorlong monitor;
monitor = m_property.create_monitor(m_cbReturned._this(orb), descIn);
monitor.set_timer_trigger(delayIn100ns);
synchronized (m_cbReturned) {
m_cbReturned.setReturns(loop);
m_startTime = System.currentTimeMillis();
try {
m_cbReturned.wait();
} catch (InterruptedException ie) {
}
m_endTime = System.currentTimeMillis();
}
monitor.destroy();
return m_cbReturned.isDone();
}
use of alma.ACS.Monitorlong in project ACS by ACS-Community.
the class PropertySeqTest method testOnChangeMonitorLong.
public void testOnChangeMonitorLong() {
// TODO implement...
CBlongSeqImpl cb = new CBlongSeqImpl();
CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
Monitorlong monitor = ROpropertyLongSeq.create_monitor(cb._this(orb), descIn);
// disable on time trigger
monitor.set_timer_trigger(0);
try {
// sleep for 5 sec
Thread.sleep(3000);
} catch (InterruptedException ie) {
}
// TODO monitors should not come
// every change test
monitor.set_value_trigger(0, true);
// TODO change value here...
// ups RO monitor ;)
// !!! TMP - tested with backdoor via alarm_high_on()...
ROpropertyLongSeq.alarm_high_on();
try {
Thread.sleep(3000);
} catch (InterruptedException ie) {
}
// disable test
monitor.set_value_trigger(0, false);
ROpropertyLongSeq.alarm_high_on();
try {
Thread.sleep(3000);
} catch (InterruptedException ie) {
}
monitor.set_value_trigger(0, true);
ROpropertyLongSeq.alarm_high_on();
try {
Thread.sleep(3000);
} catch (InterruptedException ie) {
}
System.out.println("------");
// disable test
monitor.suspend();
ROpropertyLongSeq.alarm_high_on();
try {
Thread.sleep(3000);
} catch (InterruptedException ie) {
}
// / ... this should revive it
monitor.resume();
System.out.println("------");
ROpropertyLongSeq.alarm_high_on();
try {
Thread.sleep(3000);
} catch (InterruptedException ie) {
}
synchronized (cb) {
try {
monitor.destroy();
// wait for 3s
cb.wait(3000);
} catch (InterruptedException ie) {
}
}
// TODO test if done was called
}
use of alma.ACS.Monitorlong 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
}
Aggregations