diff --git a/wise-webapp/src/test/data/svg/map1.png b/wise-webapp/src/test/data/svg/map1.png
index 459be46b..df72c2ac 100644
Binary files a/wise-webapp/src/test/data/svg/map1.png and b/wise-webapp/src/test/data/svg/map1.png differ
diff --git a/wise-webapp/src/test/data/svg/map2.png b/wise-webapp/src/test/data/svg/map2.png
new file mode 100644
index 00000000..f79298d8
Binary files /dev/null and b/wise-webapp/src/test/data/svg/map2.png differ
diff --git a/wise-webapp/src/test/data/svg/map2.svg b/wise-webapp/src/test/data/svg/map2.svg
new file mode 100644
index 00000000..82409864
--- /dev/null
+++ b/wise-webapp/src/test/data/svg/map2.svg
@@ -0,0 +1,2737 @@
+
diff --git a/wise-webapp/src/test/data/svg/map3.png b/wise-webapp/src/test/data/svg/map3.png
new file mode 100644
index 00000000..ec75efe7
Binary files /dev/null and b/wise-webapp/src/test/data/svg/map3.png differ
diff --git a/wise-webapp/src/test/data/svg/map3.svg b/wise-webapp/src/test/data/svg/map3.svg
new file mode 100644
index 00000000..3a9ea569
--- /dev/null
+++ b/wise-webapp/src/test/data/svg/map3.svg
@@ -0,0 +1,470 @@
+
\ No newline at end of file
diff --git a/wise-webapp/src/test/data/svg/map4.svg b/wise-webapp/src/test/data/svg/map4.svg
new file mode 100644
index 00000000..231534c5
--- /dev/null
+++ b/wise-webapp/src/test/data/svg/map4.svg
@@ -0,0 +1,470 @@
+
\ No newline at end of file
diff --git a/wise-webapp/src/test/java/com/wisemapping/test/export/ExportTest.java b/wise-webapp/src/test/java/com/wisemapping/test/export/ExportTest.java
index 2394cabd..df59b208 100644
--- a/wise-webapp/src/test/java/com/wisemapping/test/export/ExportTest.java
+++ b/wise-webapp/src/test/java/com/wisemapping/test/export/ExportTest.java
@@ -31,7 +31,7 @@ public class ExportTest {
private static final String DATA_DIR_PATH = "src/test/data/svg/";
@Test(dataProvider = "Data-Provider-Function")
- public void exportSvgTest(@NotNull final File svgFile, @NotNull final File pngFile) throws ImporterException, IOException, ExportException {
+ public void exportSvgTest(@NotNull final File svgFile, @NotNull final File pngFile) throws ImporterException, IOException, ExportException, TransformerException, XMLStreamException, JAXBException, SAXException, TranscoderException, ParserConfigurationException {
BufferedReader reader = null;
StringBuffer buffer = new StringBuffer();
@@ -57,27 +57,44 @@ public class ExportTest {
nativeBrowser.setSvgXml(svgXml);
mindMap.setNativeBrowser(nativeBrowser);
- //Export to PNG
- OutputStream outputStream = new FileOutputStream(pngFile, false);
- try {
- mindMap.export(properties, outputStream);
- outputStream.close();
- System.out.println("finished");
- } catch (JAXBException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- } catch (TranscoderException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- } catch (TransformerException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- } catch (ParserConfigurationException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- } catch (SAXException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- } catch (XMLStreamException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ if(pngFile.exists()){
+ // Export mile content ...
+ final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ mindMap.export(properties, bos);
+
+ // Load rec file co
+ final FileInputStream fis = new FileInputStream(pngFile);
+ final InputStreamReader isr = new InputStreamReader(fis);
+ final BufferedReader br = new BufferedReader(isr);
+
+ final StringBuilder recContent = new StringBuilder();
+ String line = br.readLine();
+ while (line != null) {
+ recContent.append(line);
+ line = br.readLine();
}
+ fis.close();
+ //Since line separator chenges between \r and \n, lets read line by line
+ final String exportContent = new String(bos.toByteArray());
+ BufferedReader expBuf = new BufferedReader(new StringReader(exportContent));
+ final StringBuilder expContent = new StringBuilder();
+ String expLine = expBuf.readLine();
+ while (expLine != null) {
+ expContent.append(expLine);
+ expLine = expBuf.readLine();
+
+ }
+
+ Assert.assertEquals(expContent.toString().trim(), expContent.toString().trim());
+
+ }
+ else{
+ OutputStream outputStream = new FileOutputStream(pngFile, false);
+ mindMap.export(properties, outputStream);
+ outputStream.close();
+ }
}
//This function will provide the parameter data