use of alma.ACS.CBDescIn in project ACS by ACS-Community.
the class PropertySeqTest method testNewSubscriptionAlarm.
public void testNewSubscriptionAlarm() {
try {
CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
ROpropertyDoubleSeq.new_subscription_Alarm(null, descIn);
fail("NO_IMPLEMENT exception expected");
} catch (NO_IMPLEMENT ex) {
// OK
}
}
use of alma.ACS.CBDescIn in project ACS by ACS-Community.
the class PropertySeqTest method testGetAsyncDoubleRW.
public void testGetAsyncDoubleRW() {
CBdoubleSeqImpl cb = new CBdoubleSeqImpl();
CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
synchronized (cb) {
RWpropertyDoubleSeq.get_async(cb._this(orb), descIn);
try {
// wait for 5s
cb.wait(5000);
} catch (InterruptedException ie) {
}
}
// only 1 response is expected
assertEquals(1, cb.getResponseQueue().size());
CBResponse response = (CBResponse) cb.getResponseQueue().firstElement();
// check reponse type
assertEquals(CBResponse.DONE_TYPE, response.type);
// check value
// TODO check value
//assertEquals(property.default_value(), response.value, 0.0);
// check descriptor
assertEquals(descIn.id_tag, response.desc.id_tag);
// check completion
assertEquals(0, response.completion.code);
assertEquals(0, response.completion.type);
assertEquals(0, response.completion.previousError.length);
// less than 5s
assertTrue((UTCUtility.utcJavaToOmg(System.currentTimeMillis()) - response.completion.timeStamp) < 50000000);
}
use of alma.ACS.CBDescIn in project ACS by ACS-Community.
the class PropertySeqTest method testGetAsyncDoubleRO.
public void testGetAsyncDoubleRO() {
CBdoubleSeqImpl cb = new CBdoubleSeqImpl();
CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
synchronized (cb) {
ROpropertyDoubleSeq.get_async(cb._this(orb), descIn);
try {
// wait for 5s
cb.wait(5000);
} catch (InterruptedException ie) {
}
}
// only 1 response is expected
assertEquals(1, cb.getResponseQueue().size());
CBResponse response = (CBResponse) cb.getResponseQueue().firstElement();
// check reponse type
assertEquals(CBResponse.DONE_TYPE, response.type);
// check value
// TODO check value
//assertEquals(property.default_value(), response.value, 0.0);
// check descriptor
assertEquals(descIn.id_tag, response.desc.id_tag);
// check completion
assertEquals(0, response.completion.code);
assertEquals(0, response.completion.type);
assertEquals(0, response.completion.previousError.length);
// less than 5s
assertTrue((UTCUtility.utcJavaToOmg(System.currentTimeMillis()) - response.completion.timeStamp) < 50000000);
}
use of alma.ACS.CBDescIn in project ACS by ACS-Community.
the class PropertySeqTest method testCreateMonitorFloat.
public void testCreateMonitorFloat() {
// TODO do test with null callback ;)
// TODO implement...
CBfloatSeqImpl cb = new CBfloatSeqImpl();
CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
Monitorfloat monitor = ROpropertyFloatSeq.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.CBDescIn in project ACS by ACS-Community.
the class PropertySeqTest method testSetAsyncFloatRW.
public void testSetAsyncFloatRW() {
CBvoidImpl cb = new CBvoidImpl();
CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
synchronized (cb) {
RWpropertyFloatSeq.set_async(new float[] { (float) 500.0, (float) 600.0 }, cb._this(orb), descIn);
try {
// wait for 5s
cb.wait(5000);
} catch (InterruptedException ie) {
}
}
// only 1 response is expected
//assertEquals(1, cb.getResponseQueue().size());
//CBResponse response = (CBResponse)cb.getResponseQueue().firstElement();
// check reponse type
//assertEquals(CBResponse.DONE_TYPE, response.type);
// check value
// TODO check value
CompletionHolder completionHolder = new CompletionHolder();
float[] value = RWpropertyFloatSeq.get_sync(completionHolder);
assertEquals(500.0, value[0], 0.001);
assertEquals(600.0, value[1], 0.001);
}
Aggregations