Commits

dloy committed df2a9a6

Cleanup entities + add identifiers from DC

  • Participants
  • Parent commits 1e3682c

Comments (0)

Files changed (2)

core/src/test/java/org/cdlib/mrt/utility/StringUtilTest.java

         }
 
     }
+
+    @Test
+    public void normParm()
+    {
+        String tParm = null;
+        try {
+            tParm = StringUtil.normParm("");
+            assertTrue(tParm == null);
+            tParm = StringUtil.normParm("    ");
+            assertTrue(tParm == null);
+            tParm = StringUtil.normParm(null);
+            assertTrue(tParm == null);
+            tParm = StringUtil.normParm(" abc ");
+            assertTrue(tParm.equals("abc"));
+            tParm = StringUtil.normParm(" zyx");
+            assertTrue(tParm.equals("zyx"));
+            tParm = StringUtil.normParm("zyx ");
+            assertTrue(tParm.equals("zyx"));
+
+        } catch (Exception ex) {
+            System.out.println(MESSAGE + "Exception:" + ex);
+            assertFalse(MESSAGE
+                    + " - Exception:" + ex
+                    + " - stack:" + StringUtil.stackTrace(ex)
+                    , true);
+        }
+
+    }
 }

core/src/test/java/org/cdlib/mrt/utility/XMLUtilTest.java

     protected String result3 = "-test.don't-test";
     protected String test4 = "-test.\"nut\"-test";
     protected String result4 = "-test."nut"-test";
+
+    protected String test5 ="-test.<init>-test";
+    protected String result5 = "-test.&#60;init&#62;-test";
+    protected String test6 = "-test.&lt;init&gt;-test";
+    protected String result6 = "-test.&#38;lt;init&#38;gt;-test";
+    protected String test7 = "-test.don't-test";
+    protected String result7 = "-test.don&#39;t-test";
+    protected String test8 = "-test.\"nut\"-test";
+    protected String result8 = "-test.&#34;nut&#34;-test";
     public XMLUtilTest() {
     }
 
             //testDecode(result2, test2);
             testDecode(result3, test3);
             testDecode(result4, test4);
+            
+            testDecode(result5, test5);
+            testDecode(result6, test6);
+            testDecode(result7, test7);
+            testDecode(result8, test8);
         } catch (Exception ex) {
             assertFalse("Exception:" + ex, true);
         }
             System.out.println("in*=" + in);
             String out = XMLUtil.encodeValue(in);
             System.out.println("out=" + out);
-            assertTrue(out.equals(match));
+            assertTrue("FAIL: out=" + out + " - match=" + match, out.equals(match));
             
         } catch (Exception ex) {
             assertFalse("Exception:" + ex, true);