]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.db.tests/src/org/simantics/db/tests/api/support/undoRedoSupport/UndoTest07.java
Added missing org.simantics.db.{tests,testing} plug-ins.
[simantics/platform.git] / tests / org.simantics.db.tests / src / org / simantics / db / tests / api / support / undoRedoSupport / UndoTest07.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.db.tests.api.support.undoRedoSupport;
13
14 import org.junit.Test;
15 import org.simantics.db.Session;
16 import org.simantics.db.service.UndoRedoSupport;
17 import org.simantics.db.testing.base.ExistingDatabaseTest;
18
19 /**
20  * Test case description missing!
21  */
22 public class UndoTest07 extends ExistingDatabaseTest {
23
24         @Test
25     public void testUndo7() throws Exception {
26
27         Session session = getSession();
28         final UndoRedoSupport support = session.getService(UndoRedoSupport.class);
29         try {
30             Context c1 = new Context(session, support);
31             c1.create();
32             c1.check();
33             c1.add();
34             c1.check();
35             c1.addAppend();
36             c1.check();
37
38             c1.undo();
39             c1.check();
40
41             c1.add();
42             c1.check();
43             c1.addAppend();
44             c1.check();
45
46             Context c2 = new Context(session, support);
47             c2.create();
48             c2.check();
49             c2.add();
50             c2.check();
51             c1.addAppend();
52             c2.check();
53
54             c1.undo();
55             c1.check();
56             
57             c2.undo();
58             c2.check();
59         } catch (Throwable t) {
60             fail("Test failed with exception " + t);
61         }
62     }
63 }