Menu

include tag problem inside teardown

Sowmya S
2003-10-09
2003-10-21
  • Sowmya S

    Sowmya S - 2003-10-09

    This is my RemoveData.sql file

    delete from BillReqTbl1 where ReqId not in(select ReqId from RuqTbl)
    ;
    delete from BillReqTbl2 where ReqId not in(select ReqId from RuqTbl)
    ;

    =====

    When I include this in the teardown it throwing an error

    <teardown>
      <include file="/UserTestCases/RemoveData.sql" />
    </teardown>

    Error message is
    [sqlunit] com.sybase.jdbc.SybStatement.executeBatch()[I
      [sqlunit] One or more SQLUnit Tests failed, see the console for details

    Can someone just tell me what may be the problem

    Thanks
    sowmya

     
    • Sujit Pal

      Sujit Pal - 2003-10-10

      Looks like the Statement batching does not work too well for arbitary queries with Sybase, although one of the guys at work did use batching to improve performance. In any case, I replaced this with code to build a list of queries from the include file, then run them all in sequence in a single transaction, so a failure will roll back the entire batch. This should work now with changes I put into CVS. There are changes in the following files:
      M src/net/sourceforge/sqlunit/IErrorCodes.java
      M src/net/sourceforge/sqlunit/IncludeHandler.java
      M src/net/sourceforge/sqlunit/TeardownHandler.java
      A test/sybase/teardown.sql
      M test/sybase/test.xml

      I think I will make a release pretty soon, so if you want you can wait for a full release, but meanwhile the code is in cvs.

      -sujit

       
    • Sowmya S

      Sowmya S - 2003-10-13

      Now it's not throwing any error.But only the 1st statement gets executed.
      For eg. If there are 2 delete statements are there then only 1st delete statement hget executed.But both delete statement is proper.
      Please just check this and provide a solution.

       
    • Sujit Pal

      Sujit Pal - 2003-10-14

      My apologies, its fixed now in CVS. The only change is in the IncludeHandler.java code. I am trying to fold in some Oracle stuff for the next release, will probably release end of this week, so if you need this sooner, please get the CVS version.

      Thanks for catching this.
      -sujit

       
    • Sowmya S

      Sowmya S - 2003-10-14

      I downloaded IncludeHandler.java and checked but still it's not working

      Thanks
      -sowmya

       
    • Sujit Pal

      Sujit Pal - 2003-10-14

      Can you provide more details? Is it still the first SQL statement that gets executed? Does it throw any errors? At the risk of asking a real stupid question, did you recompile the code with ant install and move the sqlunit*.jar file to your classpath (ie where the old one was)? I am sure you must have done it, just trying to make sure.

      Thanks
      Sujit

       
    • Sowmya S

      Sowmya S - 2003-10-20

      No. It's not throwing any error.
      Only 1st SQL statement is getting executed.I have put SQLUnit*.jar file to my classpath.

      Thanks
      Sowmya

       
    • Sowmya S

      Sowmya S - 2003-10-20

      Just now I downloaded 2.4V in that teardown is working fine.
      Thanks a lot
      sowmya

       
    • Sujit Pal

      Sujit Pal - 2003-10-21

      Good. Glad it worked :-).

      -sujit

       

Log in to post a comment.