From b5215661fe93472908ee8b7b55378bcee75e055c Mon Sep 17 00:00:00 2001 From: coderhyme Date: Thu, 24 Sep 2015 21:20:09 -0700 Subject: [PATCH] Code formatting for unit tests for resource-encapsulation android api. It is to conform with java code style for iotivity. Change-Id: I70c824606b76025d2b7ddb517c426ebef2faf740 Signed-off-by: coderhyme Reviewed-on: https://gerrit.iotivity.org/gerrit/3075 Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka --- .../iotivity/service/RemoteResourceObjectTest.java | 82 ++++++++------ .../service/ResourceObjectBuilderTest.java | 14 +-- .../org/iotivity/service/ResourceObjectTest.java | 119 ++++++++++++--------- .../java/org/iotivity/service/TestBase.java | 32 +++--- 4 files changed, 147 insertions(+), 100 deletions(-) diff --git a/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/RemoteResourceObjectTest.java b/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/RemoteResourceObjectTest.java index 3355d7b..d208bdc 100644 --- a/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/RemoteResourceObjectTest.java +++ b/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/RemoteResourceObjectTest.java @@ -1,7 +1,5 @@ package org.iotivity.service; -import org.mockito.Mockito; - import static org.iotivity.service.client.RcsRemoteResourceObject.CacheState; import static org.iotivity.service.client.RcsRemoteResourceObject.OnCacheUpdatedListener; import static org.iotivity.service.client.RcsRemoteResourceObject.OnRemoteAttributesReceivedListener; @@ -13,6 +11,8 @@ import static org.mockito.Mockito.any; import static org.mockito.Mockito.timeout; import static org.mockito.Mockito.verify; +import org.mockito.Mockito; + public class RemoteResourceObjectTest extends TestBase { private RcsResourceAttributes createAttrs() { @@ -24,20 +24,23 @@ public class RemoteResourceObjectTest extends TestBase { return attrs; } - public void testGetRemoteAttributesGetsAttributesOfServer() throws RcsException { - OnRemoteAttributesReceivedListener listener = - Mockito.mock(OnRemoteAttributesReceivedListener.class); + public void testGetRemoteAttributesGetsAttributesOfServer() + throws RcsException { + OnRemoteAttributesReceivedListener listener = Mockito + .mock(OnRemoteAttributesReceivedListener.class); setServerAttrbutes(createAttrs()); mClient.getRemoteAttributes(listener); - verify(listener, timeout(1000)).onAttributesReceived(eq(createAttrs()), anyInt()); + verify(listener, timeout(1000)).onAttributesReceived(eq(createAttrs()), + anyInt()); } - public void testGetRemoteAttributesSetsAttributesOfServer() throws RcsException { - OnRemoteAttributesReceivedListener listener = - Mockito.mock(OnRemoteAttributesReceivedListener.class); + public void testGetRemoteAttributesSetsAttributesOfServer() + throws RcsException { + OnRemoteAttributesReceivedListener listener = Mockito + .mock(OnRemoteAttributesReceivedListener.class); mServer.setAttribute("key", new RcsValue(0)); @@ -46,8 +49,8 @@ public class RemoteResourceObjectTest extends TestBase { mClient.setRemoteAttributes(attrs, listener); - verify(listener, timeout(1000)).onAttributesReceived(any(RcsResourceAttributes.class), - anyInt()); + verify(listener, timeout(1000)).onAttributesReceived( + any(RcsResourceAttributes.class), anyInt()); assertEquals(3, mServer.getAttributeValue("key").asInt()); } @@ -56,15 +59,19 @@ public class RemoteResourceObjectTest extends TestBase { assertFalse(mClient.isMonitoring()); } - public void testIsMonitoringReturnsTrueAfterStartMonitoring() throws RcsException { - OnStateChangedListener listener = Mockito.mock(OnStateChangedListener.class); + public void testIsMonitoringReturnsTrueAfterStartMonitoring() + throws RcsException { + OnStateChangedListener listener = Mockito + .mock(OnStateChangedListener.class); mClient.startMonitoring(listener); assertTrue(mClient.isMonitoring()); } - public void testStartMonitoringThrowsIfTryingToStartAgain() throws RcsException { - OnStateChangedListener listener = Mockito.mock(OnStateChangedListener.class); + public void testStartMonitoringThrowsIfTryingToStartAgain() + throws RcsException { + OnStateChangedListener listener = Mockito + .mock(OnStateChangedListener.class); mClient.startMonitoring(listener); try { @@ -82,13 +89,15 @@ public class RemoteResourceObjectTest extends TestBase { assertFalse(mClient.isCaching()); } - public void testIsCachingReturnsTrueAfterStartCaching() throws RcsException { + public void testIsCachingReturnsTrueAfterStartCaching() + throws RcsException { mClient.startCaching(); assertTrue(mClient.isCaching()); } - public void testStartCachingThrowsIfTryingToStartAgain() throws RcsException { + public void testStartCachingThrowsIfTryingToStartAgain() + throws RcsException { mClient.startCaching(); try { @@ -109,24 +118,30 @@ public class RemoteResourceObjectTest extends TestBase { } public void testCacheStateIsReadyAfterCacheUpdated() throws RcsException { - OnCacheUpdatedListener listener = Mockito.mock(OnCacheUpdatedListener.class); + OnCacheUpdatedListener listener = Mockito + .mock(OnCacheUpdatedListener.class); mClient.startCaching(listener); - verify(listener, timeout(1000)).onCacheUpdated(any(RcsResourceAttributes.class)); + verify(listener, timeout(1000)) + .onCacheUpdated(any(RcsResourceAttributes.class)); assertEquals(CacheState.READY, mClient.getCacheState()); } - public void testIsCachedAvailableReturnsTrueWhenCacheIsReady() throws RcsException { - OnCacheUpdatedListener listener = Mockito.mock(OnCacheUpdatedListener.class); + public void testIsCachedAvailableReturnsTrueWhenCacheIsReady() + throws RcsException { + OnCacheUpdatedListener listener = Mockito + .mock(OnCacheUpdatedListener.class); mClient.startCaching(listener); - verify(listener, timeout(1000)).onCacheUpdated(any(RcsResourceAttributes.class)); + verify(listener, timeout(1000)) + .onCacheUpdated(any(RcsResourceAttributes.class)); assertTrue(mClient.isCachedAvailable()); } - public void testGetCachedAttributesThrowsIfCachingIsNotStarted() throws RcsException { + public void testGetCachedAttributesThrowsIfCachingIsNotStarted() + throws RcsException { try { mClient.getCachedAttributes(); fail("No exception thrown"); @@ -134,18 +149,22 @@ public class RemoteResourceObjectTest extends TestBase { } } - public void testCachedAttributesHasSameAttributesWithServer() throws RcsException { + public void testCachedAttributesHasSameAttributesWithServer() + throws RcsException { setServerAttrbutes(createAttrs()); - OnCacheUpdatedListener listener = Mockito.mock(OnCacheUpdatedListener.class); + OnCacheUpdatedListener listener = Mockito + .mock(OnCacheUpdatedListener.class); mClient.startCaching(listener); - verify(listener, timeout(1000)).onCacheUpdated(any(RcsResourceAttributes.class)); + verify(listener, timeout(1000)) + .onCacheUpdated(any(RcsResourceAttributes.class)); assertEquals(createAttrs(), mClient.getCachedAttributes()); } - public void testGetCachedAttributeThrowsIfCachingIsNotStarted() throws RcsException { + public void testGetCachedAttributeThrowsIfCachingIsNotStarted() + throws RcsException { try { mClient.getCachedAttribute("some_key"); fail("No exception thrown"); @@ -153,11 +172,14 @@ public class RemoteResourceObjectTest extends TestBase { } } - public void testGetCachedAttributeReturnsNullIfKeyIsInvalid() throws RcsException { - OnCacheUpdatedListener listener = Mockito.mock(OnCacheUpdatedListener.class); + public void testGetCachedAttributeReturnsNullIfKeyIsInvalid() + throws RcsException { + OnCacheUpdatedListener listener = Mockito + .mock(OnCacheUpdatedListener.class); mClient.startCaching(listener); - verify(listener, timeout(1000)).onCacheUpdated(any(RcsResourceAttributes.class)); + verify(listener, timeout(1000)) + .onCacheUpdated(any(RcsResourceAttributes.class)); assertNull(mClient.getCachedAttribute("some_key")); } diff --git a/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/ResourceObjectBuilderTest.java b/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/ResourceObjectBuilderTest.java index db6d420..ba18572 100644 --- a/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/ResourceObjectBuilderTest.java +++ b/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/ResourceObjectBuilderTest.java @@ -1,12 +1,12 @@ package org.iotivity.service; -import android.test.InstrumentationTestCase; - import org.iotivity.service.server.RcsResourceObject; +import android.test.InstrumentationTestCase; + public class ResourceObjectBuilderTest extends InstrumentationTestCase { - private static final String RESOURCEURI = "/a/TemperatureSensor"; - private static final String RESOURCETYPE = "Resource.Hosting"; + private static final String RESOURCEURI = "/a/TemperatureSensor"; + private static final String RESOURCETYPE = "oic.r.type"; private static final String RESOURCEINTERFACE = "oic.if.baseline"; private RcsResourceObject mObject; @@ -19,9 +19,11 @@ public class ResourceObjectBuilderTest extends InstrumentationTestCase { mObject = null; } - public void testResourceServerHasPropertiesSetByBuilder() throws RcsException { + public void testResourceServerHasPropertiesSetByBuilder() + throws RcsException { mObject = new RcsResourceObject.Builder(RESOURCEURI, RESOURCETYPE, - RESOURCEINTERFACE).setDiscoverable(false).setObservable(true).build(); + RESOURCEINTERFACE).setDiscoverable(false).setObservable(true) + .build(); assertTrue(mObject.isObservable()); } diff --git a/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/ResourceObjectTest.java b/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/ResourceObjectTest.java index d4deaa8..bb6a6d7 100644 --- a/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/ResourceObjectTest.java +++ b/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/ResourceObjectTest.java @@ -1,5 +1,13 @@ package org.iotivity.service; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyInt; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.timeout; +import static org.mockito.Mockito.verify; + import org.iotivity.service.client.RcsRemoteResourceObject.OnRemoteAttributesReceivedListener; import org.iotivity.service.server.RcsGetResponse; import org.iotivity.service.server.RcsRequest; @@ -11,25 +19,17 @@ import org.iotivity.service.server.RcsResourceObject.SetRequestHandlerPolicy; import org.iotivity.service.server.RcsSetResponse; import org.mockito.Mockito; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.timeout; -import static org.mockito.Mockito.verify; - public class ResourceObjectTest extends TestBase { private static final String NEW_KEY = "new" + KEY; private OnRemoteAttributesReceivedListener mOnRemoteAttributesReceivedListener; - private SetRequestHandler mSetRequestHandler; - private GetRequestHandler mGetRequestHandler; - private OnAttributeUpdatedListener mOnAttributeUpdatedListener; + private SetRequestHandler mSetRequestHandler; + private GetRequestHandler mGetRequestHandler; + private OnAttributeUpdatedListener mOnAttributeUpdatedListener; private void setSetRequestHandlerReturn(RcsSetResponse setResponse) { - doReturn(setResponse).when(mSetRequestHandler). - onSetRequested(any(RcsRequest.class), any(RcsResourceAttributes.class)); + doReturn(setResponse).when(mSetRequestHandler).onSetRequested( + any(RcsRequest.class), any(RcsResourceAttributes.class)); } private void setGetRequestHandlerReturn(RcsGetResponse getResponse) { @@ -41,11 +41,13 @@ public class ResourceObjectTest extends TestBase { protected void setUp() throws Exception { super.setUp(); - mOnRemoteAttributesReceivedListener = Mockito.mock(OnRemoteAttributesReceivedListener.class); + mOnRemoteAttributesReceivedListener = Mockito + .mock(OnRemoteAttributesReceivedListener.class); mGetRequestHandler = Mockito.mock(GetRequestHandler.class); mSetRequestHandler = Mockito.mock(SetRequestHandler.class); - mOnAttributeUpdatedListener = Mockito.mock(OnAttributeUpdatedListener.class); + mOnAttributeUpdatedListener = Mockito + .mock(OnAttributeUpdatedListener.class); } public void testDefalutAutoNotifyPolicyIsUpdated() throws RcsException { @@ -63,16 +65,20 @@ public class ResourceObjectTest extends TestBase { assertEquals(AutoNotifyPolicy.ALWAYS, mServer.getAutoNotifyPolicy()); } - public void testDefalutSetRequestHandlerPolicyIsNever() throws RcsException { - assertEquals(SetRequestHandlerPolicy.NEVER, mServer.getSetRequestHandlerPolicy()); + public void testDefalutSetRequestHandlerPolicyIsNever() + throws RcsException { + assertEquals(SetRequestHandlerPolicy.NEVER, + mServer.getSetRequestHandlerPolicy()); } public void testSetRequestHandlerPolicyCanBeSet() throws RcsException { mServer.setSetRequestHandlerPolicy(SetRequestHandlerPolicy.ACCEPT); - assertEquals(SetRequestHandlerPolicy.ACCEPT, mServer.getSetRequestHandlerPolicy()); + assertEquals(SetRequestHandlerPolicy.ACCEPT, + mServer.getSetRequestHandlerPolicy()); mServer.setSetRequestHandlerPolicy(SetRequestHandlerPolicy.NEVER); - assertEquals(SetRequestHandlerPolicy.NEVER, mServer.getSetRequestHandlerPolicy()); + assertEquals(SetRequestHandlerPolicy.NEVER, + mServer.getSetRequestHandlerPolicy()); } public void testGetRequestHandlerCalledIfReceived() throws RcsException { @@ -82,11 +88,12 @@ public class ResourceObjectTest extends TestBase { mClient.getRemoteAttributes(mOnRemoteAttributesReceivedListener); - verify(mGetRequestHandler, timeout(1000)).onGetRequested(any(RcsRequest.class), - any(RcsResourceAttributes.class)); + verify(mGetRequestHandler, timeout(1000)).onGetRequested( + any(RcsRequest.class), any(RcsResourceAttributes.class)); } - public void testGetRequestHandlerCanReturnCustomAttrsAsResponse() throws RcsException { + public void testGetRequestHandlerCanReturnCustomAttrsAsResponse() + throws RcsException { RcsResourceAttributes newAttrs = new RcsResourceAttributes(); newAttrs.put(NEW_KEY, new RcsValue(RAW_VALUE + 1)); @@ -95,11 +102,11 @@ public class ResourceObjectTest extends TestBase { mServer.setGetRequestHandler(mGetRequestHandler); mClient.getRemoteAttributes(mOnRemoteAttributesReceivedListener); - verify(mGetRequestHandler, timeout(1000)).onGetRequested(any(RcsRequest.class), - any(RcsResourceAttributes.class)); + verify(mGetRequestHandler, timeout(1000)).onGetRequested( + any(RcsRequest.class), any(RcsResourceAttributes.class)); - verify(mOnRemoteAttributesReceivedListener, timeout(1000)).onAttributesReceived( - eq(newAttrs), anyInt()); + verify(mOnRemoteAttributesReceivedListener, timeout(1000)) + .onAttributesReceived(eq(newAttrs), anyInt()); } public void testSetRequestHandlerCalledIfReceived() throws RcsException { @@ -107,13 +114,15 @@ public class ResourceObjectTest extends TestBase { mServer.setSetRequestHandler(mSetRequestHandler); - mClient.setRemoteAttributes(new RcsResourceAttributes(), mOnRemoteAttributesReceivedListener); + mClient.setRemoteAttributes(new RcsResourceAttributes(), + mOnRemoteAttributesReceivedListener); - verify(mSetRequestHandler, timeout(1000)).onSetRequested(any(RcsRequest.class), - any(RcsResourceAttributes.class)); + verify(mSetRequestHandler, timeout(1000)).onSetRequested( + any(RcsRequest.class), any(RcsResourceAttributes.class)); } - public void testIgnoreSetRequestIfSetRequestHandlerReturnsIgnore() throws RcsException { + public void testIgnoreSetRequestIfSetRequestHandlerReturnsIgnore() + throws RcsException { setSetRequestHandlerReturn(RcsSetResponse.ignore()); mServer.setSetRequestHandler(mSetRequestHandler); @@ -121,15 +130,17 @@ public class ResourceObjectTest extends TestBase { RcsResourceAttributes newAttrs = new RcsResourceAttributes(); newAttrs.put(KEY, new RcsValue(RAW_VALUE + 1)); - mClient.setRemoteAttributes(newAttrs, mOnRemoteAttributesReceivedListener); + mClient.setRemoteAttributes(newAttrs, + mOnRemoteAttributesReceivedListener); - verify(mSetRequestHandler, timeout(1000)).onSetRequested(any(RcsRequest.class), - eq(newAttrs)); + verify(mSetRequestHandler, timeout(1000)) + .onSetRequested(any(RcsRequest.class), eq(newAttrs)); assertEquals(RAW_VALUE, mServer.getAttributeValue(KEY).asInt()); } - public void testAcceptSetRequestIfSetRequestHandlerReturnsAccept() throws RcsException { + public void testAcceptSetRequestIfSetRequestHandlerReturnsAccept() + throws RcsException { setSetRequestHandlerReturn(RcsSetResponse.accept()); mServer.setSetRequestHandlerPolicy(SetRequestHandlerPolicy.NEVER); @@ -138,52 +149,60 @@ public class ResourceObjectTest extends TestBase { RcsResourceAttributes newAttrs = new RcsResourceAttributes(); newAttrs.put(NEW_KEY, new RcsValue(RAW_VALUE + 1)); - mClient.setRemoteAttributes(newAttrs, mOnRemoteAttributesReceivedListener); + mClient.setRemoteAttributes(newAttrs, + mOnRemoteAttributesReceivedListener); - verify(mSetRequestHandler, timeout(1000)).onSetRequested(any(RcsRequest.class), - eq(newAttrs)); + verify(mSetRequestHandler, timeout(1000)) + .onSetRequested(any(RcsRequest.class), eq(newAttrs)); assertEquals(RAW_VALUE + 1, mServer.getAttributeValue(NEW_KEY).asInt()); } - public void testSetRequestHandlerCanReturnCustomAttrsAsResponse() throws RcsException { + public void testSetRequestHandlerCanReturnCustomAttrsAsResponse() + throws RcsException { final RcsResourceAttributes newAttrs = new RcsResourceAttributes(); newAttrs.put(NEW_KEY, new RcsValue(RAW_VALUE + 1)); setSetRequestHandlerReturn(RcsSetResponse.create(newAttrs)); mServer.setSetRequestHandler(mSetRequestHandler); - mClient.setRemoteAttributes(new RcsResourceAttributes(), mOnRemoteAttributesReceivedListener); + mClient.setRemoteAttributes(new RcsResourceAttributes(), + mOnRemoteAttributesReceivedListener); - verify(mSetRequestHandler, timeout(1000)).onSetRequested(any(RcsRequest.class), - any(RcsResourceAttributes.class)); + verify(mSetRequestHandler, timeout(1000)).onSetRequested( + any(RcsRequest.class), any(RcsResourceAttributes.class)); - verify(mOnRemoteAttributesReceivedListener, timeout(1000)).onAttributesReceived( - eq(newAttrs), anyInt()); + verify(mOnRemoteAttributesReceivedListener, timeout(1000)) + .onAttributesReceived(eq(newAttrs), anyInt()); } - public void testOnAttributeUpdatedListenerIsCalledIfValueUpdated() throws RcsException { + public void testOnAttributeUpdatedListenerIsCalledIfValueUpdated() + throws RcsException { final RcsValue newValue = new RcsValue(RAW_VALUE + 1); final RcsResourceAttributes newAttrs = new RcsResourceAttributes(); newAttrs.put(KEY, newValue); mServer.addAttributeUpdatedListener(KEY, mOnAttributeUpdatedListener); - mClient.setRemoteAttributes(newAttrs, mOnRemoteAttributesReceivedListener); + mClient.setRemoteAttributes(newAttrs, + mOnRemoteAttributesReceivedListener); - verify(mOnAttributeUpdatedListener, timeout(1000)).onAttributeUpdated(eq(VALUE), - eq(newValue)); + verify(mOnAttributeUpdatedListener, timeout(1000)) + .onAttributeUpdated(eq(VALUE), eq(newValue)); } - public void testOnAttributeUpdatedListenerIsNotCalledIRemoved() throws RcsException { + public void testOnAttributeUpdatedListenerIsNotCalledIRemoved() + throws RcsException { final RcsValue newValue = new RcsValue(RAW_VALUE + 1); final RcsResourceAttributes newAttrs = new RcsResourceAttributes(); newAttrs.put(KEY, newValue); mServer.addAttributeUpdatedListener(KEY, mOnAttributeUpdatedListener); mServer.removeAttribute(KEY); - mClient.setRemoteAttributes(newAttrs, mOnRemoteAttributesReceivedListener); + mClient.setRemoteAttributes(newAttrs, + mOnRemoteAttributesReceivedListener); - verify(mOnAttributeUpdatedListener, never()).onAttributeUpdated(eq(VALUE), eq(newValue)); + verify(mOnAttributeUpdatedListener, never()) + .onAttributeUpdated(eq(VALUE), eq(newValue)); } public void testThrowIfObjectIsDestroyed() throws RcsException { diff --git a/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/TestBase.java b/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/TestBase.java index 5f9686c..9882002 100644 --- a/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/TestBase.java +++ b/service/resource-encapsulation/android/service/src/androidTest/java/org/iotivity/service/TestBase.java @@ -1,31 +1,33 @@ package org.iotivity.service; -import android.test.InstrumentationTestCase; - import org.iotivity.service.client.RcsAddress; import org.iotivity.service.client.RcsDiscoveryManager; import org.iotivity.service.client.RcsDiscoveryManager.OnResourceDiscoveredListener; import org.iotivity.service.client.RcsRemoteResourceObject; import org.iotivity.service.server.RcsResourceObject; +import android.test.InstrumentationTestCase; + public abstract class TestBase extends InstrumentationTestCase { - protected static final String RESOURCEURI = "/a/TemperatureSensor"; - protected static final String RESOURCETYPE = "Resource.Hosting"; + protected static final String RESOURCEURI = "/a/TemperatureSensor"; + protected static final String RESOURCETYPE = "oic.r.type"; protected static final String RESOURCEINTERFACE = "oic.if.baseline"; - protected static final String KEY = "key"; - protected static final RcsValue VALUE = new RcsValue(100); - protected static final int RAW_VALUE = 100; + protected static final String KEY = "key"; + protected static final RcsValue VALUE = new RcsValue(100); + protected static final int RAW_VALUE = 100; private final Object mCond = new Object(); - protected RcsResourceObject mServer; + protected RcsResourceObject mServer; protected RcsRemoteResourceObject mClient; private OnResourceDiscoveredListener mOnResourceDiscoveredListener = new OnResourceDiscoveredListener() { @Override - public void onResourceDiscovered(RcsRemoteResourceObject RcsRemoteResourceObject) { - if (mClient != null) return; + public void onResourceDiscovered( + RcsRemoteResourceObject RcsRemoteResourceObject) { + if (mClient != null) + return; mClient = RcsRemoteResourceObject; synchronized (mCond) { @@ -50,9 +52,10 @@ public abstract class TestBase extends InstrumentationTestCase { private void WaitUntilDiscovered() throws RcsException { while (mClient == null) { try { - RcsDiscoveryManager.DiscoveryTask discoveryTask = RcsDiscoveryManager.getInstance(). - discoverResourceByType(RcsAddress.multicast(), - "/oic/res", RESOURCETYPE, mOnResourceDiscoveredListener); + RcsDiscoveryManager.DiscoveryTask discoveryTask = RcsDiscoveryManager + .getInstance().discoverResourceByType( + RcsAddress.multicast(), "/oic/res", + RESOURCETYPE, mOnResourceDiscoveredListener); synchronized (mCond) { mCond.wait(100); @@ -65,7 +68,8 @@ public abstract class TestBase extends InstrumentationTestCase { } } - protected void setServerAttrbutes(RcsResourceAttributes attrs) throws RcsException { + protected void setServerAttrbutes(RcsResourceAttributes attrs) + throws RcsException { RcsResourceObject.AttributesLock lock = mServer.getAttributesLock(); lock.lock().putAll(attrs); lock.apply(); -- 2.7.4