]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.db.tests/src/org/simantics/db/tests/regression/bugs/Issue3288Test1.java
Accept existential variables as record shorthand fields
[simantics/platform.git] / tests / org.simantics.db.tests / src / org / simantics / db / tests / regression / bugs / Issue3288Test1.java
1 package org.simantics.db.tests.regression.bugs;
2 /*******************************************************************************
3  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4  * in Industry THTH ry.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  *     VTT Technical Research Centre of Finland - initial API and implementation
12  *******************************************************************************/
13
14
15 import org.junit.Test;
16 import org.simantics.db.Resource;
17 import org.simantics.db.VirtualGraph;
18 import org.simantics.db.WriteGraph;
19 import org.simantics.db.exception.DatabaseException;
20 import org.simantics.db.request.UndoTraits;
21 import org.simantics.db.request.Write;
22 import org.simantics.db.testing.cases.FreshDatabaseTest;
23 import org.simantics.layer0.Layer0;
24 /**
25  * Meant to be run together wit Issue3288Test2.
26  * This test stops server in the middle of transaction.
27  * Issue3288Test2 can be used to visually check that recovery does at least something.
28  * At the moment both must be manually run with separate runs.  
29  */
30 public class Issue3288Test1 extends FreshDatabaseTest {
31     @Test
32     public void test() throws DatabaseException {
33         getSession().syncRequest(new Modi());
34     }
35     private static class Modi implements Write {
36         @Override
37         public UndoTraits getUndoTraits() {
38             return null;
39         }
40         @Override
41         public VirtualGraph getProvider() {
42             return null;
43         }
44         @Override
45         public void perform(WriteGraph graph) throws DatabaseException {
46             Resource rl = graph.getRootLibrary();
47             Layer0 l0 = Layer0.getInstance(graph);
48             Resource r = graph.newResource();
49             graph.claim(rl, l0.ConsistsOf, r);
50             graph.flushCluster(rl);
51             System.setSecurityManager(null);
52             System.exit(666);
53         }
54     }
55 }