directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r498894 - in /directory/triplesec/trunk: admin-api/src/test/java/org/safehaus/triplesec/admin/ guardian-ldap/src/test/java/org/safehaus/triplesec/guardian/ldap/ store/src/main/schema/ store/src/test/java/org/safehaus/triplesec/store/ store/...
Date Tue, 23 Jan 2007 02:23:07 GMT
Author: akarasulu
Date: Mon Jan 22 18:23:04 2007
New Revision: 498894

URL: http://svn.apache.org/viewvc?view=rev&rev=498894
Log:
fixing various bugs and issues throughout the triplesec code base

Modified:
    directory/triplesec/trunk/admin-api/src/test/java/org/safehaus/triplesec/admin/IntegrationTest.java
    directory/triplesec/trunk/guardian-ldap/src/test/java/org/safehaus/triplesec/guardian/ldap/LdapApplicationPolicyIntegrationTest.java
    directory/triplesec/trunk/store/src/main/schema/safehaus.schema
    directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/ProfileFactoryITest.java
    directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/ServerProfileStoreITest.java
    directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/interceptor/PolicyProtectionInterceptorITest.java
    directory/triplesec/trunk/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/GenerateHotp.java
    directory/triplesec/trunk/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/HotpSamVerifierITest.java

Modified: directory/triplesec/trunk/admin-api/src/test/java/org/safehaus/triplesec/admin/IntegrationTest.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/admin-api/src/test/java/org/safehaus/triplesec/admin/IntegrationTest.java?view=diff&rev=498894&r1=498893&r2=498894
==============================================================================
--- directory/triplesec/trunk/admin-api/src/test/java/org/safehaus/triplesec/admin/IntegrationTest.java
(original)
+++ directory/triplesec/trunk/admin-api/src/test/java/org/safehaus/triplesec/admin/IntegrationTest.java
Mon Jan 22 18:23:04 2007
@@ -531,7 +531,9 @@
         HauskeysUserModifier modifier = admin.newHauskeysUser( "testHauskeysUser", "joe",
"smith", "secret" );
         modifier.setAddress1( "address1" ).setAddress2( "address2" ).setCity( "city" ).
         setCompany( "company" ).setCountry( "country" ).setStateProvRegion( "stateProvRegion"
)
-        .setZipPostalCode( "zipPostalCode" ).setLabel( "testHauskeysUser" ).setNotifyBy(
"sms" ).add();
+        .setZipPostalCode( "zipPostalCode" ).setLabel( "testHauskeysUser" ).setNotifyBy(
"sms" )
+        .setTokenPin( "1234" ).add();
+        
         assertTrue( admin.hasUser( "testHauskeysUser" ) );
         
         HauskeysUser user = ( HauskeysUser ) admin.getUser( "testHauskeysUser" );

Modified: directory/triplesec/trunk/guardian-ldap/src/test/java/org/safehaus/triplesec/guardian/ldap/LdapApplicationPolicyIntegrationTest.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/guardian-ldap/src/test/java/org/safehaus/triplesec/guardian/ldap/LdapApplicationPolicyIntegrationTest.java?view=diff&rev=498894&r1=498893&r2=498894
==============================================================================
--- directory/triplesec/trunk/guardian-ldap/src/test/java/org/safehaus/triplesec/guardian/ldap/LdapApplicationPolicyIntegrationTest.java
(original)
+++ directory/triplesec/trunk/guardian-ldap/src/test/java/org/safehaus/triplesec/guardian/ldap/LdapApplicationPolicyIntegrationTest.java
Mon Jan 22 18:23:04 2007
@@ -220,10 +220,10 @@
 
     public void testGetProfileIds() throws Exception
     {
-        Set ids = new HashSet();
+        Set<String> ids = new HashSet<String>();
         for ( Iterator ii = this.store.getProfileIdIterator(); ii.hasNext(); /**/ )
         {
-            ids.add( ii.next() );
+            ids.add( ( String ) ii.next() );
         }
         assertEquals( 5, ids.size() );
         assertTrue( ids.contains( "mockProfile0" ) );
@@ -237,7 +237,7 @@
 
     private InitialLdapContext getNewAppContext() throws NamingException
     {
-        Hashtable env = new Hashtable();
+        Hashtable<String, String> env = new Hashtable<String, String>();
         env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
         env.put( "java.naming.provider.url", "ldap://localhost:" +  super.getLdapPort()
             + "/appName=mockApplication,ou=applications,dc=example,dc=com" );

Modified: directory/triplesec/trunk/store/src/main/schema/safehaus.schema
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/store/src/main/schema/safehaus.schema?view=diff&rev=498894&r1=498893&r2=498894
==============================================================================
--- directory/triplesec/trunk/store/src/main/schema/safehaus.schema (original)
+++ directory/triplesec/trunk/store/src/main/schema/safehaus.schema Mon Jan 22 18:23:04 2007
@@ -113,7 +113,8 @@
     SUP top
     AUXILIARY
     MUST (  safehausUid $ safehausRealm $ safehausLabel $ safehausSecret $
-            safehausFactor $ safehausResynchCount $ safehausFailuresInEpoch $ safehausNotifyBy
)
+            safehausFactor $ safehausResynchCount $ safehausFailuresInEpoch $ 
+            safehausNotifyBy $ safehausTokenPin )
     MAY  ( safehausInfo $ safehausActivationKey $ safehausMidletName $ safehausDisabled )
)
 
 

Modified: directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/ProfileFactoryITest.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/ProfileFactoryITest.java?view=diff&rev=498894&r1=498893&r2=498894
==============================================================================
--- directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/ProfileFactoryITest.java
(original)
+++ directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/ProfileFactoryITest.java
Mon Jan 22 18:23:04 2007
@@ -49,7 +49,7 @@
     public ProfileFactoryITest()
     {
         MutableStartupConfiguration cfg = super.configuration;
-        Set schemas = new HashSet();
+        Set<AbstractBootstrapSchema> schemas = new HashSet<AbstractBootstrapSchema>();
         schemas.add( new SystemSchema() );
         schemas.add( new SafehausSchema() );
         schemas.add( new ApacheSchema() );

Modified: directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/ServerProfileStoreITest.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/ServerProfileStoreITest.java?view=diff&rev=498894&r1=498893&r2=498894
==============================================================================
--- directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/ServerProfileStoreITest.java
(original)
+++ directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/ServerProfileStoreITest.java
Mon Jan 22 18:23:04 2007
@@ -38,6 +38,7 @@
 import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
 import org.apache.directory.server.core.configuration.MutableStartupConfiguration;
 import org.apache.directory.server.core.configuration.ShutdownConfiguration;
+import org.apache.directory.server.core.schema.bootstrap.AbstractBootstrapSchema;
 import org.apache.directory.server.core.schema.bootstrap.ApacheSchema;
 import org.apache.directory.server.core.schema.bootstrap.CoreSchema;
 import org.apache.directory.server.core.schema.bootstrap.CosineSchema;
@@ -85,7 +86,7 @@
         MutablePartitionConfiguration partConfig = new MutablePartitionConfiguration();
         partConfig.setName( "example" );
 
-        HashSet indices = new HashSet();
+        HashSet<String> indices = new HashSet<String>();
         indices.add( "dc" );
         indices.add( "ou" );
         indices.add( "objectClass" );
@@ -103,7 +104,7 @@
         attrs.put( "dc", "example" );
         partConfig.setContextEntry( attrs );
 
-        Set schemas = new HashSet();
+        Set<AbstractBootstrapSchema> schemas = new HashSet<AbstractBootstrapSchema>();
         schemas.add( new SystemSchema() );
         schemas.add( new SafehausSchema() );
         schemas.add( new ApacheSchema() );
@@ -115,7 +116,7 @@
         config.setContextPartitionConfigurations( Collections.singleton( partConfig ) );
         config.setShutdownHookEnabled( false );
         
-        Hashtable env = new Hashtable();
+        Hashtable<String, Object> env = new Hashtable<String, Object>();
         env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory"
);
         env.put( Context.PROVIDER_URL, "dc=example,dc=com" );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
@@ -135,13 +136,13 @@
             Attributes users = new BasicAttributes( "objectClass", "top", true );
             users.get( "objectClass" ).add( "organizationalUnit" );
             attrs.put( "ou", "users" );
-            userContext = userContext.createSubcontext( "ou=users", attrs );
+            userContext = userContext.createSubcontext( "ou=users", users );
         }
 
         store = new DefaultServerProfileStore( userContext );
         store.init();
 
-        List filters = Collections.singletonList( new Krb5KdcEntryFilter() );
+        List<Krb5KdcEntryFilter> filters = Collections.singletonList( new Krb5KdcEntryFilter()
);
         LdifFileLoader loader = new LdifFileLoader( userContext, new File( "safehaus.ldif"
), filters, getClass().getClassLoader() );
         loader.execute();
 
@@ -153,7 +154,7 @@
     {
         userContext.close();
         ShutdownConfiguration config = new ShutdownConfiguration();
-        Hashtable env = new Hashtable();
+        Hashtable<String, Object> env = new Hashtable<String, Object>();
         env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory"
);
         env.put( Context.PROVIDER_URL, "dc=example,dc=com" );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );

Modified: directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/interceptor/PolicyProtectionInterceptorITest.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/interceptor/PolicyProtectionInterceptorITest.java?view=diff&rev=498894&r1=498893&r2=498894
==============================================================================
--- directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/interceptor/PolicyProtectionInterceptorITest.java
(original)
+++ directory/triplesec/trunk/store/src/test/java/org/safehaus/triplesec/store/interceptor/PolicyProtectionInterceptorITest.java
Mon Jan 22 18:23:04 2007
@@ -38,6 +38,7 @@
 import junit.framework.Assert;
 
 import org.apache.directory.server.core.unit.AbstractAdminTestCase;
+import org.apache.directory.server.core.schema.bootstrap.BootstrapSchema;
 import org.apache.directory.server.core.schema.bootstrap.SystemSchema;
 import org.apache.directory.server.core.schema.bootstrap.CoreSchema;
 import org.apache.directory.server.core.schema.bootstrap.Krb5kdcSchema;
@@ -61,9 +62,10 @@
     private DirContext ctx;
 
 
+    @SuppressWarnings("unchecked")
     public void setUp() throws Exception
     {
-        Set schemas = super.configuration.getBootstrapSchemas();
+        Set<BootstrapSchema> schemas = super.configuration.getBootstrapSchemas();
         schemas.add( new CoreSchema() );
         schemas.add( new SystemSchema() );
         schemas.add( new Krb5kdcSchema() );
@@ -75,17 +77,17 @@
         MutablePartitionConfiguration partitionCfg = new MutablePartitionConfiguration();
         partitionCfg.setName( "example" );
         partitionCfg.setSuffix( "dc=example,dc=com" );
-        Attributes ctxEntry = new BasicAttributes();
+        Attributes ctxEntry = new BasicAttributes( true );
         ctxEntry.put( "objectClass", "top" );
         ctxEntry.put( "dc", "example" );
         partitionCfg.setContextEntry( ctxEntry );
         partitionCfg.setContextPartition( new JdbmPartition() );
 
-        Set partitions = super.configuration.getContextPartitionConfigurations();
+        Set<MutablePartitionConfiguration> partitions = super.configuration.getContextPartitionConfigurations();
         partitions.add( partitionCfg );
         super.configuration.setContextPartitionConfigurations( partitions );
 
-        List interceptors = super.configuration.getInterceptorConfigurations();
+        List<MutableInterceptorConfiguration> interceptors = super.configuration.getInterceptorConfigurations();
         MutableInterceptorConfiguration interceptorCfg = new MutableInterceptorConfiguration();
         interceptorCfg.setName( "protector" );
         interceptorCfg.setInterceptor( new PolicyProtectionInterceptor() );
@@ -97,7 +99,7 @@
         super.setLdifPath( "/interceptor.ldif", getClass() );
         super.setUp();
 
-        Hashtable env = new Hashtable();
+        Hashtable<String, Object> env = new Hashtable<String, Object>();
         env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory"
);
         env.put( Context.PROVIDER_URL, "" );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
@@ -122,10 +124,13 @@
         Attribute attr;
 
         // Adding unrelated entries should be OK.
-        ctx.bind( "ou=test,dc=example,dc=com", null, new BasicAttributes( "objectClass",
"top" ) );
+        BasicAttributes attrs = new BasicAttributes( "objectClass", "top", true );
+        attrs.get( "objectClass" ).add( "organizationalUnit" );
+        attrs.put( "ou", "test" );
+        ctx.bind( "ou=test,dc=example,dc=com", null, attrs );
 
         // Test adding permissions
-        Attributes perm = new BasicAttributes();
+        Attributes perm = new BasicAttributes( true );
         attr = new BasicAttribute( "objectClass" );
         attr.add( "top" );
         attr.add( "policyPermission" );
@@ -135,7 +140,7 @@
         _testAdd( "permName=permX", "permName=mockPerm0", "ou=permissions", perm );
 
         // Test adding roles
-        Attributes role = new BasicAttributes();
+        Attributes role = new BasicAttributes( true );
         attr = new BasicAttribute( "objectClass" );
         attr.add( "top" );
         attr.add( "policyRole" );
@@ -145,7 +150,7 @@
         _testAdd( "roleName=roleX", "roleName=mockRole0", "ou=roles", role );
 
         // Test adding profiles
-        Attributes profile = new BasicAttributes();
+        Attributes profile = new BasicAttributes( true );
         attr = new BasicAttribute( "objectClass" );
         attr.add( "top" );
         attr.add( "policyProfile" );
@@ -157,7 +162,7 @@
         
         
         // Test adding a role with non-existing permissions
-        role = new BasicAttributes();
+        role = new BasicAttributes( true );
         attr = new BasicAttribute( "objectClass" );
         attr.add( "top" );
         attr.add( "policyRole" );
@@ -177,7 +182,7 @@
         }
 
         // Test adding a profile with a non-existing role
-        profile = new BasicAttributes();
+        profile = new BasicAttributes( true );
         attr = new BasicAttribute( "objectClass" );
         attr.add( "top" );
         attr.add( "policyProfile" );
@@ -198,7 +203,7 @@
         }
         
         // Test adding a profile with non-existing permissions
-        profile = new BasicAttributes();
+        profile = new BasicAttributes( true );
         attr = new BasicAttribute( "objectClass" );
         attr.add( "top" );
         attr.add( "policyProfile" );
@@ -224,7 +229,7 @@
             ctx.modifyAttributes(
                     "roleName=mockRole0,ou=roles,appName=mockApplication,ou=applications,dc=example,dc=com",
                     DirContext.ADD_ATTRIBUTE,
-                    new BasicAttributes( "grants", "unknownPerm" ) );
+                    new BasicAttributes( "grants", "unknownPerm", true ) );
             Assert.fail();
         }
         catch( SchemaViolationException e )
@@ -238,7 +243,7 @@
             ctx.modifyAttributes(
                     "profileId=mockProfile0,ou=profiles,appName=mockApplication,ou=applications,dc=example,dc=com",
                     DirContext.ADD_ATTRIBUTE,
-                    new BasicAttributes( "grants", "unknownPerm" ) );
+                    new BasicAttributes( "grants", "unknownPerm", true ) );
             Assert.fail();
         }
         catch( SchemaViolationException e )
@@ -252,7 +257,7 @@
             ctx.modifyAttributes(
                     "profileId=mockProfile0,ou=profiles,appName=mockApplication,ou=applications,dc=example,dc=com",
                     DirContext.ADD_ATTRIBUTE,
-                    new BasicAttributes( "roles", "unknownRole" ) );
+                    new BasicAttributes( "roles", "unknownRole", true ) );
             Assert.fail();
         }
         catch( SchemaViolationException e )
@@ -365,9 +370,9 @@
     {
         // Test modifications on non-policy entry
         ctx.modifyAttributes( "uid=akarasulu, ou=Users, dc=example,dc=com", DirContext.ADD_ATTRIBUTE,
-            new BasicAttributes( "telephonenumber", "+1 904 982 6888" ) );
+            new BasicAttributes( "telephonenumber", "+1 904 982 6888", true ) );
         ctx.modifyAttributes( "uid=akarasulu, ou=Users, dc=example,dc=com", DirContext.REMOVE_ATTRIBUTE,
-            new BasicAttributes( "telephonenumber", "+1 904 982 6888" ) );
+            new BasicAttributes( "telephonenumber", "+1 904 982 6888", true ) );
 
         // Test modifications on permissions
 
@@ -376,17 +381,17 @@
         //        ctx.modifyAttributes(
         //                "permName=mockPerm8,ou=permissions,appName=mockApplication,ou=applications,dc=example",
         //                DirContext.ADD_ATTRIBUTE,
-        //                new BasicAttributes( "test", "test" ) );
+        //                new BasicAttributes( "test", "test", true ) );
         //        ctx.modifyAttributes(
         //                "permName=mockPerm8,ou=permissions,appName=mockApplication,ou=applications,dc=example",
         //                DirContext.REMOVE_ATTRIBUTE,
-        //                new BasicAttributes( "test", "test" ) );
+        //                new BasicAttributes( "test", "test", true ) );
         //        try
         //        {
         //            ctx.modifyAttributes(
         //                    "permName=mockPerm8,ou=permissions,appName=mockApplication,ou=applications,dc=example",
         //                    DirContext.REMOVE_ATTRIBUTE,
-        //                    new BasicAttributes( "objectclass", "policyPermission" ) );
+        //                    new BasicAttributes( "objectclass", "policyPermission", true
) );
         //            Assert.fail();
         //        }
         //        catch( SchemaViolationException e )
@@ -395,26 +400,26 @@
         //        }
         ctx.modifyAttributes(
             "permName=mockPerm8,ou=permissions,appName=mockApplication,ou=applications,dc=example,dc=com",
-            DirContext.ADD_ATTRIBUTE, new BasicAttributes( "objectclass", "inetOrgPerson"
) );
+            DirContext.ADD_ATTRIBUTE, new BasicAttributes( "objectclass", "inetOrgPerson",
true ) );
         ctx.modifyAttributes(
             "permName=mockPerm8,ou=permissions,appName=mockApplication,ou=applications,dc=example,dc=com",
-            DirContext.REMOVE_ATTRIBUTE, new BasicAttributes( "objectclass", "inetOrgPerson"
) );
+            DirContext.REMOVE_ATTRIBUTE, new BasicAttributes( "objectclass", "inetOrgPerson",
true ) );
 
         // Test modifications on roles
         //        ctx.modifyAttributes(
         //                "roleName=mockRole0,ou=roles,appName=mockApplication,ou=applications,dc=example",
         //                DirContext.ADD_ATTRIBUTE,
-        //                new BasicAttributes( "test", "test" ) );
+        //                new BasicAttributes( "test", "test", true ) );
         //        ctx.modifyAttributes(
         //                "roleName=mockRole0,ou=roles,appName=mockApplication,ou=applications,dc=example",
         //                DirContext.REMOVE_ATTRIBUTE,
-        //                new BasicAttributes( "test", "test" ) );
+        //                new BasicAttributes( "test", "test", true ) );
         //        try
         //        {
         //            ctx.modifyAttributes(
         //                    "roleName=mockRole0,ou=roles,appName=mockApplication,ou=applications,dc=example",
         //                    DirContext.REMOVE_ATTRIBUTE,
-        //                    new BasicAttributes( "objectclass", "policyRole" ) );
+        //                    new BasicAttributes( "objectclass", "policyRole", true ) );
         //            Assert.fail();
         //        }
         //        catch( SchemaViolationException e )
@@ -422,25 +427,25 @@
         //            // OK
         //        }
         ctx.modifyAttributes( "roleName=mockRole0,ou=roles,appName=mockApplication,ou=applications,dc=example,dc=com",
-            DirContext.ADD_ATTRIBUTE, new BasicAttributes( "objectclass", "inetOrgPerson"
) );
+            DirContext.ADD_ATTRIBUTE, new BasicAttributes( "objectclass", "inetOrgPerson",
true ) );
         ctx.modifyAttributes( "roleName=mockRole0,ou=roles,appName=mockApplication,ou=applications,dc=example,dc=com",
-            DirContext.REMOVE_ATTRIBUTE, new BasicAttributes( "objectclass", "inetOrgPerson"
) );
+            DirContext.REMOVE_ATTRIBUTE, new BasicAttributes( "objectclass", "inetOrgPerson",
true ) );
 
         // Test modifications on profiles
         //        ctx.modifyAttributes(
         //                "uid=mockProfile0,ou=profiles,appName=mockApplication,ou=applications,dc=example",
         //                DirContext.ADD_ATTRIBUTE,
-        //                new BasicAttributes( "test", "test" ) );
+        //                new BasicAttributes( "test", "test", true ) );
         //        ctx.modifyAttributes(
         //                "uid=mockProfile0,ou=profiles,appName=mockApplication,ou=applications,dc=example",
         //                DirContext.REMOVE_ATTRIBUTE,
-        //                new BasicAttributes( "test", "test" ) );
+        //                new BasicAttributes( "test", "test", true ) );
         //        try
         //        {
         //            ctx.modifyAttributes(
         //                    "uid=mockProfile0,ou=profiles,appName=mockApplication,ou=applications,dc=example",
         //                    DirContext.REMOVE_ATTRIBUTE,
-        //                    new BasicAttributes( "objectclass", "policyProfile" ) );
+        //                    new BasicAttributes( "objectclass", "policyProfile", true )
);
         //            Assert.fail();
         //        }
         //        catch( SchemaViolationException e )
@@ -450,11 +455,11 @@
         //        ctx.modifyAttributes(
         //                "uid=mockProfile0,ou=profiles,appName=mockApplication,ou=applications,dc=example",
         //                DirContext.ADD_ATTRIBUTE,
-        //                new BasicAttributes( "objectclass", "test" ) );
+        //                new BasicAttributes( "objectclass", "test", true ) );
         //        ctx.modifyAttributes(
         //                "uid=mockProfile0,ou=profiles,appName=mockApplication,ou=applications,dc=example",
         //                DirContext.REMOVE_ATTRIBUTE,
-        //                new BasicAttributes( "objectclass", "test" ) );
+        //                new BasicAttributes( "objectclass", "test", true ) );
     }
 
 
@@ -464,10 +469,10 @@
         ctx.modifyAttributes( "uid=akarasulu, ou=Users, dc=example,dc=com",
             new ModificationItem[]
                 { new ModificationItem( DirContext.ADD_ATTRIBUTE, new BasicAttribute( "telephonenumber",
-                    "+1 904 982 6888" ) ) } );
+                    "+1 904 982 6888", true ) ) } );
         ctx.modifyAttributes( "uid=akarasulu, ou=Users, dc=example,dc=com", new ModificationItem[]
             { new ModificationItem( DirContext.REMOVE_ATTRIBUTE, new BasicAttribute( "telephonenumber",
-                "+1 904 982 6888" ) ) } );
+                "+1 904 982 6888", true ) ) } );
 
         // Test modifications on permissions
         //        ctx.modifyAttributes(

Modified: directory/triplesec/trunk/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/GenerateHotp.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/GenerateHotp.java?view=diff&rev=498894&r1=498893&r2=498894
==============================================================================
--- directory/triplesec/trunk/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/GenerateHotp.java
(original)
+++ directory/triplesec/trunk/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/GenerateHotp.java
Mon Jan 22 18:23:04 2007
@@ -21,6 +21,7 @@
 
 
 import java.io.File;
+import java.io.Serializable;
 import java.util.*;
 
 import javax.security.auth.kerberos.KerberosPrincipal;
@@ -73,7 +74,7 @@
             MutablePartitionConfiguration partConfig = new MutablePartitionConfiguration();
             partConfig.setName( "example" );
 
-            HashSet indices = new HashSet();
+            HashSet<String> indices = new HashSet<String>();
             indices.add( "dc" );
             indices.add( "ou" );
             indices.add( "objectClass" );
@@ -91,7 +92,7 @@
             attrs.put( "dc", "example" );
             partConfig.setContextEntry( attrs );
 
-            Set schemas = new HashSet();
+            Set<AbstractBootstrapSchema> schemas = new HashSet<AbstractBootstrapSchema>();
             schemas.add( new SystemSchema() );
             schemas.add( new SafehausSchema() );
             schemas.add( new ApacheSchema() );
@@ -104,7 +105,7 @@
 
             partConfig.setSuffix( "dc=example,dc=com" );
 
-            Hashtable env = new Hashtable();
+            Hashtable<String, Serializable> env = new Hashtable<String, Serializable>();
             env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory"
);
             env.put( Context.PROVIDER_URL, "dc=example,dc=com" );
             env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
@@ -130,7 +131,7 @@
             ServerProfileStore store = new DefaultServerProfileStore( userContext );
             store.init();
 
-            List filters = Collections.singletonList( new Krb5KdcEntryFilter() );
+            List<Krb5KdcEntryFilter> filters = Collections.singletonList( new Krb5KdcEntryFilter()
);
             LdifFileLoader loader = new LdifFileLoader( userContext, new File( "safehaus.ldif"
), filters,
                     GenerateHotp.class.getClassLoader() );
             loader.execute();

Modified: directory/triplesec/trunk/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/HotpSamVerifierITest.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/HotpSamVerifierITest.java?view=diff&rev=498894&r1=498893&r2=498894
==============================================================================
--- directory/triplesec/trunk/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/HotpSamVerifierITest.java
(original)
+++ directory/triplesec/trunk/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/HotpSamVerifierITest.java
Mon Jan 22 18:23:04 2007
@@ -22,14 +22,15 @@
 
 import java.io.IOException;
 import java.io.File;
+import java.io.Serializable;
 import java.util.*;
 
 import javax.naming.NamingException;
 import javax.naming.Context;
+import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InitialDirContext;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttributes;
 import javax.security.auth.kerberos.KerberosKey;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
@@ -55,6 +56,7 @@
 import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
 import org.apache.directory.server.core.configuration.MutableStartupConfiguration;
 import org.apache.directory.server.core.configuration.ShutdownConfiguration;
+import org.apache.directory.server.core.schema.bootstrap.AbstractBootstrapSchema;
 import org.apache.directory.server.core.schema.bootstrap.ApacheSchema;
 import org.apache.directory.server.core.schema.bootstrap.CoreSchema;
 import org.apache.directory.server.core.schema.bootstrap.CosineSchema;
@@ -108,7 +110,7 @@
         MutablePartitionConfiguration partConfig = new MutablePartitionConfiguration();
         partConfig.setName( "example" );
 
-        HashSet indices = new HashSet();
+        HashSet<String> indices = new HashSet<String>();
         indices.add( "dc" );
         indices.add( "ou" );
         indices.add( "objectClass" );
@@ -126,7 +128,7 @@
         attrs.put( "dc", "example" );
         partConfig.setContextEntry( attrs );
 
-        Set schemas = new HashSet();
+        Set<AbstractBootstrapSchema> schemas = new HashSet<AbstractBootstrapSchema>();
         schemas.add( new SystemSchema() );
         schemas.add( new SafehausSchema() );
         schemas.add( new ApacheSchema() );
@@ -137,7 +139,7 @@
         config.setBootstrapSchemas( schemas );
         config.setContextPartitionConfigurations( Collections.singleton( partConfig ) );
 
-        Hashtable env = new Hashtable();
+        Hashtable<String, Serializable> env = new Hashtable<String, Serializable>();
         env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory"
);
         env.put( Context.PROVIDER_URL, "dc=example,dc=com" );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
@@ -157,13 +159,13 @@
             Attributes users = new BasicAttributes( "objectClass", "top", true );
             users.get( "objectClass" ).add( "organizationalUnit" );
             attrs.put( "ou", "users" );
-            userContext = userContext.createSubcontext( "ou=users", attrs );
+            userContext = userContext.createSubcontext( "ou=users", users );
         }
 
         store = new DefaultServerProfileStore( userContext );
         store.init();
 
-        List filters = Collections.singletonList( new Krb5KdcEntryFilter() );
+        List<Krb5KdcEntryFilter> filters = Collections.singletonList( new Krb5KdcEntryFilter()
);
         LdifFileLoader loader = new LdifFileLoader( userContext, new File( "safehaus.ldif"
), filters, getClass().getClassLoader() );
         loader.execute();
     }
@@ -173,7 +175,7 @@
     {
         userContext.close();
         ShutdownConfiguration config = new ShutdownConfiguration();
-        Hashtable env = new Hashtable();
+        Hashtable<String, Serializable> env = new Hashtable<String, Serializable>();
         env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory"
);
         env.put( Context.PROVIDER_URL, "dc=example,dc=com" );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );



Mime
View raw message