+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.clientcontroller.test;
import java.util.concurrent.CountDownLatch;
import org.oic.simulator.SimulatorResourceModel;
import org.oic.simulator.clientcontroller.IGetListener;
+/**
+ * This class implements methods for receiving notification when
+ * response is received for GET request.
+ */
public class GetListener implements IGetListener
{
@Override
public void onGetCompleted(String uId, SimulatorResourceModel representation)
{
- getListenerObject.setuId(uId);
- getListenerObject.setRepresentation(representation);
+ if (null != getListenerObject) {
+ getListenerObject.setuId(uId);
+ getListenerObject.setRepresentation(representation);
+ }
lockObject.countDown();
}
@Override
public void onGetFailed(Throwable ex)
{
- getListenerObject.setEx(ex);
+ if (null != getListenerObject)
+ getListenerObject.setEx(ex);
lockObject.countDown();
}
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.clientcontroller.test;
import org.oic.simulator.SimulatorResourceModel;
+/**
+ * This class implements methods for setting/getting UID and
+ * resource representation.
+ */
public class ListenerObject
{
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.clientcontroller.test;
import java.util.concurrent.CountDownLatch;
import org.oic.simulator.SimulatorResourceModel;
import org.oic.simulator.clientcontroller.IObserveListener;
+/**
+ * This class implements methods for receiving notification when
+ * response is received for Observe request.
+ */
public class ObserveListener implements IObserveListener
{
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.clientcontroller.test;
import org.oic.simulator.SimulatorResourceModel;
+/**
+ * This class implements methods for setting/getting UID,
+ * resource representation and sequence number for observe.
+ */
public class ObserveListenerObject
{
-
private String uId;
private SimulatorResourceModel representation;
private int sequenceNumber;
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.clientcontroller.test;
import java.util.concurrent.CountDownLatch;
import org.oic.simulator.SimulatorResourceModel;
import org.oic.simulator.clientcontroller.IPostListener;
+/**
+ * This class implements methods for receiving notification when
+ * response is received for POST request.
+ */
public class PostListener implements IPostListener
{
private CountDownLatch lockObject;
- private ListenerObject getListenerObject;
+ private ListenerObject postListenerObject;
- public PostListener(CountDownLatch lockObject, ListenerObject getListenerObject)
+ public PostListener(CountDownLatch lockObject, ListenerObject postListenerObject)
{
this.lockObject = lockObject;
- this.getListenerObject = getListenerObject;
+ this.postListenerObject = postListenerObject;
}
@Override
public void onPostCompleted(String uId, SimulatorResourceModel representation)
{
- getListenerObject.setuId(uId);
- getListenerObject.setRepresentation(representation);
+ if (null != postListenerObject) {
+ postListenerObject.setuId(uId);
+ postListenerObject.setRepresentation(representation);
+ }
lockObject.countDown();
}
@Override
public void onPostFailed(Throwable ex)
{
- getListenerObject.setEx(ex);
+ if (null != postListenerObject)
+ postListenerObject.setEx(ex);
lockObject.countDown();
}
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.clientcontroller.test;
import java.util.concurrent.CountDownLatch;
import org.oic.simulator.SimulatorResourceModel;
import org.oic.simulator.clientcontroller.IPutListener;
+/**
+ * This class implements methods for receiving notification when
+ * response is received for PUT request.
+ */
public class PutListener implements IPutListener
{
-
private CountDownLatch lockObject;
- private ListenerObject listenerObject;
+ private ListenerObject putListenerObject;
- public PutListener(CountDownLatch lockObject, ListenerObject listenerObject)
+ public PutListener(CountDownLatch lockObject, ListenerObject putListenerObject)
{
this.lockObject = lockObject;
- this.listenerObject = listenerObject;
+ this.putListenerObject = putListenerObject;
}
@Override
public void onPutCompleted(String uId, SimulatorResourceModel representation)
{
- listenerObject.setuId(uId);
- listenerObject.setRepresentation(representation);
+ if (null != putListenerObject) {
+ putListenerObject.setuId(uId);
+ putListenerObject.setRepresentation(representation);
+ }
lockObject.countDown();
}
@Override
public void onPutFailed(Throwable ex)
{
- listenerObject.setEx(ex);
+ if (null != putListenerObject)
+ putListenerObject.setEx(ex);
lockObject.countDown();
}
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.clientcontroller.test;
import java.util.HashMap;
import org.oic.simulator.test.ResourceModelObject;
import org.oic.simulator.test.SimulatorRemoteResourceObject;
+/**
+ * This class tests the functionality of Simulator Remote Resource
+ * class APIs.
+ */
public class SimulatorRemoteResourceTest extends TestCase
{
-
private static final String CONFIG_PATH = "./ramls/simple-light.raml";
// private static final String RESOURCE_TYPE = "oic.light";
assertNotNull(simulatorRemoteResource.getId());
}
- //TODO call back not coming
public void testStartObserve_P01()
{
boolean result = true;
observeListener = null;
}
- //TODO call back not coming
public void testStopObserve_P01()
{
boolean result = true;
assertTrue(result && listenerObject != null && listenerObject.getRepresentation() != null && listenerObject.getuId() != null);
}
- /**
- * model as null
- */
- //TODO crashing
- /*public void testPut_N01() {
- boolean result = true;
- ListenerObject listenerObject = new ListenerObject();
- PutListener putListener = new PutListener(lockObject, listenerObject);
-
- try {
- simulatorRemoteResource.put(null, null, putListener);
- result = false;
- } catch (Exception e1) {
- result = true;
- }
-
- try {
- lockObject.await(10, TimeUnit.SECONDS);
- } catch (InterruptedException e) {
- }
-
- assertTrue(result && listenerObject.getRepresentation() == null && listenerObject.getuId() == null);
- }*/
-
- //TODO fail
public void testPost_P01()
{
boolean result = true;
assertTrue(result && listenerObject != null && listenerObject.getRepresentation() != null && listenerObject.getuId() != null);
}
- /**
- * Model is set to null
- */
- //TODO crash
- /*public void testPost_N01() {
- boolean result = true;
-
- lockObject = new CountDownLatch(1);
-
- ListenerObject listenerObject = new ListenerObject();
- PostListener postListener = new PostListener(lockObject, listenerObject);
-
- try {
- simulatorRemoteResource.post(null, null, postListener);
- result = false;
- } catch (Exception e1) {
- result = true;
- }
-
- try {
- lockObject.await(10, TimeUnit.SECONDS);
- } catch (InterruptedException e) {
- }
-
- assertTrue(result && listenerObject.getRepresentation() == null && listenerObject.getuId() == null);
- }*/
-
- //TODO failign
public void testGet_P01()
{
boolean result = true;
/**
* null resInterface
*/
- //TODO failing
public void testGet_N01()
{
boolean result = false;
/**
* null listener
*/
- //TODO failing
public void testGet_N02()
{
boolean result = false;
assertTrue(result);
}
- //TODO Resource does not support this request type!
public void testSetConfigInfo_P01()
{
boolean result = true;
assertTrue(result);
}
- //TODO Resource does not support this request type!
public void testStartVerification_P01()
{
boolean result = true;
verifyListenerObject.getId() != -1);
}
- //TODO Resource does not support this request type!
public void testStartVerification_P02()
{
boolean result = true;
verifyListenerObject.getId() != -1);
}
- //TODO Resource does not support this request type!
public void testStartVerification_P03()
{
boolean result = true;
/**
* setting listener to null
*/
- //TODO Resource does not support this request type!
public void testStartVerification_N01()
{
boolean result = true;
assertTrue(result);
}
- //TODO Resource does not support this request type!
public void testStopVerification_P01()
{
boolean result = true;
/**
* Random id. This is just to check the crash
*/
- //TODO Resource does not support this request type!
public void testStopVerification_N01()
{
boolean result = true;
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.clientcontroller.test;
import java.util.concurrent.CountDownLatch;
import org.oic.simulator.clientcontroller.IVerificationListener;
+/**
+ * This class implements listeners for getting verification
+ * status callbacks.
+ */
public class VerifyListener implements IVerificationListener
{
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.clientcontroller.test;
+/**
+ * This class tests the functionality of getting/setting
+ * verification ID.
+ */
public class VerifyListenerObject
{
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.serviceprovider.test;
import java.util.concurrent.CountDownLatch;
-
import org.oic.simulator.IAutomation;
+/**
+ * This class implements methods for receiving notifications on
+ * completion of automation.
+ */
public class AutomationListener implements IAutomation
{
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.serviceprovider.test;
+/**
+ * This class implements methods for setting/getting URI
+ * and automation ID.
+ */
public class AutomationObject
{
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.serviceprovider.test;
import java.util.concurrent.CountDownLatch;
import org.oic.simulator.serviceprovider.IObserver;
import org.oic.simulator.serviceprovider.ObserverInfo;
+/**
+ * This class implements methods for receiving observer
+ * change callbacks.
+ */
public class Observer implements IObserver
{
-
private CountDownLatch lockObject;
private ObserverObject observerObject;
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.serviceprovider.test;
import org.oic.simulator.serviceprovider.ObserverInfo;
+/**
+ * This class provides methods to set/get observers and state
+ * information.
+ */
public class ObserverObject
{
-
private String resourceURI;
private int state;
private ObserverInfo observer;
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.serviceprovider.test;
import java.util.Vector;
import org.oic.simulator.test.ResourceModelChangeListener;
import org.oic.simulator.test.ResourceModelObject;
+/**
+ * This class tests the functionality of Simulator Resource Server
+ * class APIs.
+ */
public class SimlatorResourceServerTest extends TestCase
{
assertEquals(Double.parseDouble(getValue(KEY) + ""), 4.0);
}
- //TODO failing
public void testAddAttributeBoolean_P01()
{
try
assertTrue(result);
}
- //TODO failing
public void testUpdateAttributeBoolean_P01()
{
boolean result = true;
/**
* Try to set the value out of range
*/
- //TODO failing
public void testSetRange_N01()
{
boolean result = true;
assertTrue(result);
}
- //TODO failing
public void testSetAllowedValuesInteger_P01()
{
boolean result = true;
/**
* Try setting with out of range
*/
- //TODO failing
public void testSetAllowedValuesInteger_N01()
{
boolean result = true;
/**
* Try setting values multiple times
*/
- //TODO failing
public void testSetAllowedValuesDouble_P01()
{
boolean result = true;
/**
* Try setting with out of range
*/
- //TODO failing
public void testSetAllowedValuesDouble_N01()
{
boolean result = true;
assertTrue(result);
}
- //TODO failing
public void testsetAllowedValuesString_P01()
{
boolean result = true;
/**
* Set the value that is not in allowed values
*/
- //TODO failing
public void testsetAllowedValuesString_N01()
{
boolean result = true;
/**
* Try removing the attribute thats not present
*/
- //TODO failing
public void testRemoveAttribute_N01()
{
boolean result = false;
/**
* Try removing when attribute is empty
*/
- //TODO failing
public void testRemoveAttribute_N03()
{
boolean result = false;
assertTrue(result);
}
- //TODO failing
public void testStartResourceAutomation_P01()
{
boolean result = true;
/**
* null listener
*/
- //TODO failing
public void testStartResourceAutomation_N01()
{
boolean result = true;
assertTrue(result && id == -1);
}
- //TODO failing
public void testStartAttributeAutomation_P01()
{
boolean result = true;
assertTrue(result && id != -1);
}
- //TODO failing
public void testStopAutomation_P01()
{
boolean result = true;
* checking for crash
* random id
*/
- //TODO failing
public void testStopAutomation_N01()
{
boolean result = false;
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.test;
import java.util.concurrent.CountDownLatch;
import org.oic.simulator.clientcontroller.IFindResourceListener;
import org.oic.simulator.clientcontroller.SimulatorRemoteResource;
+/**
+ * This class implements methods for receiving notification when
+ * resources are discovered in network.
+ */
public class FindResourceListener implements IFindResourceListener
{
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.test;
import org.oic.simulator.SimulatorResourceModel;
import org.oic.simulator.serviceprovider.IResourceModelChangedListener;
+/**
+ * This class implements methods for receiving notification when
+ * resource model is changed.
+ */
public class ResourceModelChangeListener implements IResourceModelChangedListener
{
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.test;
import org.oic.simulator.SimulatorResourceModel;
+/**
+ * This class implements methods for setting/getting
+ * resource model.
+ */
public class ResourceModelObject
{
private String resourceURI;
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.test;
import java.util.concurrent.CountDownLatch;
import org.oic.simulator.SimulatorManager;
import org.oic.simulator.serviceprovider.SimulatorResourceServer;
+/**
+ * This class tests the functionality of Simulator Manager
+ * class APIs.
+ */
public class SimulatorManagerTest extends TestCase
{
private static final String CONFIG_PATH = "./ramls/simple-light.raml";
- private static final String RESOURCE_TYPE = "oic.light";
+ private static final String RESOURCE_TYPE = "oic.r.light";
private CountDownLatch lockObject;
private ResourceModelObject resourceModelObject;
assertTrue(simulatorResourceServers == null);
}
- /**
- * When count is set to -ve
- */
- //TODO issue. Not coming out of loop
- /*public void testCreateResourceCount_N05() {
- int count = -10;
-
- SimulatorResourceServer[] simulatorResourceServers = createResources(count);
-
- assertTrue(simulatorResourceServers != null && simulatorResourceServers.length == 0);
- }*/
-
public void testDeleteResource_P01()
{
boolean result = true;
}
/**
- * checkign for crash
+ * checking for crash
*/
public void testSetDeviceInfo_P01()
{
}
/**
- * checkign for crash
+ * checking for crash
* Pass empty
*/
- //TODO failing
public void testSetDeviceInfo_N01()
{
SimulatorManager.setDeviceInfo("");
}
/**
- * checkign for crash
- * pass null
- */
- //TODO failign
- public void testSetDeviceInfo_N02()
- {
- SimulatorManager.setDeviceInfo(null);
- }
-
- //TODO crashing
- /*public void testGetDeviceInfo_P01() {
-
- lockObject = new CountDownLatch(1);
-
- SimulatorManager.getDeviceInfo(new IDeviceInfo() {
-
- @Override
- public void onDeviceFound(DeviceInfo devInfo) {
- info = devInfo;
- lockObject.countDown();
- }
- });
-
- try {
- lockObject.await(10, TimeUnit.SECONDS);
- } catch (InterruptedException e) {
- }
-
- assertNotNull(info);
- }*/
-
- /**
- * when listener is null
- * Checkign crash
- */
- //TODO crashing
- /*public void testGetDeviceInfo_N01() {
- SimulatorManager.getDeviceInfo(null);
- }*/
-
- /**
- * Checkign for crash
+ * Checking for crash
*/
public void testSetPlatformInfo_P01()
{
SimulatorManager.setPlatformInfo(platformInfo);
}
-
- /**
- * Checkign for crash
- */
- //TODO crashing
- /*public void testSetPlatformInfo_N01() {
- SimulatorManager.setPlatformInfo(null);
- }*/
-
- /**
- * Checkign for crash
- */
- //TODO crashing
- /*public void testSetPlatformInfo_N02() {
- SimulatorManager.setPlatformInfo(new PlatformInfo());
- }*/
-
- /**
- * Checkign for crash
- */
- //TODO crashing
- /*public void testGetPlatformInfo_P01() {
- lockObject = new CountDownLatch(1);
-
- SimulatorManager.getPlatformInfo(new IPlatformInfo() {
-
- @Override
- public void onPlatformFound(PlatformInfo info) {
- platformInfo = info;
- }
- });
-
- try {
- lockObject.await(10, TimeUnit.SECONDS);
- } catch (InterruptedException e) {
- }
-
- assertNotNull(platformInfo);
- }*/
-
- /**
- * Setting listener to null
- * Checkign for crash
- */
- //TODO crashing
- /*public void testGetPlatformInfo_N01() {
- SimulatorManager.getPlatformInfo(null);
- }*/
-}
\ No newline at end of file
+}
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.test;
import org.oic.simulator.clientcontroller.SimulatorRemoteResource;
+/**
+ * This class provides methods to set/get remote resource objects.
+ */
public class SimulatorRemoteResourceObject
{
+/*
+ * Copyright 2015 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.oic.simulator.test;
import java.util.Map;
import org.oic.simulator.ResourceAttribute;
import org.oic.simulator.SimulatorResourceModel;
+/**
+ * This class tests the functionality of Simulator Resource Model
+ * class APIs.
+ */
public class SimulatorResourceModelTest extends TestCase
{
assertTrue(result);
}
- /**
- * Crashing. Not handled
- */
- //TODO check
- /*public void testAddAttributeString_N02() {
- String val = null;
-
- boolean result = true;
- try {
- simulatorResourceModel.addAttributeString(KEY, val);
- result = result && simulatorResourceModel.getAttribute(KEY).getValue().toString().equals(val);
- } catch(Exception e) {
- result = false;
- }
-
- assertTrue(result);
- }*/
-
public void testAddAttributeString_N03()
{
String val = "@#$$&^*^(*^&";
assertTrue(result);
}
- //TODO boolean not able to set
public void testAddAttributeBoolean_P01()
{
boolean result = true;
assertTrue(result);
}
- //TODO boolean not able to set
public void testGetAttributes_P01()
{
boolean result = true;