{
public static string datPath = "/opt/usr/home/owner/share/res/iotcon-test-svr-db-server.dat";
internal const string LOGTAG = "IOT-TEST";
-
private static bool isSupported = false;
[SetUp]
public static void Init()
{
Log.Info(LOGTAG, "ServerManagerTest Init");
- Information.TryGetValue("http://tizen.org/feature/iot.ocf", out isSupported);
+ Tizen.System.Information.TryGetValue("http://tizen.org/feature/iot.ocf", out isSupported);
}
[TearDown]
Attributes attributes = new Attributes {
{ "state", "ON" }
};
- Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes);
+ Tizen.Network.IoTConnectivity.Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes);
/* TEST CODE */
IoTConnectivityServerManager.RegisterResource(res);
Attributes attributes = new Attributes {
{ "state", "ON" }
};
- Resource res = new LiteResource("", types, ResourcePolicy.Discoverable, attributes);
+ Tizen.Network.IoTConnectivity.Resource res = new LiteResource("", types, ResourcePolicy.Discoverable, attributes);
/* TEST CODE */
IoTConnectivityServerManager.RegisterResource(res);
Attributes attributes = new Attributes {
{ "state", "ON" }
};
- Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes);
+ Tizen.Network.IoTConnectivity.Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes);
IoTConnectivityServerManager.RegisterResource(res);
/* TEST CODE */
internal static ResourceOptions Options = null;
}
- public class DoorResourceNew : Resource
+ public class DoorResourceNew : Tizen.Network.IoTConnectivity.Resource
{
internal const string LOGTAG = "IOT-TEST";
private const string _attribute = "DOOR_ATTRIBUTE5";
{
Log.Info(LOGTAG, "OnPost Received in DoorResourceNew, UriPath:" + UriPath + ", Host: " + request.HostAddress);
ResourceTypes typesNew = new ResourceTypes(new List<string>() { "oic.iot.door6" });
- Resource resource = new DoorResourceNew("/door/uri6", typesNew, Interfaces, Policy);
+ Tizen.Network.IoTConnectivity.Resource resource = new DoorResourceNew("/door/uri6", typesNew, Interfaces, Policy);
IoTConnectivityServerManager.RegisterResource(resource);
Representation newRepresentation = new Representation();
newRepresentation.UriPath = "/door/uri6";
public static void Init()
{
Log.Info(LOGTAG, "RequestTests Init");
- Information.TryGetValue("http://tizen.org/feature/iot.ocf", out isSupported);
+ Tizen.System.Information.TryGetValue("http://tizen.org/feature/iot.ocf", out isSupported);
RequestData.OnGetReceivedFlag = false;
RequestData.OnPutReceivedFlag = false;
if (!_isRegistered && isSupported)
ifaces.Add(ResourceInterfaces.BatchInterface);
ResourceTypes types = new ResourceTypes(new List<string>() { "oic.iot.door.new" });
- Resource resource = new DoorResourceNew("/door/1", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
+ Tizen.Network.IoTConnectivity.Resource resource = new DoorResourceNew("/door/1", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
IoTConnectivityServerManager.RegisterResource(resource);
_isRegistered = true;
}
internal static bool OnObservingReceivedFlag = false;
}
- public class DoorResource : Resource
+ public class DoorResource : Tizen.Network.IoTConnectivity.Resource
{
internal const string LOGTAG = "IOT-TEST";
public const string DoorUri = "/door/uri5";
Log.Info(LOGTAG, "OnPost Received in DoorResource, UriPath:" + UriPath);
Flags.OnPostReceivedFlag = true;
ResourceTypes typesNew = new ResourceTypes(new List<string>() { "oic.iot.door6" });
- Resource resource = new DoorResource("/door/uri6", typesNew, Interfaces, Policy);
+ Tizen.Network.IoTConnectivity.Resource resource = new DoorResource("/door/uri6", typesNew, Interfaces, Policy);
IoTConnectivityServerManager.RegisterResource(resource);
Representation newRepresentation = new Representation();
newRepresentation.UriPath = "/door/uri6";
public static void Init()
{
Log.Info(LOGTAG, "ResourceTests Init");
- Information.TryGetValue("http://tizen.org/feature/iot.ocf", out isSupported);
+ Tizen.System.Information.TryGetValue("http://tizen.org/feature/iot.ocf", out isSupported);
Flags.OnGetReceivedFlag = false;
Flags.OnPostReceivedFlag = false;
Flags.OnPutReceivedFlag = false;
ifaces.Add(ResourceInterfaces.BatchInterface);
ResourceTypes types = new ResourceTypes(new List<string>() { "oic.iot.door.new1" });
- Resource resource = new DoorResource("/door/2", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
+ Tizen.Network.IoTConnectivity.Resource resource = new DoorResource("/door/2", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
IoTConnectivityServerManager.RegisterResource(resource);
_isRegistered = true;
}
ifaces.Add(ResourceInterfaces.BatchInterface);
ResourceTypes types = new ResourceTypes(new List<string>() { "oic.iot.door.new" });
- Resource resource = new DoorResource(DoorResource.DoorUri, types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
+ Tizen.Network.IoTConnectivity.Resource resource = new DoorResource(DoorResource.DoorUri, types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
Assert.IsInstanceOf<DoorResource>(resource, "Object should be of type DoorResource");
resource?.Dispose();
ResourceInterfaces ifaces = new ResourceInterfaces(new List<string>() { ResourceInterfaces.DefaultInterface });
ifaces.Add(ResourceInterfaces.BatchInterface);
ResourceTypes types = new ResourceTypes(new List<string>() { "oic.iot.door.new" });
- Resource resource = new DoorResource(DoorResource.DoorUri, types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
+ Tizen.Network.IoTConnectivity.Resource resource = new DoorResource(DoorResource.DoorUri, types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
/* TEST CODE */
Assert.IsInstanceOf<ResourceInterfaces>(resource.Interfaces, "Property should be of type ResourceInterfaces");
ResourceInterfaces ifaces = new ResourceInterfaces(new List<string>() { ResourceInterfaces.DefaultInterface });
ifaces.Add(ResourceInterfaces.BatchInterface);
ResourceTypes types = new ResourceTypes(new List<string>() { "oic.iot.door.new" });
- Resource resource = new DoorResource(DoorResource.DoorUri, types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
+ Tizen.Network.IoTConnectivity.Resource resource = new DoorResource(DoorResource.DoorUri, types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
/* TEST CODE */
Assert.IsInstanceOf<ResourceTypes>(resource.Types, "Property should be of type ResourceTypes");
ResourceInterfaces ifaces = new ResourceInterfaces(new List<string>() { ResourceInterfaces.DefaultInterface });
ifaces.Add(ResourceInterfaces.BatchInterface);
ResourceTypes types = new ResourceTypes(new List<string>() { "oic.iot.door.new" });
- Resource resource = new DoorResource(DoorResource.DoorUri, types, ifaces, ResourcePolicy.Discoverable);
+ Tizen.Network.IoTConnectivity.Resource resource = new DoorResource(DoorResource.DoorUri, types, ifaces, ResourcePolicy.Discoverable);
/* TEST CODE */
Assert.IsInstanceOf<string>(resource.UriPath, "UriPath Property should be of type string");
ResourceInterfaces ifaces = new ResourceInterfaces(new List<string>() { ResourceInterfaces.DefaultInterface });
ifaces.Add(ResourceInterfaces.BatchInterface);
ResourceTypes types = new ResourceTypes(new List<string>() { "oic.iot.door.new" });
- Resource resource = new DoorResource(DoorResource.DoorUri, types, ifaces, ResourcePolicy.Discoverable);
+ Tizen.Network.IoTConnectivity.Resource resource = new DoorResource(DoorResource.DoorUri, types, ifaces, ResourcePolicy.Discoverable);
/* TEST CODE */
Assert.IsInstanceOf<ResourcePolicy>(resource.Policy, "Property should be of type ResourcePolicy");
ResourceTypes types1 = new ResourceTypes(new List<string>() { "oic.iot.door.new1" });
ResourceTypes types2 = new ResourceTypes(new List<string>() { "oic.iot.door.new2" });
- Resource resource = new DoorResource(DoorResource.DoorUri, types, ifaces, ResourcePolicy.Discoverable);
+ Tizen.Network.IoTConnectivity.Resource resource = new DoorResource(DoorResource.DoorUri, types, ifaces, ResourcePolicy.Discoverable);
IoTConnectivityServerManager.RegisterResource(resource);
- Resource child1 = new DoorResource(DoorResource.DoorUri1, types1, ifaces, ResourcePolicy.Discoverable);
- Resource child2 = new DoorResource(DoorResource.DoorUri2, types2, ifaces, ResourcePolicy.Discoverable);
+ Tizen.Network.IoTConnectivity.Resource child1 = new DoorResource(DoorResource.DoorUri1, types1, ifaces, ResourcePolicy.Discoverable);
+ Tizen.Network.IoTConnectivity.Resource child2 = new DoorResource(DoorResource.DoorUri2, types2, ifaces, ResourcePolicy.Discoverable);
IoTConnectivityServerManager.RegisterResource(child1);
IoTConnectivityServerManager.RegisterResource(child2);
resource.Children.Add(child1);
resource.Children.Add(child2);
/* TEST CODE */
- Assert.IsInstanceOf<ObservableCollection<Resource>>(resource.Children, "Children Property should be of type ObservableCollection");
+ Assert.IsInstanceOf<ObservableCollection<Tizen.Network.IoTConnectivity.Resource>>(resource.Children, "Children Property should be of type ObservableCollection");
Assert.AreEqual(resource.Children.Count, 2, "Count is incorrect");
Assert.AreEqual(resource.Children.ElementAt(0), child1, "Something goes wrong with 1st child");
Assert.AreEqual(resource.Children.ElementAt(1), child2, "Something goes wrong with 2nd child");
ifaces.Add(ResourceInterfaces.BatchInterface);
ResourceTypes types = new ResourceTypes(new List<string>() { "oic.iot.door.new.notify" });
- Resource resource = new DoorResource("/door/uri/new/notify", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
+ Tizen.Network.IoTConnectivity.Resource resource = new DoorResource("/door/uri/new/notify", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
IoTConnectivityServerManager.RegisterResource(resource);
/* TEST CODE */
ifaces.Add(ResourceInterfaces.BatchInterface);
ResourceTypes types = new ResourceTypes(new List<string>() { "oic.iot.door.new" });
- Resource resource = new DoorResource(DoorResource.DoorUri, types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
+ Tizen.Network.IoTConnectivity.Resource resource = new DoorResource(DoorResource.DoorUri, types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
/* TEST CODE */
Assert.IsNotNull(resource, "Resource should not be null before calling Dispose.");