When I run my test suite (which consists of 3 tests:
<test name="Adding department HR">
<call>
<stmt>{call add_dept(?)}</stmt>
<param id="1" type="CHAR">Human Resources</param>
</call>
<result>
<resultset id="1">
<row id="1">
<col id="1" type="INTEGER">${deptId_HR}</col>
</row>
</resultset>
</result>
</test>
Looking at your output some more reminded me of this same problem that I had seen before but could not reproduce after a few changes to the code. Basically, when the symboltable is dumped, it messes up the output streams. You will start to see the output intermixed as a result. If you notice your output, the test result is reported for test 2, although it says its running test 3.
I think I have a fix for this, I am redirecting the SymbolTable.dump() to write to the logging stream (STDERR) using log.debug(), so hopefully that will fix this bug. Can you download the changes from cvs and give it a try.
You will need to set your CVSROOT to :pserver:fishburn@cvs.sourceforge.net:/cvsroot/sqlunit
then do a cvs update -dAP
then run ant clean compile install
and use the new jar file for your tests.
I think I know whats the basic problem why your tests are failing too, and I will address that in that thread.
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Did you mean to use:
pserver:fishburn@cvs.sourceforge.net:/cvsroot/sqlunit
or
pserver:dfishburn@cvs.sourceforge.net:/cvsroot/sqlunit
or
pserver:anonymous@cvs.sourceforge.net:/cvsroot/sqlunit
My sourceforge is is dfishburn.
I tried using that and it did not work.
I ended up having to use anonymous.
I am a relative novice to CVS, my company uses Perforce.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
SQLUnit 3.6 (WinXP)
When I run my test suite (which consists of 3 tests:
<test name="Adding department HR">
<call>
<stmt>{call add_dept(?)}</stmt>
<param id="1" type="CHAR">Human Resources</param>
</call>
<result>
<resultset id="1">
<row id="1">
<col id="1" type="INTEGER">${deptId_HR}</col>
</row>
</resultset>
</result>
</test>
<test name="Adding error department HR again, should error">
<call>
<stmt>{call add_dept(?)}</stmt>
<param id="1" type="CHAR">Human Resources</param>
</call>
<result>
<resultset id="1">
<row id="1">
<col id="1" type="INTEGER">${deptId_HR}</col>
</row>
</resultset>
</result>
</test>
<test name="Adding department IT">
<call>
<stmt>{call add_dept(?)}</stmt>
<param id="1" type="CHAR">Information Technology</param>
</call>
<result>
<resultset id="1">
<row id="1">
<col id="1" type="INTEGER">0</col>
<col id="2" type="INTEGER">${deptId_IT}</col>
</row>
</resultset>
</result>
</test>
It always appears to skip test 2.
What would the reasons be for this?
[sqlunit] Running test[1]: Adding department HR
[sqlunit] Symbol table dump
[sqlunit] -----------------
[sqlunit] ${__JavaObjectSupport__} => null
[sqlunit] ${__FailureMessage__} => null
[sqlunit] -----------------
[sqlunit] (60ms)
[sqlunit] Undefined symbol: ${deptId_HR}
[sqlunit] Running test[3]: Adding department IT (20ms)
Here is the full output:
D:\Programs\sqlunit-3.6>ant sqlunit-flat -Dtestfile=test/ASA/test.x
ml
Buildfile: build.xml
init:
compile:
def:
sqlunit-flat:
[sqlunit] *** Running SQLUnit file: test/ASA/test.xml
[sqlunit] Getting connection(DEFAULT)
[sqlunit] Setting up test...
[sqlunit] Running test[1]: Adding department HR
[sqlunit] Symbol table dump
[sqlunit] -----------------
[sqlunit] ${__JavaObjectSupport__} => null
[sqlunit] ${__FailureMessage__} => null
[sqlunit] -----------------
[sqlunit] (60ms)
[sqlunit] Undefined symbol: ${deptId_HR}
[sqlunit] Running test[3]: Adding department IT (20ms)
[sqlunit] Got Exception instead of Result
[sqlunit] *** expected:
[sqlunit] <result>
[sqlunit] <resultset id="1">
[sqlunit] <row id="1">
[sqlunit] <col id="1" type="INTEGER">0</col>
[sqlunit] <col id="2" type="INTEGER">${deptId_IT}</col>
[sqlunit] </row>
[sqlunit] </resultset>
[sqlunit] </result>
[sqlunit] *** but got:
[sqlunit] <result>
[sqlunit] <exception>
[sqlunit] <code>2601</code>
[sqlunit] <message>ASA Error -193: Primary key for table 'department' is n
ot unique</message>
[sqlunit] </exception>
[sqlunit] </result>
Hi Dave,
This may be a result of the changes we made for the configurable reporting option. Let me get back to you tomorrow on this one.
-sujit
Hi Dave,
Looking at your output some more reminded me of this same problem that I had seen before but could not reproduce after a few changes to the code. Basically, when the symboltable is dumped, it messes up the output streams. You will start to see the output intermixed as a result. If you notice your output, the test result is reported for test 2, although it says its running test 3.
I think I have a fix for this, I am redirecting the SymbolTable.dump() to write to the logging stream (STDERR) using log.debug(), so hopefully that will fix this bug. Can you download the changes from cvs and give it a try.
You will need to set your CVSROOT to :pserver:fishburn@cvs.sourceforge.net:/cvsroot/sqlunit
then do a cvs update -dAP
then run ant clean compile install
and use the new jar file for your tests.
I think I know whats the basic problem why your tests are failing too, and I will address that in that thread.
-sujit
Did you mean to use:
pserver:fishburn@cvs.sourceforge.net:/cvsroot/sqlunit
or
pserver:dfishburn@cvs.sourceforge.net:/cvsroot/sqlunit
or
pserver:anonymous@cvs.sourceforge.net:/cvsroot/sqlunit
My sourceforge is is dfishburn.
I tried using that and it did not work.
I ended up having to use anonymous.
I am a relative novice to CVS, my company uses Perforce.
Here is the link to the FAQ which I set up sometime back, slightly more detailed than what I gave you, it should be the last one but you will need to login as well.
.
https://sourceforge.net/docman/display_doc.php?docid=21828&group_id=77832
-sujit