--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.simantics</groupId>
+ <artifactId>org.simantics.modeling.tests</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <parent>
+ <groupId>org.simantics</groupId>
+ <artifactId>org.simantics.root.bundles</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+</project>
import org.simantics.modeling.tests.commands.WaitMapping;
import org.simantics.modeling.tests.commands.WriteHeapDump;
-public class ModelingCommandSequenceTest extends CommandSequenceTest {
+public abstract class ModelingCommandSequenceTest extends CommandSequenceTest {
protected WaitActiveExperiment waitExperiment = new WaitActiveExperiment();
protected WaitMapping waitMapping = new WaitMapping();
importJava "org.simantics.modeling.ModelingUtils" where
importSharedOntologyWithUI :: Variable -> <ReadGraph> ()
importSharedOntology :: String -> ()
+ importSharedOntology2 :: String -> <Proc> [Resource]
createSharedOntologyWithUI :: Resource -> <ReadGraph> ()
unlinkSharedOntologyWithUI :: Variable -> [Resource] -> <ReadGraph> ()
createNewVersionWithUI :: Resource -> <ReadGraph> ()
import org.simantics.db.layer0.genericrelation.DependenciesRelation.DependencyChangesRequest;
import org.simantics.db.layer0.genericrelation.DependencyChanges;
import org.simantics.db.layer0.genericrelation.IndexedRelations;
+import org.simantics.db.layer0.migration.MigratedImportResult;
import org.simantics.db.layer0.migration.MigrationUtils;
import org.simantics.db.layer0.request.ActivateModel;
import org.simantics.db.layer0.request.ActiveModels;
}
- public static void importSharedOntology(String fileName) throws Exception {
+ public static MigratedImportResult importSharedOntologyWithResult(String fileName) throws Exception {
try {
DataContainer dc = DataContainers.readFile(new File(fileName));
TransferableGraph1 tg = (TransferableGraph1)dc.content.getValue(TransferableGraph1.BINDING);
Variant draftStatus = dc.metadata.get(DraftStatusBean.EXTENSION_KEY);
- MigrationUtils.importSharedOntology(Simantics.getSession(), tg, draftStatus == null);
+ return MigrationUtils.importSharedOntology(Simantics.getSession(), tg, draftStatus == null);
} catch (Exception e) {
Logger.defaultLogError(e);
throw e;
}
}
+ public static void importSharedOntology(String fileName) throws Exception {
+ importSharedOntologyWithResult(fileName);
+ }
+
+ public static List<Resource> importSharedOntology2(String fileName) throws Exception {
+ MigratedImportResult result = importSharedOntologyWithResult(fileName);
+ return new ArrayList<Resource>(result.roots);
+ }
+
public static void importSharedOntologyWithUI(ReadGraph graph, final Variable variable) throws DatabaseException {
Display.getDefault().asyncExec(new Runnable() {
orElse (Just x) _ = x
orElse Nothing def = def
+@inline
+orElseM :: Maybe a -> (<e> Maybe a) -> <e> Maybe a
+orElseM mx@(Just x) _ = mx
+orElseM Nothing def = def
+
/// Either ///
"""
<module>org.simantics.modeling.ontology</module>
<module>org.simantics.modeling.template2d.ontology</module>
<module>org.simantics.modeling.template2d.ui</module>
+ <module>org.simantics.modeling.tests</module>
<module>org.simantics.modeling.ui</module>
<module>org.simantics.modeling.ui.workbench</module>
<module>org.simantics.msvc.runtime</module>
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.simantics.modeling.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>