summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierrick MARIE2012-07-04 09:42:30 (EDT)
committerBenjamin Cabé2012-07-04 09:42:30 (EDT)
commit154451a56d153fae00fd1d241c73bb10d327e869 (patch)
treec988381cfcd0daad003335608f1f1e5507361655
parent05cc70ebdced6dc2c6dd9ca51633460cf9a09366 (diff)
downloadorg.eclipse.koneki.simulators-154451a56d153fae00fd1d241c73bb10d327e869.zip
org.eclipse.koneki.simulators-154451a56d153fae00fd1d241c73bb10d327e869.tar.gz
org.eclipse.koneki.simulators-154451a56d153fae00fd1d241c73bb10d327e869.tar.bz2
Improve unit tests
-rw-r--r--omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/DeviceImpl.java6
-rw-r--r--omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/NodeImpl.java1
-rw-r--r--omadm/tests/org.eclipse.koneki.simulators.omadm.model.tests/src/org/eclipse/koneki/simulators/omadm/model/tests/DeviceTest.java4
3 files changed, 6 insertions, 5 deletions
diff --git a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/DeviceImpl.java b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/DeviceImpl.java
index f035ef8..4080469 100644
--- a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/DeviceImpl.java
+++ b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/DeviceImpl.java
@@ -489,12 +489,12 @@ public class DeviceImpl extends EObjectImpl implements Device {
eNotify(new ENotificationImpl(this, Notification.SET, OMADMSimulatorPackage.DEVICE__AUTHENTICATION, oldAuthentication,
newAuthentication));
} else {
- authNode.setData(AuthenticationType.BASIC.getName());
- authentication = AuthenticationType.BASIC;
+ authNode.setData(AuthenticationType.NONE.getName());
+ authentication = AuthenticationType.NONE;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, OMADMSimulatorPackage.DEVICE__AUTHENTICATION, oldAuthentication,
- AuthenticationType.BASIC));
+ AuthenticationType.NONE));
}
}
}
diff --git a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/NodeImpl.java b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/NodeImpl.java
index a4557a4..04639f4 100644
--- a/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/NodeImpl.java
+++ b/omadm/bundles/org.eclipse.koneki.simulators.omadm.model/src/org/eclipse/koneki/simulators/omadm/model/impl/NodeImpl.java
@@ -488,6 +488,7 @@ public class NodeImpl extends EObjectImpl implements Node {
device.setAuthentication(auth);
} catch (Exception e) {
// The authentication type doesn't exist for the value of newData
+ device.setAuthentication(AuthenticationType.NONE);
}
} else if (NodeHelpers.findFirstNode(NodeHelpers.getNode(getRoot(), "./DMAcc/AppAddr"), "AddrType") == this) {
diff --git a/omadm/tests/org.eclipse.koneki.simulators.omadm.model.tests/src/org/eclipse/koneki/simulators/omadm/model/tests/DeviceTest.java b/omadm/tests/org.eclipse.koneki.simulators.omadm.model.tests/src/org/eclipse/koneki/simulators/omadm/model/tests/DeviceTest.java
index 6badf20..cba80c0 100644
--- a/omadm/tests/org.eclipse.koneki.simulators.omadm.model.tests/src/org/eclipse/koneki/simulators/omadm/model/tests/DeviceTest.java
+++ b/omadm/tests/org.eclipse.koneki.simulators.omadm.model.tests/src/org/eclipse/koneki/simulators/omadm/model/tests/DeviceTest.java
@@ -233,8 +233,8 @@ public class DeviceTest extends TestCase {
}
Map<String, AuthenticationType> tests = new HashMap<String, AuthenticationType>();
- tests.put("Foo", AuthenticationType.BASIC);
- tests.put("", AuthenticationType.BASIC);
+ tests.put("Foo", AuthenticationType.NONE);
+ tests.put("", AuthenticationType.NONE);
for (Map.Entry<String, AuthenticationType> t : tests.entrySet()) {
testedNode.setData(t.getKey());