1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
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
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.db.tests.api.support.clusterControl;
14 import org.junit.Test;
15 import org.simantics.db.WriteGraph;
16 import org.simantics.db.service.ClusterControl;
17 import org.simantics.db.service.ClusteringSupport;
18 import org.simantics.db.testing.base.ExistingDatabaseTest;
19 import org.simantics.db.testing.common.WriteQuery;
22 * Creates large amount of instances in multiple transactions
23 * and the tries to verify that instances are written into the database.
25 * @author Marko Luukkainen <marko.luukkainen@vtt.fi>
28 public class WriteNewResourceIntoCollectedCluster extends ExistingDatabaseTest {
31 public void test() throws Exception{
33 final long clusterId = getSession().getService(ClusteringSupport.class).getCluster(getSession().getRootLibrary());
35 getSession().getService(ClusterControl.class).collectClusters(Integer.MAX_VALUE);
37 getSession().syncRequest(new WriteQuery(this) {
39 public void run(WriteGraph g) throws Throwable {
41 g.newResource(clusterId);