Author: michiel
Date: 2009-07-06 15:35:00 +0200 (Mon, 06 Jul 2009)
New Revision: 36566
Modified:
mmbase/trunk/tests/bridge/org/mmbase/bridge/NodeTest.java
Log:
testing also editing a context together with another field
Modified: mmbase/trunk/tests/bridge/org/mmbase/bridge/NodeTest.java
===================================================================
--- mmbase/trunk/tests/bridge/org/mmbase/bridge/NodeTest.java 2009-07-06
13:20:21 UTC (rev 36565)
+++ mmbase/trunk/tests/bridge/org/mmbase/bridge/NodeTest.java 2009-07-06
13:35:00 UTC (rev 36566)
@@ -330,6 +330,7 @@
assertEquals(node.getContext(), node.getValue("owner"));
node.commit();
+ assertEquals("Context did not change '" + otherContext + "' != '"
+ node.getStringValue("owner") + "'", otherContext,
node.getStringValue("owner"));
assertEquals("Context did not change '" + otherContext + "' != '"
+ node.getContext() + "'", otherContext, node.getContext());
assertEquals(node.getContext(), node.getValue("owner"));
} else {
@@ -352,9 +353,11 @@
// now, the new context must be equal to otherContext
assertEquals("Context did not change '" + otherContext + "' != '"
+ node.getContext() + "'", otherContext, node.getContext());
assertEquals(node.getContext(), node.getValue("owner"));
-
+ assertEquals(node.getContext(), node.getStringValue("owner"));
+ System.out.println("----------Committing " + node + " context
should be " + otherContext);
node.commit();
+ assertEquals("Context did not change '" + otherContext + "' != '"
+ node.getStringValue("owner") + "'", otherContext,
node.getStringValue("owner"));
assertEquals("Context did not change '" + otherContext + "' != '"
+ node.getContext() + "'", otherContext, node.getContext());
assertEquals(node.getContext(), node.getValue("owner"));
} else {
@@ -363,6 +366,29 @@
}
+
+
+ public void testSetContext2() {
+
+ if
(Boolean.TRUE.equals(getCloudContext().getAuthentication().getAttribute(AuthenticationData.STORES_CONTEXT_IN_OWNER)))
{
+ String context = node.getContext();
+ String otherContext = getOtherContext(node);
+
+ node.setStringValue("stringfield", "Setting something else too");
+ // set context to something different:
+ node.setContext(otherContext);
+ assertEquals("Context did not change '" + otherContext + "' != '"
+ node.getContext() + "'", otherContext, node.getContext());
+ assertEquals(node.getContext(), node.getValue("owner"));
+ node.commit();
+ assertEquals("Context did not change '" + otherContext + "' != '"
+ node.getStringValue("owner") + "'", otherContext,
node.getStringValue("owner"));
+ assertEquals("Context did not change '" + otherContext + "' != '"
+ node.getContext() + "'", otherContext, node.getContext());
+ assertEquals(node.getContext(), node.getValue("owner"));
+ } else {
+ System.err.println("Warning: could not execute 'set owner' test,
because security authorization implemention does not store context in owner
field");
+ }
+ }
+
+
public void testFieldGUI() {
try {
node.getStringValue("gui()");
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs