1 package org.simantics.db.tests.regression.bugs;
2 /*******************************************************************************
3 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
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
11 * VTT Technical Research Centre of Finland - initial API and implementation
12 *******************************************************************************/
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;
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.
30 public class Issue3288Test1 extends FreshDatabaseTest {
32 public void test() throws DatabaseException {
33 getSession().syncRequest(new Modi());
35 private static class Modi implements Write {
37 public UndoTraits getUndoTraits() {
41 public VirtualGraph getProvider() {
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);