Commit 8e4031af authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1540-export-error' into 'devel_16.0.x'

Resolve "MINERVANET - Error Report 326"

See merge request !1335
parents 6122571d b09b2cc4
Pipeline #46523 passed with stage
in 15 minutes and 37 seconds
minerva (16.0.0~beta.2) stable; urgency=medium minerva (16.0.0~beta.2) stable; urgency=medium
* Bug fix: problem with export map with submaps fixed (#1540) * Bug fix: problem with export map with submaps fixed (#1540)
-- Piotr Gawron <piotr.gawron@uni.lu> Fri, 3 Sep 2021 11:00:00 +0200
minerva (16.0.0~beta.1) stable; urgency=medium minerva (16.0.0~beta.1) stable; urgency=medium
* Backward incompatibility: layout parameter in minerva url is not supported * Backward incompatibility: layout parameter in minerva url is not supported
anymore anymore
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</parent> </parent>
<artifactId>CellDesigner-plugin</artifactId> <artifactId>CellDesigner-plugin</artifactId>
<!-- dependency from the MapViewer model --> <!-- dependency from the MapViewer model -->
...@@ -50,19 +50,19 @@ ...@@ -50,19 +50,19 @@
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId> <artifactId>model</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>commons</artifactId> <artifactId>commons</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>converter-CellDesigner</artifactId> <artifactId>converter-CellDesigner</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</parent> </parent>
<artifactId>annotation</artifactId> <artifactId>annotation</artifactId>
<name>Annotation module</name> <name>Annotation module</name>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId> <artifactId>model</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<!-- dependency from the MapViewer dao --> <!-- dependency from the MapViewer dao -->
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>persist</artifactId> <artifactId>persist</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<!-- dependency from the MapViewer cell designer parser (we need access <!-- dependency from the MapViewer cell designer parser (we need access
...@@ -34,13 +34,13 @@ ...@@ -34,13 +34,13 @@
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>converter-CellDesigner</artifactId> <artifactId>converter-CellDesigner</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>converter</artifactId> <artifactId>converter</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<!-- Log4J2 --> <!-- Log4J2 -->
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</parent> </parent>
<artifactId>commons</artifactId> <artifactId>commons</artifactId>
<name>Mapviewer commons</name> <name>Mapviewer commons</name>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</parent> </parent>
<artifactId>converter-CellDesigner</artifactId> <artifactId>converter-CellDesigner</artifactId>
<name>CellDesigner converter</name> <name>CellDesigner converter</name>
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId> <artifactId>model</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>converter</artifactId> <artifactId>converter</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<!-- Log4J2 --> <!-- Log4J2 -->
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</parent> </parent>
<artifactId>converter-SBGNML</artifactId> <artifactId>converter-SBGNML</artifactId>
...@@ -20,26 +20,26 @@ ...@@ -20,26 +20,26 @@
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId> <artifactId>model</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>persist</artifactId> <artifactId>persist</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>converter-CellDesigner</artifactId> <artifactId>converter-CellDesigner</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>converter-graphics</artifactId> <artifactId>converter-graphics</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</parent> </parent>
<artifactId>converter-graphics</artifactId> <artifactId>converter-graphics</artifactId>
<name>MapViewer graphics converter</name> <name>MapViewer graphics converter</name>
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId> <artifactId>model</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>model-command</artifactId> <artifactId>model-command</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<!-- Log4J2--> <!-- Log4J2-->
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<parent> <parent>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</parent> </parent>
<artifactId>converter-sbml</artifactId> <artifactId>converter-sbml</artifactId>
<name>converter-sbml</name> <name>converter-sbml</name>
...@@ -40,22 +40,22 @@ ...@@ -40,22 +40,22 @@
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId> <artifactId>model</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>model-command</artifactId> <artifactId>model-command</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>converter-CellDesigner</artifactId> <artifactId>converter-CellDesigner</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>converter</artifactId> <artifactId>converter</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<!-- Log4J2 --> <!-- Log4J2 -->
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>converter-graphics</artifactId> <artifactId>converter-graphics</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</parent> </parent>
<artifactId>converter</artifactId> <artifactId>converter</artifactId>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId> <artifactId>model</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>xerces</groupId> <groupId>xerces</groupId>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<parent> <parent>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</parent> </parent>
<artifactId>frontend-js</artifactId> <artifactId>frontend-js</artifactId>
<name>frontend-js</name> <name>frontend-js</name>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<parent> <parent>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</parent> </parent>
<artifactId>model-command</artifactId> <artifactId>model-command</artifactId>
<name>Model commands</name> <name>Model commands</name>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId> <artifactId>model</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>converter-CellDesigner</artifactId> <artifactId>converter-CellDesigner</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<!-- Log4J2--> <!-- Log4J2-->
......
...@@ -142,7 +142,9 @@ public class CopyCommand extends NewModelCommand { ...@@ -142,7 +142,9 @@ public class CopyCommand extends NewModelCommand {
original = connection.getParentModel(); original = connection.getParentModel();
copy = copies.get(original); copy = copies.get(original);
if (copy == null) { if (copy == null) {
throw new InvalidModelException("Original model contain reference to model that wasn't copied"); if (!original.equals(modelCopy)) {
throw new InvalidModelException("Original model contain reference to model that wasn't copied");
}
} else { } else {
connection.setParentModel(copy); connection.setParentModel(copy);
} }
......
package lcsb.mapviewer.commands; package lcsb.mapviewer.commands;
import static org.junit.Assert.*; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.*; import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import org.apache.commons.lang3.mutable.MutableBoolean; import org.apache.commons.lang3.mutable.MutableBoolean;
import org.junit.*; import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.Project; import lcsb.mapviewer.model.Project;
import lcsb.mapviewer.model.graphics.PolylineData; import lcsb.mapviewer.model.graphics.PolylineData;
import lcsb.mapviewer.model.map.MiriamData; import lcsb.mapviewer.model.map.MiriamData;
...@@ -17,11 +24,22 @@ import lcsb.mapviewer.model.map.compartment.SquareCompartment; ...@@ -17,11 +24,22 @@ import lcsb.mapviewer.model.map.compartment.SquareCompartment;
import lcsb.mapviewer.model.map.kinetics.SbmlFunction; import lcsb.mapviewer.model.map.kinetics.SbmlFunction;
import lcsb.mapviewer.model.map.kinetics.SbmlParameter; import lcsb.mapviewer.model.map.kinetics.SbmlParameter;
import lcsb.mapviewer.model.map.layout.graphics.Layer; import lcsb.mapviewer.model.map.layout.graphics.Layer;
import lcsb.mapviewer.model.map.model.*; import lcsb.mapviewer.model.map.model.Author;
import lcsb.mapviewer.model.map.reaction.*; import lcsb.mapviewer.model.map.model.ElementSubmodelConnection;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.model.ModelComparator;
import lcsb.mapviewer.model.map.model.ModelFullIndexed;
import lcsb.mapviewer.model.map.model.ModelSubmodelConnection;
import lcsb.mapviewer.model.map.model.SubmodelType;
import lcsb.mapviewer.model.map.reaction.AbstractNode;
import lcsb.mapviewer.model.map.reaction.Product;
import lcsb.mapviewer.model.map.reaction.Reactant;
import lcsb.mapviewer.model.map.reaction.Reaction;
import lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction; import lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction;
import lcsb.mapviewer.model.map.reaction.type.TransportReaction; import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
import lcsb.mapviewer.model.map.species.*; import lcsb.mapviewer.model.map.species.Complex;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.model.map.species.GenericProtein;
public class CopyCommandTest extends CommandTestFunctions { public class CopyCommandTest extends CommandTestFunctions {
...@@ -219,17 +237,6 @@ public class CopyCommandTest extends CommandTestFunctions { ...@@ -219,17 +237,6 @@ public class CopyCommandTest extends CommandTestFunctions {
assertEquals(0, comparator.compare(model, copy)); assertEquals(0, comparator.compare(model, copy));
} }
@Test(expected = InvalidArgumentException.class)
public void testCopyModelWithSubmodelsThrowException() throws Exception {
Model model = getModel();
Model model2 = getModel();
model2.setNotes("ASDSA2");
model.getElementByElementId("a_id")
.setSubmodel(new ElementSubmodelConnection(model2, SubmodelType.DOWNSTREAM_TARGETS));
new CopyCommand(model).execute();
}
private Model getModel() { private Model getModel() {
Model model = new ModelFullIndexed(null); Model model = new ModelFullIndexed(null);
model.setName("nam" + counter++); model.setName("nam" + counter++);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</parent> </parent>
<artifactId>model</artifactId> <artifactId>model</artifactId>
<name>model MapViewer</name> <name>model MapViewer</name>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>commons</artifactId> <artifactId>commons</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<!-- Java xml serialization --> <!-- Java xml serialization -->
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</parent> </parent>
<artifactId>pathvisio</artifactId> <artifactId>pathvisio</artifactId>
<name>Pathvisio plugin</name> <name>Pathvisio plugin</name>
...@@ -77,20 +77,20 @@ ...@@ -77,20 +77,20 @@
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId> <artifactId>model</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>converter-CellDesigner</artifactId> <artifactId>converter-CellDesigner</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>converter-graphics</artifactId> <artifactId>converter-graphics</artifactId>
<scope>test</scope> <scope>test</scope>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</dependency> </dependency>
<!-- Log4J2 --> <!-- Log4J2 -->
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<parent> <parent>
<groupId>lcsb.mapviewer</groupId> <groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>16.0.0~beta.1</version> <version>16.0.0~beta.2</version>
</parent> </parent>