directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r951688 - in /directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/getRootDse: ./ GetRootDsePerfIT.java
Date Sat, 05 Jun 2010 09:57:54 GMT
Author: elecharny
Date: Sat Jun  5 09:57:54 2010
New Revision: 951688

URL: http://svn.apache.org/viewvc?rev=951688&view=rev
Log:
Added a perf test for the getRootDSE operation

Added:
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/getRootDse/
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/getRootDse/GetRootDsePerfIT.java

Added: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/getRootDse/GetRootDsePerfIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/getRootDse/GetRootDsePerfIT.java?rev=951688&view=auto
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/getRootDse/GetRootDsePerfIT.java
(added)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/getRootDse/GetRootDsePerfIT.java
Sat Jun  5 09:57:54 2010
@@ -0,0 +1,73 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.directory.server.core.operations.getRootDse;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.directory.ldap.client.api.LdapConnection;
+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.server.core.interceptor.context.GetRootDSEOperationContext;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+/**
+ * Test the GetRootDSE operation
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+@RunWith ( FrameworkRunner.class )
+public class GetRootDsePerfIT extends AbstractLdapTestUnit
+{
+    /**
+     * A GetRootDSE performance test
+     */
+    @Test
+    public void testPerfGetRootDSE() throws Exception
+    {
+        LdapConnection connection = IntegrationUtils.getAdminConnection( service );
+
+        GetRootDSEOperationContext opContext = new GetRootDSEOperationContext( service.getAdminSession()
);
+        Entry rootDSE = service.getOperationManager().getRootDSE( opContext );
+
+        assertNotNull( rootDSE );
+        
+        long t0 = System.currentTimeMillis();
+        
+        for ( int i = 0; i < 100; i++ )
+        {
+            for ( int j = 0; j < 5000; j++ )
+            {
+                rootDSE = service.getOperationManager().getRootDSE( opContext );
+            }
+            
+            System.out.print( "." );
+        }
+        
+        long t1 = System.currentTimeMillis();
+        
+        System.out.println( "Delta : " + ( t1 - t0 ) );
+        connection.close();
+    }
+}



Mime
View raw message