Fix tests.

This commit is contained in:
Paulo Gustavo Veiga
2011-07-03 12:13:31 -03:00
parent 9517f06902
commit 5ace7f5259
14 changed files with 23 additions and 26 deletions

View File

@@ -73,7 +73,7 @@ public class FreemindExporter
final List<TopicType> topics = mindmapMap.getTopic();
// Insolated Topic doesn´t exists in Freemind only take the center topic
// Isolated Topic does not exist in Freemind only take the center topic
TopicType centerTopic = null;
if (topics.size() > 1) {
for (TopicType topic : topics) {

View File

@@ -24,16 +24,13 @@ import com.wisemapping.model.IconFamily;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
import java.util.*;
final public class FreemindIconConverter {
private final static Map<String, MindmapIcon> freeIdToIcon = new HashMap<String, MindmapIcon>();
private final static Map<MindmapIcon, String> iconToFreeId = new HashMap<MindmapIcon, String>();
private final static Map<String, MindmapIcon> freeIdToIcon = new TreeMap<String, MindmapIcon>();
private final static Map<MindmapIcon, String> iconToFreeId = new TreeMap<MindmapIcon, String>();
private FreemindIconConverter() {
}

View File

@@ -94,7 +94,7 @@ public class FreemindImporter
}
public MindMap importMap(String mapName, String description, InputStream input) throws ImporterException {
public MindMap importMap(@NotNull String mapName, @NotNull String description, @NotNull InputStream input) throws ImporterException {
final MindMap result = new MindMap();
nodesMap = new HashMap<String, TopicType>();

View File

@@ -29,6 +29,7 @@ package com.wisemapping.model;
import com.wisemapping.util.ZipUtils;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.util.Calendar;
@@ -189,7 +190,7 @@ public class MindMap {
return xml;
}
public void setNativeXml(String nativeXml)
public void setNativeXml(@NotNull String nativeXml)
throws IOException {
this.xml = ZipUtils.stringToZip(nativeXml);
}

View File

@@ -18,7 +18,7 @@
package com.wisemapping.model;
public class MindmapIcon {
public class MindmapIcon implements Comparable{
private String name;
private IconFamily family;
@@ -38,4 +38,8 @@ public class MindmapIcon {
public String getId() {
return family.name().toLowerCase() + "_" + name;
}
public int compareTo(Object o) {
return ((MindmapIcon)o).getId().compareTo(this.getId());
}
}

View File

@@ -203,7 +203,7 @@ public class MindmapIcons {
private static void load() {
try {
if (iconsByFamily == null) {
iconsByFamily = new HashMap<IconFamily, List<MindmapIcon>>();
iconsByFamily = new TreeMap<IconFamily, List<MindmapIcon>>();
Field[] fields = MindmapIcons.class.getDeclaredFields();
for (Field field : fields) {

View File

@@ -54,9 +54,9 @@ public class JAXBUtils {
}
public static void saveMap(@NotNull Object obj, @NotNull OutputStream out, String pachage) throws JAXBException {
public static void saveMap(@NotNull Object obj, @NotNull OutputStream out, String packag) throws JAXBException {
final JAXBContext context = getInstance(pachage);
final JAXBContext context = getInstance(packag);
final Marshaller marshaller = context.createMarshaller();
marshaller.marshal(obj, out);

View File

@@ -40,7 +40,7 @@ public class ZipUtils {
byte[] buffer = new byte[512];
int len;
StringBuffer sb_result = new StringBuffer();
StringBuilder sb_result = new StringBuilder();
while ((len = zipIn.read(buffer)) > 0) {