Update of /var/cvs/tests/bridge/org/mmbase/bridge
In directory james.mmbase.org:/tmp/cvs-serv1816
Modified Files:
TransactionTest.java
Log Message:
more test-cases for transactions
See also: http://cvs.mmbase.org/viewcvs/tests/bridge/org/mmbase/bridge
Index: TransactionTest.java
===================================================================
RCS file: /var/cvs/tests/bridge/org/mmbase/bridge/TransactionTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- TransactionTest.java 13 Jun 2008 08:17:01 -0000 1.4
+++ TransactionTest.java 7 Jul 2008 13:18:37 -0000 1.5
@@ -16,7 +16,7 @@
* Test class <code>Transaction</code> from the bridge package.
*
* @author Michiel Meeuwissen
- * @version $Id: TransactionTest.java,v 1.4 2008/06/13 08:17:01 michiel Exp $
+ * @version $Id: TransactionTest.java,v 1.5 2008/07/07 13:18:37 michiel Exp $
* @since MMBase-1.8.6
*/
public class TransactionTest extends BridgeTest {
@@ -25,9 +25,9 @@
super(name);
}
-
int newNode;
+
public void setUp() {
// Create some test nodes
Cloud cloud = getCloud();
@@ -37,7 +37,6 @@
newNode = node.getNumber();
}
-
public void testCancel() {
Cloud cloud = getCloud();
Transaction t = cloud.getTransaction("bar1");
@@ -82,22 +81,42 @@
assertEquals("yyyyy", node.getStringValue("title"));
}
- /**
- * Test for http://www.mmbase.org/jira/browse/MMB-1621
- */
+
+ //Test for http://www.mmbase.org/jira/browse/MMB-1621
public void testGetValue() {
Cloud cloud = getCloud();
+ String value = cloud.getNode(newNode).getStringValue("title");
+
Transaction t = cloud.getTransaction("bar4");
Node node = t.getNode(newNode);
node.setStringValue("title", "zzzzz");
node.commit(); // committing inside transaction
- assertEquals("yyyyy", cloud.getNode(newNode).getStringValue("title"));
// TODO TODO, I think
-
// this is failing.
+ assertEquals(value, cloud.getNode(newNode).getStringValue("title"));
t.commit();
assertEquals("zzzzz", cloud.getNode(newNode).getStringValue("title"));
}
+ public void testCancelDelete() {
+ Cloud cloud = getCloud();
+ Transaction t = cloud.getTransaction("bar5");
+ Node node = t.getNode(newNode);
+ node.delete();
+ t.cancel();
+ assertTrue(cloud.hasNode(newNode));
+
+ }
+
+ public void testCommitDelete() {
+ Cloud cloud = getCloud();
+ Transaction t = cloud.getTransaction("bar6");
+ Node node = t.getNode(newNode);
+ node.delete();
+ t.commit();
+ assertFalse(cloud.hasNode(newNode));
+
+ }
+
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs