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.Write;
21 import org.simantics.db.testing.cases.FreshDatabaseTest;
22 import org.simantics.layer0.Layer0;
24 * Meant to be run together wit Issue3288Test2.
25 * This test stops server in the middle of transaction.
26 * Issue3288Test2 can be used to visually check that recovery does at least something.
27 * At the moment both must be manually run with separate runs.
29 public class Issue3288Test1 extends FreshDatabaseTest {
31 public void test() throws DatabaseException {
32 getSession().syncRequest(new Modi());
34 private static class Modi implements Write {
36 public VirtualGraph getProvider() {
40 public void perform(WriteGraph graph) throws DatabaseException {
41 Resource rl = graph.getRootLibrary();
42 Layer0 l0 = Layer0.getInstance(graph);
43 Resource r = graph.newResource();
44 graph.claim(rl, l0.ConsistsOf, r);
45 graph.flushCluster(rl);
46 System.setSecurityManager(null);