--- /dev/null
+package net.jaekl.cfb;
+
+public class CfbException extends Exception {
+ private static final long serialVersionUID = 1L;
+
+ public CfbException(String msg) {
+ super(msg);
+ }
+}
--- /dev/null
+package net.jaekl.cfb.store;
+
+import net.jaekl.cfb.CfbException;
+
+public class StoreException extends CfbException {
+ private static final long serialVersionUID = 1L;
+
+ public StoreException(String msg) {
+ super(msg);
+ }
+}
--- /dev/null
+package net.jaekl.cfb.xml.messages;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class BugCategoryTest {
+
+ @Test
+ public void testGetUninitializedVariables() {
+ BugCategory cat = new BugCategory();
+
+ assertEquals(-1, cat.getId());
+ assertEquals("", cat.getAbbrev());
+ assertEquals("", cat.getCategory());
+ assertEquals("", cat.getDescr());
+ assertEquals("", cat.getDetails());
+ }
+
+}
--- /dev/null
+package net.jaekl.cfb.xml.messages;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class BugPatternTest {
+
+ @Test
+ public void testGetUninitializedVariables() {
+ BugPattern pat = new BugPattern();
+
+ assertEquals((-1), pat.getId());
+ assertEquals("", pat.getDetails());
+ assertEquals("", pat.getLong());
+ assertEquals("", pat.getShort());
+ }
+
+ @Test
+ public void testGetUnknown() {
+ BugPattern pat = BugPattern.UNKNOWN;
+
+ assertEquals((-2), pat.getId());
+ assertEquals("", pat.getDetails());
+ assertEquals("", pat.getLong());
+ assertEquals("", pat.getShort());
+ }
+}
--- /dev/null
+package net.jaekl.cfb.xml.messages;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.ByteArrayInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+
+import net.jaekl.cfb.analyze.MessageMap;
+import net.jaekl.cfb.xml.MessagesXmlData;
+
+import org.junit.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+public class MessageCollectionTest {
+ private final String UNDEFINED_TYPE = "ThisTypeDoesNotExist";
+
+ @Test
+ public void testGetPatternForUnknownType() throws FileNotFoundException, UnsupportedEncodingException, IOException, SAXException {
+ MessageMap msgMap = new MessageMap();
+ msgMap.parse(new InputSource(new ByteArrayInputStream(MessagesXmlData.XML.getBytes("UTF-8"))));
+
+ MessageCollection msgColl = msgMap.getColl();
+ assertNotNull(msgColl);
+
+ BugPattern pat = msgColl.getPattern(UNDEFINED_TYPE);
+ assertNotNull(pat);
+ assertEquals(BugPattern.UNKNOWN.getId(), pat.getId());
+ }
+}