X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.testing%2Fsrc%2Forg%2Fsimantics%2Fdb%2Ftesting%2Fcases%2FFreshDatabaseTest.java;fp=bundles%2Forg.simantics.db.testing%2Fsrc%2Forg%2Fsimantics%2Fdb%2Ftesting%2Fcases%2FFreshDatabaseTest.java;h=963b2d9f5d23af902da80f54221f647c04d9a10e;hb=67fd62f9c742337ec80eef658192db198a0efaac;hp=0000000000000000000000000000000000000000;hpb=cde82ba81327d5515fdca362f7f4c70f5103ae80;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.testing/src/org/simantics/db/testing/cases/FreshDatabaseTest.java b/bundles/org.simantics.db.testing/src/org/simantics/db/testing/cases/FreshDatabaseTest.java new file mode 100644 index 000000000..963b2d9f5 --- /dev/null +++ b/bundles/org.simantics.db.testing/src/org/simantics/db/testing/cases/FreshDatabaseTest.java @@ -0,0 +1,68 @@ +package org.simantics.db.testing.cases; +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ + + +import org.junit.After; +import org.junit.Before; +import org.simantics.SimanticsPlatform; +import org.simantics.db.Resource; +import org.simantics.db.Session; +import org.simantics.db.testing.common.DatabaseState; +import org.simantics.db.testing.common.TestBase; +import org.simantics.db.testing.common.TestSettings; +import org.simantics.db.testing.common.Tests; + +public class FreshDatabaseTest extends TestBase { + + public void configure(TestSettings settings) { + + } + + @Before + public void setUp() throws Exception { + + TestBase.printStart(this); + TestSettings testSettings = TestSettings.getInstanceUnsafe(); + configure(testSettings); +// state = AcornTests.newSimanticsWorkspace(testSettings, null); + state = Tests.newSimanticsWorkspace(testSettings, null); + + super.setUp(); + + } + + @After + public void tearDown() throws Exception { + Tests.shutdown(state); + super.tearDown(); + } + + public Resource getProjectResource() { + return SimanticsPlatform.INSTANCE.projectResource; + } + + protected Session getSession() { + return state.getSession(); + } + + public DatabaseState getState() { + return state; + } + + public void reconnect() throws Exception { + setPrintStart(false); + tearDown(); + setUp(); + setPrintStart(true); + } +}