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.client;
15 import org.junit.Test;
16 import org.simantics.db.Session;
17 import org.simantics.db.exception.DatabaseException;
18 import org.simantics.db.service.ClusteringSupport;
19 import org.simantics.db.testing.base.ExistingDatabaseTest;
22 * Tests that reserving cluster identifier works.
23 * Note that this test makes assumptions on implementatioin.
25 public class ReserveIdsTest1 extends ExistingDatabaseTest {
27 public void test() throws DatabaseException {
28 Session s = getSession();
29 ClusteringSupport cs = s.getService(ClusteringSupport.class);
30 long cid1 = cs.createCluster();
31 for (int i=0; i<100; ++i)
33 long cid2 = cs.createCluster();
34 assertTrue(cid2 == cid1 + 101);