use of org.eclipse.kapua.service.device.call.DeviceCall in project kapua by eclipse.
the class KuraCallTest method testKuraCall.
// Disabling this test until we have build fixed. Then we should register DeviceCallFactory to service locator
// and enable the test again.
@Ignore
@SuppressWarnings("unchecked")
@Test
public void testKuraCall() throws Exception {
KapuaLocator locator = KapuaLocator.getInstance();
DeviceCallFactory deviceCallFactory = locator.getFactory(DeviceCallFactory.class);
DeviceCall deviceCall = deviceCallFactory.newDeviceCall();
KuraRequestChannel requestChannel = new KuraRequestChannel("$EDC", "kapua-sys", "00:60:0C:82:52:34");
requestChannel.setAppId("CMD-V1");
requestChannel.setMethod(KuraMethod.EXEC);
requestChannel.setResources(new String[] { "command" });
KuraRequestPayload requestPayload = new KuraRequestPayload();
// requestPayload.metrics().put(Kurame, value)
requestPayload.getMetrics().put(CommandMetrics.APP_METRIC_CMD.getValue(), "ifconfig");
KuraRequestMessage requestMessage = new KuraRequestMessage(requestChannel, new Date(), requestPayload);
deviceCall.execute(requestMessage, 120000L);
}
Aggregations