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

additional unit test

parent f7dcf543
No related branches found
No related tags found
1 merge request!93Resolve "export should use API"
...@@ -24,6 +24,7 @@ import lcsb.mapviewer.api.RestTestFunctions; ...@@ -24,6 +24,7 @@ import lcsb.mapviewer.api.RestTestFunctions;
import lcsb.mapviewer.common.exception.InvalidArgumentException; import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.converter.graphics.PdfImageGenerator; import lcsb.mapviewer.converter.graphics.PdfImageGenerator;
import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser; import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
import lcsb.mapviewer.model.cache.FileEntry;
import lcsb.mapviewer.model.map.MiriamType; import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.model.Model; import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.services.interfaces.IModelService; import lcsb.mapviewer.services.interfaces.IModelService;
...@@ -50,12 +51,23 @@ public class ProjectRestImplTest extends RestTestFunctions { ...@@ -50,12 +51,23 @@ public class ProjectRestImplTest extends RestTestFunctions {
} }
@Test @Test
public void testGetModelAsImage() throws Exception { public void testGetModelAsImageForInvalidConverter() throws Exception {
try { try {
ProjectRestImpl projectRest = createMockProjectRest("testFiles/model/sample.xml"); ProjectRestImpl projectRest = createMockProjectRest("testFiles/model/sample.xml");
projectRest.getModelAsImage(token.getId(), "sample", "0", "", "", "", "", ""); projectRest.getModelAsImage(token.getId(), "sample", "0", "", "", "", "", "");
fail("Exception expected"); fail("Exception expected");
} catch (InvalidArgumentException e) { } catch (Exception e) {
e.printStackTrace();
throw e;
}
}
@Test
public void testGetModelAsImage() throws Exception {
try {
ProjectRestImpl projectRest = createMockProjectRest("testFiles/model/sample.xml");
FileEntry result = projectRest.getModelAsImage(token.getId(), "sample", "0", PdfImageGenerator.class.getCanonicalName(), "", "", "", "");
assertNotNull(result);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw e; throw e;
......
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