For Programmers: Free Programming Magazines  


Home > Archive > Software Testing > September 2005 > DBUnit testing









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author DBUnit testing
DimaMay@gmail.com

2005-09-19, 7:02 pm

Here is the deal,

My Group table has a parentGroupID attribute which is also a foreign
key constraint to GroupID (primary key of the Group table). When I try
to delete the entries inside the group table with DBUnit, such as:

DatabaseOperation.DELETE_ALL.execute(connection, dataSet);

I get Referential Integrity Violation (see full printout below). Is
there a way to enable cascade delete in DBUnit? I am open to other
solutions too.

Please let me know if you have any idea.

Thanks,

Dima


[java] 1)
estCreateFolders(com.att.projectX.httpunit.FilesTest)java.sql.SQLException:
Referential Integrity Violation. GROUP references
GROUP
[java] at
weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
[java] at
weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:137)
[java] at
weblogic.jdbc.rmi.internal. StatementImpl_weblogic_jdbc_wrapper_Stat
ement_com_pointbase_net_netJDBCStatement
_813_WLStub.execute(Unknown
Source
)
[java] at
weblogic.jdbc.rmi.internal. StatementStub_weblogic_jdbc_rmi_internal
_StatementImpl_weblogic_jdbc_wrapper_Sta
tement_com_pointbase_net_netJDBCSt
atement_813_WLStub.execute(Unknown Source)
[java] at
weblogic.jdbc.rmi. SerialStatement_weblogic_jdbc_rmi_intern
al_StatementStub_weblogic_jdbc_rmi_inter
nal_StatementImpl_weblogic_jdbc_wrapper_
Sta
tement_com_pointbase_net_netJDBCStatemen
t_813_WLStub.execute(Unknown
Source)
[java] at
org.dbunit.database.statement.SimpleStatement.executeBatch(SimpleStatement.java:54)
[java] at
org.dbunit.operation.DeleteAllOperation.execute(DeleteAllOperation.java:112)
[java] at
com.att.projectX.httpunit.UnitTest.setUp(UnitTest.java:107)
[java] at
com.att.projectX.httpunit.HttpUnitSuite.main(HttpUnitSuite.java:16)
[java] Caused by: java.sql.SQLException: Referential Integrity
Violation. PROJECTX.GROUP references PROJECTX.GROUP
[java] at
com.pointbase.net.netJDBCPrimitives.handleResponse(Unknown Source)
[java] at
com.pointbase.net.netJDBCPrimitives.handlePrimitiveResponse(Unknown
Source)
[java] at com.pointbase.net.netJDBCStatement.execute(Unknown
Source)
[java] at
weblogic.jdbc.wrapper.Statement.execute(Statement.java:332)
[java] at
weblogic.jdbc.rmi.internal. StatementImpl_weblogic_jdbc_wrapper_Stat
ement_com_pointbase_net_netJDBCStatement
.execute(Unknown
Source)
[java] at
weblogic.jdbc.rmi.internal. StatementImpl_weblogic_jdbc_wrapper_Stat
ement_com_pointbase_net_netJDBCStatement
_WLSkel.invoke(Unknown
Source)
[java] at
weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
[java] at
weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
[java] at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
[java] at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
[java] at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
[java] at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
[java] at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
[java] at
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com