db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1467170 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java
Date Fri, 12 Apr 2013 06:06:38 GMT
Author: mamta
Date: Fri Apr 12 06:06:38 2013
New Revision: 1467170

URL: http://svn.apache.org/r1467170
Log:
DERBY-5866 (testFiringConstraintOrder(org.apache.derbyTesting.functionTests.tests.lang.TriggerTest)junit.framework.AssertionFailedError:
matching triggers need to be fired in order creation:1,NO CASCADE BEFORE,DELETE,ROW)

In case of failure, this test only has information about the failing trigger. It will be good
to also have a complete list of triggers in the order that they got fired. This will help
figure out the intermittent test failure,

Some background information on the test
The failing test creates table T with primary key, unique key, check constraint. It creates
another table TCHILD which has a foreign key reference to table T. Next, the test creates
a random number of triggers on T. Triggers are one of the 12 types with various combinations
of BEFORE/AFTER, INSERT/UPDATE/DELETE, ROW/STATEMENT. The trigger definition has a string
associated with it which has a unique number and description of the type of trigger eg it
might be '0,NO CASCADE BEFORE, DELETE, ROW', next might be '1,NO CASCADE AFTER,INSERT,STATEMENT'
and so on and so forth. After the trigger creation, the test does various INSERTS/UPDATES/DELETES
and for each case, it wants to test if the eligible triggers are fired in the order they were
created. For instance a DELETE sql should cause all BEFORE DELETE ROW triggers to fire in
the order they were created. And if the order of firing is not the order of creation, then
we will run into an assertion failure error like "matching trigge
 rs need to be fired in order creation:1,NO CASCADE BEFORE,DELETE,ROW". What I find interesting
though is that all the failures mentioned in this jira are for triggers created at the very
begnning. For instance, jira description has the failure "matching triggers need to be fired
in order creation:1,NO CASCADE BEFORE,DELETE,ROW" which means trigger number 1 got fired before
I am assuming trigger number 0(provided trigger 0 is a NO CASCADE BEFORE DELETE ROW".) Another
failure reported in this jira is for "0,NO CASCADE BEFORE,UPDATE,STATEMENT" but there couldn't
have been another trigger created before trigger 0. 



Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java?rev=1467170&r1=1467169&r2=1467170&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java
Fri Apr 12 06:06:38 2013
@@ -558,7 +558,7 @@ public class TriggerTest extends BaseJDB
                     modifiedRowCount > 1 ? (order >= lastOrder) :
                         (order > lastOrder);
                 assertTrue("matching triggers need to be fired in order creation:"
-                        +info, orderOk);
+                        +info+". Triggers got fired in this order:"+TRIGGER_INFO.get().toString(),
orderOk);
                 lastOrder = order;
                 continue;
             }



Mime
View raw message