directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r890875 - in /directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl: BogusSyntax.java GreaterEqTest.java LessEqTest.java
Date Tue, 15 Dec 2009 16:32:20 GMT
Author: elecharny
Date: Tue Dec 15 16:32:20 2009
New Revision: 890875

URL: http://svn.apache.org/viewvc?rev=890875&view=rev
Log:
fixd failing tests due to a bad cleanup of the SchemaManager

Modified:
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/BogusSyntax.java
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/BogusSyntax.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/BogusSyntax.java?rev=890875&r1=890874&r2=890875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/BogusSyntax.java
(original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/BogusSyntax.java
Tue Dec 15 16:32:20 2009
@@ -42,7 +42,7 @@
         setObsolete( false );
         addName( "bogus" );
         setDescription( "bogus" );
-        setSchemaName( "bogus" );
+        setSchemaName( "other" );
     }
 
 

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java?rev=890875&r1=890874&r2=890875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
Tue Dec 15 16:32:20 2009
@@ -719,28 +719,36 @@
         schemaManager.add( syntax );
         schemaManager.add( at );
 
-        GreaterEqNode node = new GreaterEqNode( at.getOid(), new ServerStringValue( at, "3"
) );
-        new GreaterEqEvaluator( node, store, schemaManager );
-        schemaManager.delete( at );
+        try
+        {
+            GreaterEqNode node = new GreaterEqNode( at.getOid(), new ServerStringValue( at,
"3" ) );
+            new GreaterEqEvaluator( node, store, schemaManager );
+        }
+        finally 
+        {
+            schemaManager.delete( at );
+            schemaManager.delete( syntax );
+        }
     }
 
 
     @Test
     public void testEvaluatorAttributeOrderingMatchingRule() throws Exception
     {
+        LdapSyntax syntax = new BogusSyntax( 1 );
         MatchingRule mr = new MatchingRule( "1.1" );
-        mr.setSyntax( new BogusSyntax( 1 ) );
+        mr.setSyntax( syntax );
         mr.setLdapComparator( new StringComparator( "1.1" ) );
 
         AttributeType at = new AttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".5000"
);
         at.addName( "bogus" );
         at.setSchemaName( "other" );
-        at.setSyntax( new BogusSyntax( 2 ) );
+        at.setSyntax( syntax );
         at.setOrdering( mr );
 
-        schemaManager.add( at.getSyntax() );
-        schemaManager.add( mr );
-        schemaManager.add( at );
+        assertTrue( schemaManager.add( syntax ) );
+        assertTrue( schemaManager.add( mr ) );
+        assertTrue( schemaManager.add( at ) );
 
         SyntaxCheckerDescription desc = new SyntaxCheckerDescription( at.getSyntax().getOid()
);
         desc.setDescription( "bogus" );

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java?rev=890875&r1=890874&r2=890875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
Tue Dec 15 16:32:20 2009
@@ -758,13 +758,20 @@
         at.setSchemaName( "other" );
         at.setSyntax( syntax );
 
-        schemaManager.add( syntax );
-        schemaManager.add( at );
-
-        LessEqNode node = new LessEqNode( at.getOid(), new ServerStringValue( at, "3" ) );
+        assertTrue( schemaManager.add( syntax ) );
+        assertTrue( schemaManager.add( at ) );
 
-        new LessEqEvaluator( node, store, schemaManager );
-        schemaManager.delete( at );
+        try
+        {
+            LessEqNode node = new LessEqNode( at.getOid(), new ServerStringValue( at, "3"
) );
+
+            new LessEqEvaluator( node, store, schemaManager );
+        }
+        finally
+        {
+            assertTrue( schemaManager.delete( at ) );
+            assertTrue( schemaManager.delete( syntax ) );
+        }
     }
 
 



Mime
View raw message