Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 10620 invoked from network); 5 Jun 2010 09:58:17 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Jun 2010 09:58:17 -0000 Received: (qmail 101 invoked by uid 500); 5 Jun 2010 09:58:16 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 99946 invoked by uid 500); 5 Jun 2010 09:58:15 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 99939 invoked by uid 99); 5 Jun 2010 09:58:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Jun 2010 09:58:15 +0000 X-ASF-Spam-Status: No, hits=-1515.0 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Jun 2010 09:58:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A0C0A23889E7; Sat, 5 Jun 2010 09:57:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100605095754.A0C0A23889E7@eris.apache.org> 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 Apache Directory Project + * @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(); + } +}