1 /******************************************************************
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 ******************************************************************/
21 package org.iotivity.service.sample.container;
23 import android.test.InstrumentationTestCase;
24 import android.util.Log;
26 import org.iotivity.service.resourcecontainer.RcsResourceContainer;
28 import java.util.HashMap;
30 public class ResourceContainerTest extends InstrumentationTestCase {
31 private RcsResourceContainer resourceContainerInstance;
32 private final String sdCardDir =
33 "/data/local/tmp/org.iotivity.service.sample.resourcecontainer.test/files/";
37 resourceContainerInstance = new RcsResourceContainer(getInstrumentation().getContext());
40 public void testStartContainer() {
41 resourceContainerInstance.startContainer("");
42 assertTrue(resourceContainerInstance.listBundles().size() == 0);
43 resourceContainerInstance.stopContainer();
46 public void testAddConfig(){
47 resourceContainerInstance.startContainer("");
48 //resourceContainerInstance.addBundle("");
49 assertTrue(resourceContainerInstance.listBundles().size() == 0);
50 resourceContainerInstance.stopContainer();
53 public void testStartBundle(){
54 resourceContainerInstance.startBundle("not.existing");
55 assertEquals(0, resourceContainerInstance.listBundles().size());
58 public void testStopBundle(){
59 resourceContainerInstance.startBundle("not.existing");
60 assertEquals(0, resourceContainerInstance.listBundles().size());
63 public void testAddBundle(){
64 resourceContainerInstance.startContainer(
67 resourceContainerInstance.addBundle("oic.bundle.test", "",
68 sdCardDir + "libSoftSensorBundle.so",
69 "disensor", new HashMap<String, String>());
70 resourceContainerInstance.startBundle("oic.bundle.test");
71 resourceContainerInstance.stopContainer();