Add some unit testing of the CfbSchema.
[cfb.git] / test / net / jaekl / cfb / xml / MessagesXmlData.java
diff --git a/test/net/jaekl/cfb/xml/MessagesXmlData.java b/test/net/jaekl/cfb/xml/MessagesXmlData.java
new file mode 100644 (file)
index 0000000..5b81dca
--- /dev/null
@@ -0,0 +1,227 @@
+package net.jaekl.cfb.xml;
+
+public class MessagesXmlData {
+       public static final String XML = 
+                 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+               + "<MessageCollection xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+               + "xsi:noNamespaceSchemaLocation=\"messagecollection.xsd\">\n"
+               + "<BugCategory category=\"CORRECTNESS\">\n"
+               + "    <Description>Correctness</Description>\n"
+               + "    <Abbreviation>C</Abbreviation>\n"
+               + "    <Details>Probable bug - an apparent coding mistake\n"
+               + "           resulting in code that was probably not what the\n"
+               + "           developer intended. We strive for a low false positive rate.</Details>\n"
+               + "  </BugCategory>\n"
+               + "  <BugCategory category=\"NOISE\">\n"
+               + "                 <Description>Bogus random noise</Description>\n"
+               + "                 <Abbreviation>N</Abbreviation>\n"
+               + "                 <Details>Bogus random noise: intended to be useful\n"
+               + "                 as a control in data mining experiments, not in finding actual bugs in software\n"
+               + "                         </Details>\n"
+               + "               </BugCategory>\n"
+               + "               <BugCategory category=\"SECURITY\">\n"
+               + "                 <Description>Security</Description>\n"
+               + "                 <Abbreviation>S</Abbreviation>\n"
+               + "                 <Details>A use of untrusted input in a way that could create a remotely exploitable security vulnerability.\n"
+               + "                 </Details>\n"
+               + "               </BugCategory>\n"
+               + "               <BugCategory category=\"BAD_PRACTICE\">\n"
+               + "                 <Description>Bad practice</Description>\n"
+               + "                 <Abbreviation>B</Abbreviation>\n"
+               + "                 <Details>Violations of recommended and essential\n"
+               + "                         coding practice. Examples include hash code and equals\n"
+               + "                         problems, cloneable idiom, dropped exceptions,\n"
+               + "                         Serializable problems, and misuse of finalize.\n"
+               + "                         We strive to make this analysis accurate,\n"
+               + "                         although some groups may\n"
+               + "                         not care about some of the bad practices.</Details>\n"
+               + "               </BugCategory>\n"
+               + "               <BugCategory category=\"STYLE\">\n"
+               + "                 <Description>Dodgy code</Description>\n"
+               + "                 <Abbreviation>D</Abbreviation>\n"
+               + "                 <Details>code that is confusing, anomalous, or\n"
+               + "                         written in a way that leads itself to errors.\n"
+               + "                         Examples include dead local stores, switch fall through,\n"
+               + "                         unconfirmed casts, and redundant null check of value\n"
+               + "                         known to be null.\n"
+               + "                         More false positives accepted.\n"
+               + "                         In previous versions of FindBugs, this category was known as Style.\n"
+               + "             </Details>\n"
+               + "               </BugCategory>\n"
+               + "               <BugCategory category=\"PERFORMANCE\">\n"
+               + "                 <Description>Performance</Description>\n"
+               + "                 <Abbreviation>P</Abbreviation>\n"
+               + "                 <Details>code that is not necessarily incorrect but may be inefficient</Details>\n"
+               + "               </BugCategory>\n"
+               + "               <BugCategory category=\"MALICIOUS_CODE\">\n"
+               + "                 <Description>Malicious code vulnerability</Description>\n"
+               + "                 <Abbreviation>V</Abbreviation>\n"
+               + "                 <Details>code that is vulnerable to attacks from untrusted code</Details>\n"
+               + "               </BugCategory>\n"
+               + "               <BugCategory category=\"MT_CORRECTNESS\">\n"
+               + "                 <Description>Multithreaded correctness</Description>\n"
+               + "                 <Abbreviation>M</Abbreviation>\n"
+               + "                 <Details>code flaws having to do with threads, locks, and volatiles</Details>\n"
+               + "               </BugCategory>\n"
+               + "               <BugCategory category=\"I18N\">\n"
+               + "                 <Description>Internationalization</Description>\n"
+               + "                 <Abbreviation>I</Abbreviation>\n"
+               + "                 <Details>code flaws having to do with internationalization and locale</Details>\n"
+               + "                 <!-- DM_CONVERT_CASE is the only core bug pattern in this category -->\n"
+               + "               </BugCategory>\n"
+               + "               <BugCategory category=\"EXPERIMENTAL\">\n"
+               + "                 <Description>Experimental</Description>\n"
+               + "                 <Abbreviation>X</Abbreviation>\n"
+               + "                 <Details>Experimental and not fully vetted bug patterns</Details>\n"
+               + "                 <!-- DM_CONVERT_CASE is the only core bug pattern in this category -->\n"
+               + "               </BugCategory>\n"
+               + "               <!--\n"
+               + "               **********************************************************************\n"
+               + "               BugPatterns\n"
+               + "               **********************************************************************\n"
+               + "                -->\n"
+               + "               <BugPattern type=\"CNT_ROUGH_CONSTANT_VALUE\">\n"
+               + "                 <ShortDescription>Rough value of known constant found</ShortDescription>\n"
+               + "                 <LongDescription>Rough value of {3} found: {2}</LongDescription>\n"
+               + "                 <Details>\n"
+               + "                   <![CDATA[\n"
+               + "                 <p>It's recommended to use the predefined library constant for code clarity and better precision.</p>\n"
+               + "             ]]>\n"
+               + "                 </Details>\n"
+               + "               </BugPattern>\n"
+               + "               <BugPattern type=\"SKIPPED_CLASS_TOO_BIG\">\n"
+               + "                 <ShortDescription>Class too big for analysis</ShortDescription>\n"
+               + "                 <LongDescription>{0} is too big for analysis</LongDescription>\n"
+               + "                 <Details>\n"
+               + "                   <![CDATA[\n"
+               + "                 <p>This class is bigger than can be effectively handled, and was not fully analyzed for errors.\n"
+               + "             </p>\n"
+               + "\n"
+               + "             ]]>\n"
+               + "                 </Details>\n"
+               + "               </BugPattern>\n"
+               + "               <BugPattern type=\"NOISE_NULL_DEREFERENCE\">\n"
+               + "                 <ShortDescription>Bogus warning about a null pointer dereference</ShortDescription>\n"
+               + "                 <LongDescription>Bogus warning about a null pointer dereference in {1}</LongDescription>\n"
+               + "                 <Details>\n"
+               + "                   <![CDATA[\n"
+               + "                 <p>Bogus warning.</p>\n"
+               + "             ]]>\n"
+               + "                 </Details>\n"
+               + "               </BugPattern>\n"
+               + "               <BugPattern type=\"NOISE_METHOD_CALL\">\n"
+               + "                 <ShortDescription>Bogus warning about a method call</ShortDescription>\n"
+               + "                 <LongDescription>Bogus warning about a method call {2} in {1}</LongDescription>\n"
+               + "                 <Details>\n"
+               + "                   <![CDATA[\n"
+               + "                 <p>Bogus warning.</p>\n"
+               + "             ]]>\n"
+               + "                 </Details>\n"
+               + "               </BugPattern>\n"
+               + "               <BugPattern type=\"NOISE_FIELD_REFERENCE\">\n"
+               + "                 <ShortDescription>Bogus warning about a field reference</ShortDescription>\n"
+               + "                 <LongDescription>Bogus warning about a reference to {2} in {1}</LongDescription>\n"
+               + "                 <Details>\n"
+               + "                   <![CDATA[\n"
+               + "                 <p>Bogus warning.</p>\n"
+               + "             ]]>\n"
+               + "                 </Details>\n"
+               + "               </BugPattern>\n"
+               + "               <BugPattern type=\"NOISE_OPERATION\">\n"
+               + "                 <ShortDescription>Bogus warning about an operation</ShortDescription>\n"
+               + "                 <LongDescription>Bogus warning about an operation {1}</LongDescription>\n"
+               + "                 <Details>\n"
+               + "                   <![CDATA[\n"
+               + "                 <p>Bogus warning.</p>\n"
+               + "             ]]>\n"
+               + "                 </Details>\n"
+               + "               </BugPattern>\n"
+               + "                 <BugPattern type=\"DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE\">\n"
+               + "                     <ShortDescription>BigDecimal constructed from double that isn't represented precisely</ShortDescription>\n"
+               + "                     <LongDescription>BigDecimal constructed from {4} in {1}</LongDescription>\n"
+               + "                     <Details>\n"
+               + "                   <![CDATA[\n"
+               + "                 <p>\n"
+               + "             This code creates a BigDecimal from a double value that doesn't translate well to a\n"
+               + "             decimal number.\n"
+               + "             For example, one might assume that writing new BigDecimal(0.1) in Java creates a BigDecimal which is exactly equal to 0.1 (an unscaled value of 1, with a scale of 1), but it is actually equal to 0.1000000000000000055511151231257827021181583404541015625.\n"
+               + "             You probably want to use the BigDecimal.valueOf(double d) method, which uses the String representation\n"
+               + "             of the double to create the BigDecimal (e.g., BigDecimal.valueOf(0.1) gives 0.1).\n"
+               + "             </p>\n"
+               + "\n"
+               + "             ]]>\n"
+               + "                 </Details>\n"
+               + "                 </BugPattern>\n"
+               + "\n"
+               + "                 <BugPattern type=\"DMI_DOH\">\n"
+               + "                     <ShortDescription>D'oh! A nonsensical method invocation</ShortDescription>\n"
+               + "                     <LongDescription>D'oh! A nonsensical invocation of {2.nameAndSignature} in {1}</LongDescription>\n"
+               + "                     <Details>\n"
+               + "                   <![CDATA[\n"
+               + "                 <p>\n"
+               + "             This partical method invocation doesn't make sense, for reasons that should be apparent from inspection.\n"
+               + "             </p>\n"
+               + "\n"
+               + "             ]]>\n"
+               + "                 </Details>\n"
+               + "                 </BugPattern>\n"
+               + "\n"
+               + "               <BugPattern type=\"DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD\">"
+               + "                 <ShortDescription>Useless/vacuous call to EasyMock method</ShortDescription>"
+               + "                 <LongDescription>Useless/vacuous call to {2} in {1}</LongDescription>"
+               + "                 <Details>"
+               + "                   <![CDATA["
+               + "                 <p>This call doesn't pass any objects to the EasyMock method, so the call doesn't do anything."
+               + "             </p>"
+               + ""
+               + "             ]]>"
+               + "                 </Details>"
+               + "               </BugPattern>"
+               + "               <BugPattern type=\"DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO_CORE_THREADS\">"
+               + "                 <ShortDescription>Creation of ScheduledThreadPoolExecutor with zero core threads</ShortDescription>"
+               + "                 <LongDescription>Creation of ScheduledThreadPoolExecutor with zero core threads in {1}</LongDescription>"
+               + "                 <Details>"
+               + "                   <![CDATA["
+               + "                 <p>(<a href=\"http://java.sun.com/javase/6/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html#ScheduledThreadPoolExecutor(int)\">Javadoc</a>)"
+               + "             A ScheduledThreadPoolExecutor with zero core threads will never execute anything; changes to the max pool size are ignored."
+               + "             </p>"
+               + ""
+               + "             ]]>"
+               + "                 </Details>"
+               + "               </BugPattern>"
+               + "               <BugPattern type=\"DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF_SCHEDULED_THREAD_POOL_EXECUTOR\">"
+               + "                 <ShortDescription>Futile attempt to change max pool size of ScheduledThreadPoolExecutor</ShortDescription>"
+               + "                 <LongDescription>Futile attempt to change max pool size of ScheduledThreadPoolExecutor in {1}</LongDescription>"
+               + "                 <Details>"
+               + "                   <![CDATA["
+               + "                 <p>(<a href=\"http://java.sun.com/javase/6/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html\">Javadoc</a>)"
+               + "             While ScheduledThreadPoolExecutor inherits from ThreadPoolExecutor, a few of the inherited tuning methods are not useful for it. In particular, because it acts as a fixed-sized pool using corePoolSize threads and an unbounded queue, adjustments to maximumPoolSize have no useful effect."
+               + "                 </p>"
+               + ""
+               + "             ]]>"
+               + "                 </Details>"
+               + "               </BugPattern>"
+               + "               <BugPattern type=\"DMI_UNSUPPORTED_METHOD\">"
+               + "                 <ShortDescription>Call to unsupported method</ShortDescription>"
+               + "                 <LongDescription>Call to unsupported method {2} in {1}</LongDescription>"
+               + "                 <Details>"
+               + "                   <![CDATA["
+               + "                 <p>All targets of this method invocation throw an UnsupportedOperationException."
+               + "             </p>"
+               + ""
+               + "             ]]>"
+               + "                 </Details>"
+               + "               </BugPattern>"
+               + "               <BugPattern type=\"DMI_EMPTY_DB_PASSWORD\">"
+               + "                 <ShortDescription>Empty database password</ShortDescription>"
+               + "                 <LongDescription>Empty database password in {1}</LongDescription>"
+               + "                 <Details>"
+               + "                   <![CDATA["
+               + "                 <p>This code creates a database connect using a blank or empty password. This indicates that the database is not protected by a password."
+               + "             </p>"
+               + ""
+               + "             ]]>"
+               + "                 </Details>"
+               + "               </BugPattern>"
+               + "</MessageCollection>";
+}