Change icons path location.

This commit is contained in:
Paulo Veiga 2012-01-31 00:14:49 -03:00
parent 68fdf41bb7
commit ba24e02d85
3 changed files with 11 additions and 6 deletions

View File

@ -34,6 +34,12 @@
<version>3.0-SNAPSHOT</version> <version>3.0-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.wisemapping</groupId>
<artifactId>wise-editor</artifactId>
<version>3.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>org.wisemapping</groupId> <groupId>org.wisemapping</groupId>
<artifactId>mindplot</artifactId> <artifactId>mindplot</artifactId>

View File

@ -32,7 +32,7 @@ public class ExportTest {
reader = new BufferedReader(new FileReader(svgFile)); reader = new BufferedReader(new FileReader(svgFile));
String text; String text;
while((text=reader.readLine()) != null){ while ((text = reader.readLine()) != null) {
buffer.append(text).append(System.getProperty("line.separator")); buffer.append(text).append(System.getProperty("line.separator"));
} }
@ -42,11 +42,11 @@ public class ExportTest {
final ExportProperties properties = ExportProperties.create(format); final ExportProperties properties = ExportProperties.create(format);
final ExportProperties.ImageProperties imageProperties = (ExportProperties.ImageProperties) properties; final ExportProperties.ImageProperties imageProperties = (ExportProperties.ImageProperties) properties;
imageProperties.setSize(ExportProperties.ImageProperties.Size.LARGE); imageProperties.setSize(ExportProperties.ImageProperties.Size.LARGE);
String baseUrl = "file://"+svgFile.getParentFile().getAbsolutePath()+"/../../../main/webapp/icons"; String baseUrl = "file://" + svgFile.getParentFile().getAbsolutePath() + "/../../../../../wise-editor/src/main/webapp/icons";
properties.setBaseImagePath(baseUrl); properties.setBaseImagePath(baseUrl);
// Write content ... // Write content ...
if(pngFile.exists()){ if (pngFile.exists()) {
// Export mile content ... // Export mile content ...
final ByteArrayOutputStream bos = new ByteArrayOutputStream(); final ByteArrayOutputStream bos = new ByteArrayOutputStream();
ExporterFactory.export(imageProperties, null, bos, svgXml); ExporterFactory.export(imageProperties, null, bos, svgXml);
@ -78,8 +78,7 @@ public class ExportTest {
Assert.assertEquals(expContent.toString().trim(), expContent.toString().trim()); Assert.assertEquals(expContent.toString().trim(), expContent.toString().trim());
} } else {
else{
OutputStream outputStream = new FileOutputStream(pngFile, false); OutputStream outputStream = new FileOutputStream(pngFile, false);
ExporterFactory.export(imageProperties, null, outputStream, svgXml); ExporterFactory.export(imageProperties, null, outputStream, svgXml);
outputStream.close(); outputStream.close();

View File

@ -29,7 +29,7 @@ public class IconsTest {
final List<MindmapIcon> iconByFamily = MindmapIcons.getIconByFamily(family); final List<MindmapIcon> iconByFamily = MindmapIcons.getIconByFamily(family);
for (MindmapIcon mindmapIcon : iconByFamily) { for (MindmapIcon mindmapIcon : iconByFamily) {
final String pngName = mindmapIcon.getId() + ".png"; final String pngName = mindmapIcon.getId() + ".png";
final File file = new File("src/main/webapp/icons/", pngName); final File file = new File("../wise-editor/src/main/webapp/icons/", pngName);
Assert.assertTrue(file.exists(), "Could not be found:" + file.getAbsolutePath()); Assert.assertTrue(file.exists(), "Could not be found:" + file.getAbsolutePath());
} }