package org.simantics.scl.osgi.tests; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import org.simantics.PlatformException; import org.simantics.Simantics; import org.simantics.application.arguments.Arguments; import org.simantics.application.arguments.IArgumentFactory; import org.simantics.application.arguments.IArguments; import org.simantics.application.arguments.SimanticsArguments; import org.simantics.scl.osgi.SCLOsgi; public class TestSCLOsgi { private static IProgressMonitor progress = new NullProgressMonitor(); @BeforeClass public static void setupDatabase() throws PlatformException { String[] args = new String[0]; IArgumentFactory[] accepted = { SimanticsArguments.RECOVERY_POLICY_FIX_ERRORS, SimanticsArguments.ONTOLOGY_RECOVERY_POLICY_REINSTALL, SimanticsArguments.SERVER, SimanticsArguments.LOCAL_SERVER_PORT, }; IArguments arguments = Arguments.parse(args, accepted); Simantics.setDefaultDatabaseDriver("acorn"); Simantics.startUpHeadless(arguments, progress); } @AfterClass public static void teardownDatabase() throws PlatformException { Simantics.shutdown(progress); } @Test public void testDataJsonExists() { String possibleError = SCLOsgi.compileAllModules(); if(possibleError != null) { Assert.fail(possibleError); } } }