registerDeviceInfo() has been deprecated, using setPropertyValue()
authorLarry Sachs <larry.j.sachs@intel.com>
Tue, 10 Jan 2017 18:52:23 +0000 (10:52 -0800)
committerRick Bell <richard.s.bell@intel.com>
Tue, 10 Jan 2017 22:30:18 +0000 (22:30 +0000)
Change-Id: If12951e40245f770fa2a0ff3fe6358a6822afbb0
Signed-off-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16285
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
java/iotivity-android/src/androidTest/java/org/iotivity/base/SmokeTest.java

index 5f50521..e3c54a7 100644 (file)
@@ -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(
                     "",