Update of /var/cvs/tests/cloudcontext/org/mmbase/security/cloudcontext
In directory james.mmbase.org:/tmp/cvs-serv20313
Modified Files:
CloudContext.java
Log Message:
test-cases on 'own' node, which may never be deleted. But the password may be
set.
See also:
http://cvs.mmbase.org/viewcvs/tests/cloudcontext/org/mmbase/security/cloudcontext
Index: CloudContext.java
===================================================================
RCS file:
/var/cvs/tests/cloudcontext/org/mmbase/security/cloudcontext/CloudContext.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- CloudContext.java 16 Dec 2008 17:09:24 -0000 1.4
+++ CloudContext.java 16 Dec 2008 17:27:09 -0000 1.5
@@ -68,6 +68,7 @@
assertTrue(news.mayWrite());
try {
context.setStringValue("name", "bla bla");
+ fail("Should not have been been allowed to write in an
mmbasecontext node");
} catch (SecurityException se) {
// ok
}
@@ -85,12 +86,12 @@
assertTrue(news.mayDelete());
try {
context.delete(true);
+ fail("Should not have been been allowed to delete an mmbasecontext
node");
} catch (SecurityException se) {
// ok
}
news.delete(true);
- news.commit();
}
@@ -103,6 +104,8 @@
assertTrue(news.mayChangeContext());
try {
context.setContext("default");
+ context.commit();
+ fail("Should not have been been allowed to set context of an
mmbasecontext node");
} catch (SecurityException se) {
// ok
}
@@ -114,6 +117,24 @@
}
+ public void testSetOwnPassord() {
+ Cloud cloud = getCloud("foo");
+ Node userNode =
cloud.getNode(cloud.getCloudContext().getAuthentication().getNode(cloud.getUser()));
+ assertEquals("foo", userNode.getStringValue("username"));
+ userNode.setStringValue("password", "bar2");
+ userNode.commit();
+ }
+ public void testDeleteOwnNode() {
+ Cloud cloud = getCloud("foo");
+ Node userNode =
cloud.getNode(cloud.getCloudContext().getAuthentication().getNode(cloud.getUser()));
+ try {
+ userNode.delete();
+ fail("Should not have been been allowed to delete own node");
+ } catch (SecurityException se) {
+ // ok
+ }
+ }
+
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs