directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1418360 - in /directory/apacheds/trunk: kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/keytab/ kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/padata/actions/ ldif-partition/src/main/java/o...
Date Fri, 07 Dec 2012 15:29:28 GMT
Author: elecharny
Date: Fri Dec  7 15:29:25 2012
New Revision: 1418360

URL: http://svn.apache.org/viewvc?rev=1418360&view=rev
Log:
o Closing resources
o Removed useless imports
o Returning the deleted entries in Partition

Modified:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/keytab/Keytab.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/padata/actions/PaDataInit.java
    directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
    directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
    directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/SearchRequestHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ssl/LdapsInitializer.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java
    directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpTimeStamp.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ReadOnlyConfigurationPartition.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddPerfIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchNoRevertIT.java

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/keytab/Keytab.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/keytab/Keytab.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/keytab/Keytab.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/keytab/Keytab.java
Fri Dec  7 15:29:25 2012
@@ -194,6 +194,7 @@ public class Keytab
         // Check to ensure that file is not larger than Integer.MAX_VALUE.
         if ( length > Integer.MAX_VALUE )
         {
+            is.close();
             throw new IOException( I18n.err( I18n.ERR_618, file.getName() ) );
         }
 
@@ -211,11 +212,13 @@ public class Keytab
         // Ensure all the bytes have been read in.
         if ( offset < bytes.length )
         {
+            is.close();
             throw new IOException( I18n.err( I18n.ERR_619, file.getName() ) );
         }
 
         // Close the input stream and return bytes.
         is.close();
+        
         return bytes;
     }
 
@@ -230,11 +233,13 @@ public class Keytab
     protected void writeFile( IoBuffer buffer, File file ) throws IOException
     {
         // Set append false to replace existing.
-        FileChannel wChannel = new FileOutputStream( file, false ).getChannel();
+        FileOutputStream fos = new FileOutputStream( file, false );
+        FileChannel wChannel = fos.getChannel();
 
         // Write the bytes between the position and limit.
         wChannel.write( buffer.buf() );
 
         wChannel.close();
+        fos.close();
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/padata/actions/PaDataInit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/padata/actions/PaDataInit.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/padata/actions/PaDataInit.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/padata/actions/PaDataInit.java
Fri Dec  7 15:29:25 2012
@@ -22,8 +22,6 @@ package org.apache.directory.shared.kerb
 
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
-import org.apache.directory.shared.asn1.ber.tlv.TLV;
-import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.kerberos.codec.padata.PaDataContainer;
 import org.apache.directory.shared.kerberos.components.PaData;
 import org.slf4j.Logger;

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
(original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
Fri Dec  7 15:29:25 2012
@@ -265,15 +265,13 @@ public class LdifPartition extends Abstr
     /**
      * {@inheritDoc}
      */
-    public void delete( String id ) throws LdapException
+    public Entry delete( String id ) throws LdapException
     {
-        Entry entry = lookup( id );
+        Entry deletedEntry = super.delete( id );
 
-        super.delete( id );
-
-        if ( entry != null )
+        if ( deletedEntry != null )
         {
-            File ldifFile = getFile( entry.getDn(), DELETE );
+            File ldifFile = getFile( deletedEntry.getDn(), DELETE );
 
             boolean deleted = deleteFile( ldifFile );
 
@@ -289,6 +287,8 @@ public class LdifPartition extends Abstr
                 LOG.debug( "deleted file {} {}", parentFile.getAbsoluteFile(), deleted );
             }
         }
+        
+        return deletedEntry;
     }
 
 

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
(original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
Fri Dec  7 15:29:25 2012
@@ -137,6 +137,8 @@ public class SingleFileLdifPartition ext
 
         if ( !itr.hasNext() )
         {
+            parser.close();
+            
             return;
         }
 
@@ -153,6 +155,7 @@ public class SingleFileLdifPartition ext
         }
         else
         {
+            parser.close();
             throw new LdapException( "The given LDIF file doesn't contain the context entry"
);
         }
 
@@ -268,13 +271,15 @@ public class SingleFileLdifPartition ext
 
 
     @Override
-    public void delete( String id ) throws LdapException
+    public Entry delete( String id ) throws LdapException
     {
         synchronized ( lock )
         {
-            super.delete( id );
+            Entry deletedEntry = super.delete( id );
             dirty = true;
             rewritePartitionData();
+            
+            return deletedEntry;
         }
     }
 

Modified: directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java
(original)
+++ directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java
Fri Dec  7 15:29:25 2012
@@ -209,6 +209,8 @@ public class SingleFileLdifPartitionTest
         {
             RandomAccessFile rf = new RandomAccessFile( fileName, "rws" );
             rf.setLength( 0 );
+
+            rf.close();
         }
 
         SingleFileLdifPartition partition = new SingleFileLdifPartition( schemaManager );
@@ -283,6 +285,8 @@ public class SingleFileLdifPartitionTest
         RandomAccessFile file = new RandomAccessFile( new File( partition.getPartitionPath()
), "r" );
 
         assertEquals( getEntryLdifLen( contextEntry ), file.length() );
+        
+        file.close();
 
         partition = reloadPartition();
         assertExists( partition, contextEntry );
@@ -371,6 +375,8 @@ public class SingleFileLdifPartitionTest
         RandomAccessFile file = new RandomAccessFile( new File( partition.getPartitionPath()
), "r" );
         assertEquals( getEntryLdifLen( modOpCtx.getAlteredEntry() ), file.length() );
 
+        file.close();
+
         // perform the above operation, this time without causing change to the entry's size
         modOpCtx = new ModifyOperationContext( mockSession );
         modOpCtx.setEntry( new ClonedServerEntry( contextEntry ) );
@@ -556,6 +562,8 @@ public class SingleFileLdifPartitionTest
 
         assertEquals( 0L, file.length() );
 
+        file.close();
+
         addCtx = new AddOperationContext( mockSession );
         addCtx.setEntry( contextEntry );
 
@@ -861,6 +869,8 @@ public class SingleFileLdifPartitionTest
         // eable writing, this will let the partition write data back to disk
         partition.setEnableRewriting( false );
         assertTrue( getEntryLdifLen( contextEntry ) == file.length() );
+
+        file.close();
     }
 
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/SearchRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/SearchRequestHandler.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/SearchRequestHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/SearchRequestHandler.java
Fri Dec  7 15:29:25 2012
@@ -31,7 +31,6 @@ import java.util.concurrent.TimeUnit;
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.core.api.ReferralManager;
-import org.apache.directory.server.core.api.SearchRequestContainer;
 import org.apache.directory.server.core.api.entry.ClonedServerEntry;
 import org.apache.directory.server.core.api.event.EventType;
 import org.apache.directory.server.core.api.event.NotificationCriteria;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ssl/LdapsInitializer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ssl/LdapsInitializer.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ssl/LdapsInitializer.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ssl/LdapsInitializer.java
Fri Dec  7 15:29:25 2012
@@ -25,7 +25,6 @@ import java.security.SecureRandom;
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
 
 import org.apache.directory.ldap.client.api.NoVerificationTrustManager;
 import org.apache.directory.server.i18n.I18n;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java
Fri Dec  7 15:29:25 2012
@@ -33,7 +33,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.entry.Attribute;
-import org.apache.directory.shared.ldap.model.entry.DefaultAttribute;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.DefaultModification;
 import org.apache.directory.shared.ldap.model.entry.Entry;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java
Fri Dec  7 15:29:25 2012
@@ -29,7 +29,6 @@ import java.io.File;
 import java.io.FilenameFilter;
 import java.io.IOException;
 import java.net.InetSocketAddress;
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpTimeStamp.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpTimeStamp.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpTimeStamp.java
(original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/NtpTimeStamp.java
Fri Dec  7 15:29:25 2012
@@ -26,8 +26,6 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.TimeZone;
 
-import org.apache.directory.shared.util.DateUtils;
-
 
 /**
  * NTP timestamps are represented as a 64-bit unsigned fixed-point number,

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ReadOnlyConfigurationPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ReadOnlyConfigurationPartition.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ReadOnlyConfigurationPartition.java
(original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ReadOnlyConfigurationPartition.java
Fri Dec  7 15:29:25 2012
@@ -111,6 +111,8 @@ public class ReadOnlyConfigurationPartit
             // Exiting if there's no entry
             if ( !itr.hasNext() )
             {
+                reader.close();
+                
                 return;
             }
 
@@ -127,6 +129,8 @@ public class ReadOnlyConfigurationPartit
             }
             else
             {
+                reader.close();
+
                 throw new LdapException( "The given LDIF file doesn't contain the context
entry" );
             }
 

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddPerfIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddPerfIT.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddPerfIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddPerfIT.java
Fri Dec  7 15:29:25 2012
@@ -30,7 +30,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.annotations.CreatePartition;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
-import org.apache.directory.server.core.integ.IntegrationUtils;
 import org.apache.directory.shared.ldap.model.cursor.EntryCursor;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.Entry;

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java
Fri Dec  7 15:29:25 2012
@@ -32,9 +32,7 @@ import org.apache.directory.server.annot
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.integ.ServerIntegrationUtils;
-import org.apache.directory.shared.ldap.model.cursor.EntryCursor;
 import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.message.SearchScope;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java
Fri Dec  7 15:29:25 2012
@@ -63,7 +63,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.util.JndiUtils;
 import org.apache.directory.shared.util.Strings;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java
Fri Dec  7 15:29:25 2012
@@ -155,6 +155,8 @@ public class ReferralSearchIT extends Ab
             getLdapServer().getDirectoryService().getAdminSession().add(
                 new DefaultEntry( getLdapServer().getDirectoryService().getSchemaManager(),
entry.getEntry() ) );
         }
+        
+        reader.close();
     }
     
     

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java
Fri Dec  7 15:29:25 2012
@@ -146,6 +146,8 @@ public class ReferralSearchMoveAndRename
             getLdapServer().getDirectoryService().getAdminSession().add(
                 new DefaultEntry( getLdapServer().getDirectoryService().getSchemaManager(),
entry.getEntry() ) );
         }
+        
+        reader.close();
     }
     
     

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchNoRevertIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchNoRevertIT.java?rev=1418360&r1=1418359&r2=1418360&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchNoRevertIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchNoRevertIT.java
Fri Dec  7 15:29:25 2012
@@ -162,12 +162,15 @@ public class ReferralSearchNoRevertIT ex
                 "ref: ldap://localhost:" + getLdapServer().getPort() + "/c=usa,ou=system\n\n";
     
         LdifReader reader = new LdifReader( new StringReader( ldif ) );
+        
         while ( reader.hasNext() )
         {
             LdifEntry entry = reader.next();
             getLdapServer().getDirectoryService().getAdminSession().add(
                 new DefaultEntry( getLdapServer().getDirectoryService().getSchemaManager(),
entry.getEntry() ) );
         }
+
+        reader.close();
     }
     
     



Mime
View raw message