Menu

wrong echo

l_yara
2006-08-24
2013-04-25
  • l_yara

    l_yara - 2006-08-24

    Hi Sujit and all,

    It looks that I have wrong set of libs or so. Any attempt to make echo using <result echo="true"> tag leads to the string
    ...
      [sqlunit] sqlunit-ant: org.jdom.Element.addContent(Lorg/jdom/Element;)Lorg/jdom/Element;
    ...
    in console. The same string is printed as a result of any test failure.

    It seems that something goes wrong with either logging or XML processing inside sqlunit.
    SQLUnit Version 5.0 and all the included libs is used.

    what's wrong? Any help is much appreciated.
    Thanks in advance

     
    • Sujit Pal

      Sujit Pal - 2006-08-24

      We did upgrade from JDOM-b8 to JDOM 1.0 and the error message looks suspiciously like an error from JDOM. Will take a look and get back on this thread. Thanks for the test case, that should make figuring this out easier.

      -sujit

       
    • l_yara

      l_yara - 2006-08-25

      This problem doesn't exists with version 4.9

       
    • Sujit Pal

      Sujit Pal - 2006-09-06

      I just tried the following test case with the existing code this morning (Sorry, I recently changed jobs, so dont have much time).

      <test name="Test of result.echo attribute">
      .<call>
      ..<stmt>aSimpleResult</stmt>
      .</call>
      .<result echo="true" />
      </test>

      and I was able to run it without problems. Here is a cut and paste of the trace.

      [sujit@cyclone sqlunit]$ ant sqlunit-flat -Dtestfile=test/mock/testecho.xml
      sqlunit-flat:
        [sqlunit] *** Running SQLUnit file: test/mock/testecho.xml
        [sqlunit] Getting connection(DEFAULT)
        [sqlunit] Setting up test...
        [sqlunit] Running test[1]: Test of result.echo attribute
        [sqlunit] echo: (<result>
        [sqlunit]   <resultset id="1">
        [sqlunit]     <row id="1">
        [sqlunit]       <col id="1" name="col1" type="INTEGER">1</col>
        [sqlunit]     </row>
        [sqlunit]   </resultset>
        [sqlunit] </result>) (0ms)
        [sqlunit] Tearing down test...

      Can you provide a test case for which you are seeing the problem?

      -sujit

       
    • l_yara

      l_yara - 2006-09-20

      Sorry for long silence.

      The problem emerge only with the version 4.9 set of libraries. I
      believe that the list of testAll.xml file would help in understanding:

      ------ testAll.xml - central ANT project file -------------
      <project name="Hello World" default="run-all-tests" basedir=".">
              <target name="run-all-tests" depends="def">
                      <sqlunit haltOnFailure="false" debug="false">
                              <fileset dir="packages">
                                      <include name="**/*.xml" />
                              </fileset>
                      </sqlunit>
              </target>
              <target name="def">
                      <taskdef name="sqlunit"
                              classname="net.sourceforge.sqlunit.ant.SqlunitTask">
                              <classpath>
                                      <pathelement
                                              location="C:/oracle/product/10.2.0/db_1/jdbc/lib/ojdbc14.jar" />
                                      <pathelement
                                              location="." />
                                      <fileset dir="C:/Java/SQLUnit/lib">
                                              <include name="*.jar" />
                                      </fileset>
                              </classpath>
                      </taskdef>
              </target>
      </project>
      ---------------------------

      When the C:/Java/SQLUnit/lib directory mentioned in the
      ....
      <fileset dir="C:/Java/SQLUnit/lib">
        <include name="*.jar" />
      </fileset>
      ....
      contains the set of jars included in version 4.9 (13 jars 3,022,577
      bytes total) everything is OK, but when this directory contains the
      version 5.0 set (17 jars for 4,727,817 bytes total volume) the string

        [sqlunit] sqlunit-ant: org.jdom.Element.addContent(Lorg/jdom/Element;)Lorg/jdom/Element;

      emerges in the output instead of any echo.

      The classpath for Ant itself includes the standard Ant 1.6.5 set (30
      jars, 3,068,331 bytes total). I expect the problem is in the wrong
      mixing the jars - the probles looks the same both when SQLUnit is
      runned from Eclipse and from command line.

      Thanks in advance,
      Yaroslav

       
    • Sujit Pal

      Sujit Pal - 2006-10-15

      The problem is with the newer version of JDOM described here:
      http://www.jdom.org/pipermail/jdom-interest/2004-March/013627.html

      Its hard for me to find out where it is getting the CCE because I cannot reproduce it locally, but if you are able to run the code in debug mode with a single test that is giving you this error (to keep the log volume down and readable) and send me the output, it may help me in narrowing it down.

      -sujit

       
    • Jeff Mills

      Jeff Mills - 2007-06-04

      I experienced this problem, too.  I resolved it by simply rebuilding the sqlunit-5.0.jar file using the "ant install" command.  I built 2 versions, one using jdk1.5.0_12 and another using jdk1.4.2_09.  Both of them worked OK (I got the expected error output instead of the weird JDOM message) running with jdk1.5.0_12.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.