From 35af2c91e5440e2ee98508ec544487ce42943eb2 Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Wed, 7 Nov 2018 11:01:02 +0100 Subject: [PATCH] unit test showing that conversion via sbml doesn't work --- .../api/convert/ConvertRestImplTest.java | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/rest-api/src/test/java/lcsb/mapviewer/api/convert/ConvertRestImplTest.java b/rest-api/src/test/java/lcsb/mapviewer/api/convert/ConvertRestImplTest.java index 47303b49d9..2b29e95d8e 100644 --- a/rest-api/src/test/java/lcsb/mapviewer/api/convert/ConvertRestImplTest.java +++ b/rest-api/src/test/java/lcsb/mapviewer/api/convert/ConvertRestImplTest.java @@ -157,16 +157,36 @@ public class ConvertRestImplTest extends RestTestFunctions { @Test public void testCellDesigner2Sbml2Svg() throws Exception { try { - File file = new File("testFiles/convert/neuron_cd.xml"); - String content = FileUtils.readFileToString(file); - String resultSbml = convertRestImpl.convert(token, "CellDesigner_SBML", "SBML", content).toString(); - String resultSvg = convertRestImpl.converToImage(token, "SBML", "svg", resultSbml).toString(); - - // FileOutputStream outputStream = new FileOutputStream("sample-cd.png"); - // outputStream.write(convertRestImpl.converToImage(token, "CellDesigner_SBML", "png", content).toByteArray()); - // outputStream.close(); + File file = new File("testFiles/convert/neuron_cd.xml"); + String content = FileUtils.readFileToString(file); + String resultSbml = convertRestImpl.convert(token, "CellDesigner_SBML", "SBML", content).toString(); + String resultSvg = convertRestImpl.converToImage(token, "SBML", "svg", resultSbml).toString(); + + // FileOutputStream outputStream = new FileOutputStream("sample-cd.png"); + // outputStream.write(convertRestImpl.converToImage(token, "CellDesigner_SBML", "png", content).toByteArray()); + // outputStream.close(); + + assertTrue(resultSvg.contains("<rect")); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testCellDesigner2Sbml2CellDesignerSvg() throws Exception { + try { + File file = new File("testFiles/convert/neuron_cd.xml"); + String content = FileUtils.readFileToString(file); + String resultSbml = convertRestImpl.convert(token, "CellDesigner_SBML", "SBML", content).toString(); + String resultCellDesignerSbml = convertRestImpl.convert(token, "SBML", "CellDesigner_SBML", resultSbml).toString(); + String resultSvg = convertRestImpl.converToImage(token, "CellDesigner_SBML", "svg", resultCellDesignerSbml).toString(); + + // FileOutputStream outputStream = new FileOutputStream("sample-cd.png"); + // outputStream.write(convertRestImpl.converToImage(token, "CellDesigner_SBML", "png", content).toByteArray()); + // outputStream.close(); - assertTrue(resultSvg.contains("<rect")); + assertTrue(resultSvg.contains("<rect")); } catch (Exception e) { e.printStackTrace(); throw e; -- GitLab