directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r419935 - /directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java
Date Fri, 07 Jul 2006 17:50:41 GMT
Author: ersiner
Date: Fri Jul  7 10:50:40 2006
New Revision: 419935

URL: http://svn.apache.org/viewvc?rev=419935&view=rev
Log:
Adding one more trigger test (well not a test really).

Modified:
    directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java

Modified: directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java?rev=419935&r1=419934&r2=419935&view=diff
==============================================================================
--- directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java
(original)
+++ directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/trigger/DefaulTriggerServiceTest.java
Fri Jul  7 10:50:40 2006
@@ -72,4 +72,29 @@
         assertNotNull( sysRoot.lookup( "ou=testou,ou=backupContext" ) );
     }
     
+    public void testBeforeDeleteLogWarning() throws NamingException
+    {
+        // Load the stored procedure unit which has the stored procedure to be triggered.
+        StoredProcedureUtils.loadStoredProcedureClass( sysRoot, LoggingUtilities.class.getName(),
getClass() );
+        
+        // Create the Triger Specification within a Trigger Subentry.
+        createTriggerSubentry( "triggerSubentry1",
+            "BEFORE delete CALL \"" + LoggingUtilities.class.getName() + ".logWarningForDeletedEntry\"
( $name, $operationPrincipal )" );
+        
+        // Create a test entry which is selected by the Trigger Subentry.
+        Attributes testEntry = new BasicAttributes( "ou", "testou", true );
+        Attribute objectClass = new BasicAttribute( "objectClass" );
+        testEntry.put( objectClass );
+        objectClass.add( "top" );
+        objectClass.add( "organizationalUnit" );
+        sysRoot.createSubcontext( "ou=testou", testEntry );
+        
+        // Delete the test entry in order to fire the Trigger.
+        sysRoot.destroySubcontext( "ou=testou" );
+        
+        // ------------------------------------------
+        // The trigger should be fired at this point.
+        // ------------------------------------------        
+    }
+    
 }



Mime
View raw message