Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-5726

UIMA-DUCC: JD TestSuite fails in checkCas()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.2.2-Ducc
    • DUCC
    • None

    Description

      After upgrading ducc to use uima 2.10.2, the ducc build fails while running JD junit tests. The reported error is:

      test_16(org.apache.uima.ducc.container.jd.test.Test1) Time elapsed: 0.326 sec <<< FAILURE!
      java.lang.AssertionError: cas = '<?xml version="1.0" encoding="UTF-8"?><xmi:XMI xmlns:xmi="http://www.omg.org/XMI" xmlns:examples="http:///org/apache/uima/examples.ecore" xmlns:tcas="http:///uima/tcas.ecore" xmlns:cas="http:///uima/cas.ecore" xmi:version="2.0"><cas:NULL xmi:id="0"/><tcas:DocumentAnnotation xmi:id="8" sofa="1" begin="0" end="1" language="x-unspecified"/><cas:Sofa xmi:id="1" sofaNum="1" sofaID="_InitialView" mimeType="text" sofaString="1"/><cas:View sofa="1" members="8"/></xmi:XMI>'
      at org.junit.Assert.fail(Assert.java:91)
      at org.apache.uima.ducc.container.jd.test.TestSuite.checkCas(TestSuite.java:43)
      at org.apache.uima.ducc.container.jd.test.TestSuite.getMetaCases(TestSuite.java:161)
      at org.apache.uima.ducc.container.jd.test.TestSuite.getMetaCases(TestSuite.java:174)
      at org.apache.uima.ducc.container.jd.test.Test1.test_16(Test1.java:71)

       

      The TestSuite.checkCas() expects either of these 3 xml preambles:

        String prefix2 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><xmi:XMI xmlns:examples=\"http:///org/apache/uima/examples.ecore\"";
      String prefix1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><xmi:XMI xmlns:tcas=\"http:///uima/tcas.ecore\"";
      String prefix0 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><xmi:XMI xmlns:cas=\"http:///uima/cas.ecore\"";

       

      It looks like CAS serialization produces a different preamble:

      <?xml version="1.0" encoding="UTF-8"?><xmi:XMI xmlns:xmi="http://www.omg.org/XMI" xmlns:examples="http:///org/apache/uima/examples.ecore" xmlns:tcas="http:///uima/tcas.ecore" xmlns:cas="http:///uima/cas.ecore" xmi:version="2.0">

      Not sure about the cause of this. Perhaps the new uima (2.10.2) is serializing differently now. I was able to fix the problem by adding a new prefix (prefix3) to make sure the new xml preamble matches. Perhaps I am fixing the wrong thing here. Why there is this preamble different from before is the question. Looks like code doing the CAS serialization is producing a different xml. 

      Attachments

        Activity

          People

            cwiklik Jaroslaw Cwiklik
            cwiklik Jaroslaw Cwiklik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: