You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2008/05/22 00:36:14 UTC

svn commit: r658910 - in /directory/apacheds/branches/bigbang: protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/ server-unit/src/main/java/org/apache/directory/server/unit/ server-unit/src/test/java/org/apache/directory/server/ ...

Author: akarasulu
Date: Wed May 21 15:36:14 2008
New Revision: 658910

URL: http://svn.apache.org/viewvc?rev=658910&view=rev
Log:
fixing compilation problems with NamingEnums and NamingExceptions

Modified:
    directory/apacheds/branches/bigbang/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java
    directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
    directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/DIRSERVER951ITest.java
    directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java
    directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/MiscTest.java
    directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/NegationOperatorITest.java
    directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java
    directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java
    directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/StoredProcedureExecutionITest.java
    directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java

Modified: directory/apacheds/branches/bigbang/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java?rev=658910&r1=658909&r2=658910&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java (original)
+++ directory/apacheds/branches/bigbang/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java Wed May 21 15:36:14 2008
@@ -157,7 +157,7 @@
         partition.setId( "example" );
         partition.setSuffix( "dc=example,dc=com" );
 
-        Set<Index> indexedAttrs = new HashSet<Index>();
+        Set<Index<?,ServerEntry>> indexedAttrs = new HashSet<Index<?,ServerEntry>>();
         indexedAttrs.add( new JdbmIndex( "ou" ) );
         indexedAttrs.add( new JdbmIndex( "dc" ) );
         indexedAttrs.add( new JdbmIndex( "objectClass" ) );

Modified: directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java?rev=658910&r1=658909&r2=658910&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java Wed May 21 15:36:14 2008
@@ -33,7 +33,6 @@
 import org.apache.directory.server.ldap.handlers.bind.*;
 import org.apache.directory.server.ldap.handlers.bind.ntlm.NtlmMechanismHandler;
 import org.apache.directory.server.protocol.shared.SocketAcceptor;
-import org.apache.directory.shared.ldap.exception.LdapConfigurationException;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -44,7 +43,6 @@
 
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.ldap.InitialLdapContext;
@@ -102,7 +100,7 @@
      * @return a list of entries added to the server in the order they were added
      * @throws NamingException of the load fails
      */
-    protected List<LdifEntry> loadTestLdif( boolean verifyEntries ) throws NamingException
+    protected List<LdifEntry> loadTestLdif( boolean verifyEntries ) throws Exception
     {
         return loadLdif( getClass().getResourceAsStream( getClass().getSimpleName() + ".ldif" ), verifyEntries );
     }
@@ -119,7 +117,7 @@
      * @return a list of entries added to the server in the order they were added
      * @throws NamingException of the load fails
      */
-    protected List<LdifEntry> loadLdif( InputStream in, boolean verifyEntries ) throws NamingException
+    protected List<LdifEntry> loadLdif( InputStream in, boolean verifyEntries ) throws Exception
     {
         if ( in == null )
         {
@@ -157,7 +155,7 @@
      * @param entry the entry to verify
      * @throws NamingException if there are problems accessing the entry
      */
-    protected void verify( LdifEntry entry ) throws NamingException
+    protected void verify( LdifEntry entry ) throws Exception
     {
         Attributes readAttributes = rootDSE.getAttributes( entry.getDn() );
         NamingEnumeration<String> readIds = entry.getAttributes().getIDs();
@@ -189,7 +187,7 @@
      * @return an LDAP context as the the administrator to the rootDSE
      * @throws NamingException if the server cannot be contacted
      */
-    protected LdapContext getWiredContext() throws NamingException
+    protected LdapContext getWiredContext() throws Exception
     {
         return getWiredContext( ServerDNConstants.ADMIN_SYSTEM_DN, "secret" );
     }
@@ -206,7 +204,7 @@
      * @return an LDAP context as the the administrator to the rootDSE
      * @throws NamingException if the server cannot be contacted
      */
-    protected LdapContext getWiredContext( String bindPrincipalDn, String password ) throws NamingException
+    protected LdapContext getWiredContext( String bindPrincipalDn, String password ) throws Exception
     {
 //        if ( ! apacheDS.isStarted() )
 //        {
@@ -294,7 +292,7 @@
     }
 
 
-    protected void configureDirectoryService() throws NamingException
+    protected void configureDirectoryService() throws Exception
     {
     }
 
@@ -342,7 +340,7 @@
      * @param passwd the password of the user
      * @throws NamingException if there is a failure of any kind
      */
-    protected void setContexts( String user, String passwd ) throws NamingException
+    protected void setContexts( String user, String passwd ) throws Exception
     {
         Hashtable<String, Object> env = new Hashtable<String, Object>();
         env.put( DirectoryService.JNDI_KEY, directoryService );
@@ -361,7 +359,7 @@
      * @param env an environment to use while setting up the system root.
      * @throws NamingException if there is a failure of any kind
      */
-    protected void setContexts( Hashtable<String, Object> env ) throws NamingException
+    protected void setContexts( Hashtable<String, Object> env ) throws Exception
     {
         Hashtable<String, Object> envFinal = new Hashtable<String, Object>( env );
         envFinal.put( Context.PROVIDER_URL, ServerDNConstants.SYSTEM_DN );
@@ -413,27 +411,18 @@
      * adding those entries to the system partition
      * @param in the input stream with the ldif
      */
-    protected void importLdif( InputStream in ) throws NamingException
+    protected void importLdif( InputStream in ) throws Exception
     {
-        try
-        {
-            Iterator<LdifEntry> iterator = new LdifReader( in );
+        Iterator<LdifEntry> iterator = new LdifReader( in );
 
-            while ( iterator.hasNext() )
-            {
-                LdifEntry entry = iterator.next();
-                LdapDN dn = new LdapDN( entry.getDn() );
-                rootDSE.createSubcontext( dn, entry.getAttributes() );
-            }
-        }
-        catch ( Exception e )
+        while ( iterator.hasNext() )
         {
-            String msg = "failed while trying to parse system ldif file";
-            NamingException ne = new LdapConfigurationException( msg );
-            ne.setRootCause( e );
-            throw ne;
+            LdifEntry entry = iterator.next();
+            LdapDN dn = new LdapDN( entry.getDn() );
+            rootDSE.createSubcontext( dn, entry.getAttributes() );
         }
     }
+
     
     /**
      * Inject an ldif String into the server. DN must be relative to the
@@ -441,7 +430,7 @@
      * @param ldif the entries to inject
      * @throws NamingException if the entries cannot be added
      */
-    protected void injectEntries( String ldif ) throws NamingException
+    protected void injectEntries( String ldif ) throws Exception
     {
         LdifReader reader = new LdifReader();
         List<LdifEntry> entries = reader.parseLdif( ldif );
@@ -451,6 +440,4 @@
             rootDSE.createSubcontext( new LdapDN( entry.getDn() ), entry.getAttributes() );
         }
     }
-    
-    
 }

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/DIRSERVER951ITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/DIRSERVER951ITest.java?rev=658910&r1=658909&r2=658910&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/DIRSERVER951ITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/DIRSERVER951ITest.java Wed May 21 15:36:14 2008
@@ -31,7 +31,6 @@
 import org.apache.directory.shared.ldap.util.DateUtils;
 
 import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
@@ -66,7 +65,7 @@
 
 
     @Override
-    protected void configureDirectoryService() throws NamingException
+    protected void configureDirectoryService() throws Exception
     {
         JdbmPartition systemCfg = new JdbmPartition();
         systemCfg.setId( "system" );
@@ -77,7 +76,7 @@
         systemCfg.setSuffix( "ou=system" );
 
         // Add indexed attributes for system partition
-        Set<Index> indexedAttrs = new HashSet<Index>();
+        Set<Index<?,ServerEntry>> indexedAttrs = new HashSet<Index<?,ServerEntry>>();
         indexedAttrs.add( new JdbmIndex( Store.ALIAS ) );
         indexedAttrs.add( new JdbmIndex( Store.PRESENCE ) );
         indexedAttrs.add( new JdbmIndex( Store.ONELEVEL ) );
@@ -144,7 +143,7 @@
     }
     
     
-    Set<SearchResult> getResults( String filter ) throws NamingException
+    Set<SearchResult> getResults( String filter ) throws Exception
     {
         Set<SearchResult> results = new HashSet<SearchResult>();
         SearchControls controls = new SearchControls();

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java?rev=658910&r1=658909&r2=658910&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java Wed May 21 15:36:14 2008
@@ -127,7 +127,7 @@
         partition.setId( "example" );
         partition.setSuffix( "dc=example,dc=com" );
 
-        Set<Index> indexedAttrs = new HashSet<Index>();
+        Set<Index<?,ServerEntry>> indexedAttrs = new HashSet<Index<?,ServerEntry>>();
         indexedAttrs.add( new JdbmIndex( "ou" ) );
         indexedAttrs.add( new JdbmIndex( "dc" ) );
         indexedAttrs.add( new JdbmIndex( "objectClass" ) );

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/MiscTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/MiscTest.java?rev=658910&r1=658909&r2=658910&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/MiscTest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/MiscTest.java Wed May 21 15:36:14 2008
@@ -110,7 +110,7 @@
 
             partition.setId( "apache" );
             partition.setContextEntry( serverEntry );
-            Set<Index> indexedAttributes = new HashSet<Index>();
+            Set<Index<?,ServerEntry>> indexedAttributes = new HashSet<Index<?,ServerEntry>>();
             indexedAttributes.add( new JdbmIndex( "dc" ) );
             partition.setIndexedAttributes( indexedAttributes );
             partitions.add( partition );
@@ -131,7 +131,7 @@
             
             partition.setId( "apache" );
             partition.setContextEntry( serverEntry );
-            Set<Index> indexedAttributes = new HashSet<Index>();
+            Set<Index<?,ServerEntry>> indexedAttributes = new HashSet<Index<?,ServerEntry>>();
             indexedAttributes.add( new JdbmIndex( "dc" ) );
             partition.setIndexedAttributes( indexedAttributes );
             partitions.add( partition );

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/NegationOperatorITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/NegationOperatorITest.java?rev=658910&r1=658909&r2=658910&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/NegationOperatorITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/NegationOperatorITest.java Wed May 21 15:36:14 2008
@@ -84,7 +84,7 @@
             system.setSuffix( "ou=system" );
 
             // Add indexed attributes for system partition
-            Set<Index> indexedAttrs = new HashSet<Index>();
+            Set<Index<?,ServerEntry>> indexedAttrs = new HashSet<Index<?,ServerEntry>>();
             indexedAttrs.add( new JdbmIndex( SchemaConstants.OBJECT_CLASS_AT ) );
             indexedAttrs.add( new JdbmIndex( SchemaConstants.OU_AT ) );
             system.setIndexedAttributes( indexedAttrs );

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java?rev=658910&r1=658909&r2=658910&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java Wed May 21 15:36:14 2008
@@ -89,7 +89,7 @@
         partition.setId( "example" );
         partition.setSuffix( "dc=example,dc=com" );
 
-        Set<Index> indexedAttrs = new HashSet<Index>();
+        Set<Index<?,ServerEntry>> indexedAttrs = new HashSet<Index<?,ServerEntry>>();
         indexedAttrs.add( new JdbmIndex( "ou" ) );
         indexedAttrs.add( new JdbmIndex( "dc" ) );
         indexedAttrs.add( new JdbmIndex( "objectClass" ) );

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java?rev=658910&r1=658909&r2=658910&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java Wed May 21 15:36:14 2008
@@ -107,7 +107,7 @@
         partition.setId( "example" );
         partition.setSuffix( "dc=example,dc=com" );
 
-        Set<Index> indexedAttrs = new HashSet<Index>();
+        Set<Index<?,ServerEntry>> indexedAttrs = new HashSet<Index<?,ServerEntry>>();
         indexedAttrs.add( new JdbmIndex( "ou" ) );
         indexedAttrs.add( new JdbmIndex( "dc" ) );
         indexedAttrs.add( new JdbmIndex( "objectClass" ) );

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/StoredProcedureExecutionITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/StoredProcedureExecutionITest.java?rev=658910&r1=658909&r2=658910&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/StoredProcedureExecutionITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/StoredProcedureExecutionITest.java Wed May 21 15:36:14 2008
@@ -33,7 +33,6 @@
 import org.junit.Test;
 
 import javax.naming.NameNotFoundException;
-import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
@@ -103,7 +102,7 @@
     }
     
 
-    public void testExecuteProcedureWithReturnValue() throws NamingException
+    public void testExecuteProcedureWithReturnValue() throws Exception
     {
         String procedureName = HelloWorldProcedure.class.getName() + ":sayHello";
         
@@ -115,7 +114,7 @@
     }
     
 
-    public void testExecuteProcedureWithParametersAndReturnValue() throws NamingException
+    public void testExecuteProcedureWithParametersAndReturnValue() throws Exception
     {
         String procedureName = HelloWorldProcedure.class.getName() + ":sayHelloTo";
         
@@ -127,7 +126,7 @@
     }
     
     
-    @Test public void testSPDeleteSubtree() throws NamingException
+    @Test public void testSPDeleteSubtree() throws Exception
     {
         String ldif =
             "version: 1\n" +

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java?rev=658910&r1=658909&r2=658910&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java Wed May 21 15:36:14 2008
@@ -29,7 +29,6 @@
 import org.apache.directory.server.unit.AbstractServerTest;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
-import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
@@ -46,17 +45,15 @@
  */
 public class ServerContextFactoryTest extends AbstractServerTest
 {
-    public ServerContextFactoryTest() throws NamingException
+    public ServerContextFactoryTest() 
     {
     }
 
-    private DirContext ctx = null;
-
 
     public void setUp() throws Exception
     {
         super.setUp();
-        Set<Index> indexedAttrs;
+        Set<Index<?,ServerEntry>> indexedAttrs;
         Set<Partition> partitions = new HashSet<Partition>();
 
         // Add partition 'testing'
@@ -64,7 +61,7 @@
         partition.setId( "testing" );
         partition.setSuffix( "ou=testing" );
 
-        indexedAttrs = new HashSet<Index>();
+        indexedAttrs = new HashSet<Index<?,ServerEntry>>();
         indexedAttrs.add( new JdbmIndex( "ou" ) );
         indexedAttrs.add( new JdbmIndex( "objectClass" ) );
         partition.setIndexedAttributes( indexedAttrs );
@@ -81,7 +78,7 @@
         partition.setId( "example" );
         partition.setSuffix( "dc=example" );
 
-        indexedAttrs = new HashSet<Index>();
+        indexedAttrs = new HashSet<Index<?,ServerEntry>>();
         indexedAttrs.add( new JdbmIndex( "ou" ) );
         indexedAttrs.add( new JdbmIndex( "dc" ) );
         indexedAttrs.add( new JdbmIndex( "objectClass" ) );
@@ -99,7 +96,7 @@
         partition.setId( "mixedcase" );
         partition.setSuffix( "dc=MixedCase" );
 
-        indexedAttrs = new HashSet<Index>();
+        indexedAttrs = new HashSet<Index<?,ServerEntry>>();
         indexedAttrs.add( new JdbmIndex( "dc" ) );
         indexedAttrs.add( new JdbmIndex( "objectClass" ) );
         partition.setIndexedAttributes( indexedAttrs );
@@ -122,7 +119,7 @@
      *
      * @throws NamingException if there are failures
      */
-    public void testSystemContext() throws NamingException
+    public void testSystemContext() throws Exception
     {
         assertNotNull( sysRoot );
 
@@ -147,7 +144,7 @@
      *
      * @throws NamingException if there are failures
      */
-    public void testSetupTeardown() throws NamingException
+    public void testSetupTeardown() throws Exception
     {
         assertNotNull( sysRoot );
         Attributes attributes = sysRoot.getAttributes( "" );