Skip to content
Snippets Groups Projects
Commit 72a6e945 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

fix graphics tests

parent cd8676d9
No related branches found
No related tags found
1 merge request!1884Resolve "prepare zip from edited project"
package lcsb.mapviewer.converter.graphics;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.io.File;
import java.io.IOException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import lcsb.mapviewer.commands.CreateHierarchyCommand;
import lcsb.mapviewer.common.Configuration;
import lcsb.mapviewer.converter.graphics.AbstractImageGenerator.Params;
......@@ -28,6 +10,23 @@ import lcsb.mapviewer.model.map.layout.graphics.LayerText;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.model.ModelFullIndexed;
import lcsb.mapviewer.model.map.species.Complex;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.io.File;
import java.io.IOException;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
public class PdfImageGeneratorTest extends GraphicsTestFunctions {
......@@ -45,17 +44,18 @@ public class PdfImageGeneratorTest extends GraphicsTestFunctions {
File f = new File(filename);
if (f.exists()) {
f.delete();
assertTrue(f.delete());
}
assertFalse(f.exists());
Model model = createCompartmentModel();
Layer layer = model.getLayers().iterator().next();
layer.setName(CreateHierarchyCommand.PATHWAY_LAYER_NAME);
layer.addLayerText(new LayerText(new Rectangle2D.Double(10, 10, 500, 500), "X asd"));
layer.addLayerText(new LayerText(new Rectangle2D.Double(20, 20, 200, 200), "Y qwe ret"));
layer.addLayerText(new LayerText(new Rectangle2D.Double(100, 100, 199, 220), "Z dgf fsd aaewq ret"));
layer.addLayerText(new LayerText(new Rectangle2D.Double(100, 100, 199, 220), "Z dgf fsd blah ret"));
for (final LayerText text : layer.getTexts()) {
text.setZ(0);
......@@ -71,7 +71,7 @@ public class PdfImageGeneratorTest extends GraphicsTestFunctions {
pig.saveToFile("tmp.pdf");
assertTrue(f.exists());
f.delete();
assertTrue(f.delete());
assertFalse(f.exists());
}
......@@ -81,7 +81,7 @@ public class PdfImageGeneratorTest extends GraphicsTestFunctions {
File f = new File(filename);
if (f.exists()) {
f.delete();
assertTrue(f.delete());
}
assertFalse(f.exists());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment