From 80f928218feedec39823ba64fd380c8c74fbba5b Mon Sep 17 00:00:00 2001 From: Larry Sachs Date: Tue, 10 Jan 2017 10:52:23 -0800 Subject: [PATCH] registerDeviceInfo() has been deprecated, using setPropertyValue() Change-Id: If12951e40245f770fa2a0ff3fe6358a6822afbb0 Signed-off-by: Larry Sachs Reviewed-on: https://gerrit.iotivity.org/gerrit/16285 Tested-by: jenkins-iotivity Reviewed-by: Rick Bell --- .../src/androidTest/java/org/iotivity/base/SmokeTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/java/iotivity-android/src/androidTest/java/org/iotivity/base/SmokeTest.java b/java/iotivity-android/src/androidTest/java/org/iotivity/base/SmokeTest.java index 5f50521..e3c54a7 100644 --- a/java/iotivity-android/src/androidTest/java/org/iotivity/base/SmokeTest.java +++ b/java/iotivity-android/src/androidTest/java/org/iotivity/base/SmokeTest.java @@ -1072,7 +1072,7 @@ public class SmokeTest extends InstrumentationTestCase { @Override public void onDeviceFound(OcRepresentation ocRepresentation) { try { - Log.i(TAG, "Device Name: " + ocRepresentation.getValue("n")); + Log.i(TAG, "Device Name (callback): " + ocRepresentation.getValue("n")); } catch (OcException e) { Log.e(TAG, e.toString()); assertTrue(false); @@ -1093,7 +1093,12 @@ public class SmokeTest extends InstrumentationTestCase { try { //server - OcPlatform.registerDeviceInfo(devInfo); +// OcPlatform.registerDeviceInfo(devInfo); // deprecated (use setPropertyValue) + OcPlatform.setPropertyValue(PayloadType.DEVICE.getValue(), "n", "myTestDeviceName"); + String deviceName = OcPlatform.getPropertyValue(PayloadType.DEVICE.getValue(), "n"); + Log.i(TAG, "Device Name (propertyValue): " + deviceName); + assertTrue("myTestDeviceName".equals(deviceName)); + //client OcPlatform.getDeviceInfo( "", -- 2.7.4