Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 8513 invoked from network); 3 Aug 2010 13:27:29 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 Aug 2010 13:27:29 -0000 Received: (qmail 72572 invoked by uid 500); 3 Aug 2010 13:27:29 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 72479 invoked by uid 500); 3 Aug 2010 13:27:27 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 72472 invoked by uid 99); 3 Aug 2010 13:27:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Aug 2010 13:27:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED 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; Tue, 03 Aug 2010 13:27:22 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6760023889ED; Tue, 3 Aug 2010 13:26:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r981864 - in /jackrabbit/trunk/jackrabbit-core/src/test/performance: ./ base/ base/src/ base/src/main/ base/src/main/java/ base/src/main/java/org/ base/src/main/java/org/apache/ base/src/main/java/org/apache/jackrabbit/ base/src/main/java/o... Date: Tue, 03 Aug 2010 13:26:04 -0000 To: commits@jackrabbit.apache.org From: jukka@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100803132604.6760023889ED@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jukka Date: Tue Aug 3 13:26:03 2010 New Revision: 981864 URL: http://svn.apache.org/viewvc?rev=981864&view=rev Log: JCR-2695: Jackrabbit performance test suite Basic test suite structure. Work in progress... Added: jackrabbit/trunk/jackrabbit-core/src/test/performance/ jackrabbit/trunk/jackrabbit-core/src/test/performance/base/ jackrabbit/trunk/jackrabbit-core/src/test/performance/base/pom.xml (with props) jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/ jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/ jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/java/ jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/java/org/ jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/java/org/apache/ jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/java/org/apache/jackrabbit/ jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java (with props) jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/resources/ jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/resources/log4j.properties (with props) jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/ jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/pom.xml (with props) jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/src/ jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/src/test/ jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/src/test/java/ jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/src/test/java/org/ jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/src/test/java/org/apache/ jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/src/test/java/org/apache/jackrabbit/ jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/src/test/java/org/apache/jackrabbit/performance/ jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/src/test/java/org/apache/jackrabbit/performance/PerformanceTest.java (with props) jackrabbit/trunk/jackrabbit-core/src/test/performance/pom.xml (with props) Added: jackrabbit/trunk/jackrabbit-core/src/test/performance/base/pom.xml URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/performance/base/pom.xml?rev=981864&view=auto ============================================================================== --- jackrabbit/trunk/jackrabbit-core/src/test/performance/base/pom.xml (added) +++ jackrabbit/trunk/jackrabbit-core/src/test/performance/base/pom.xml Tue Aug 3 13:26:03 2010 @@ -0,0 +1,63 @@ + + + + + + 4.0.0 + + + org.apache.jackrabbit + jackrabbit-perf-parent + SNAPSHOT + ../parent/pom.xml + + + jackrabbit-perf-base + SNAPSHOT + Jackrabbit Performance Test Utilities + + + + javax.jcr + jcr + 1.0 + + + org.apache.jackrabbit + jackrabbit-core + 1.4 + provided + + + commons-io + commons-io + 1.4 + + + org.testng + testng + jdk15 + 5.8 + + + + + Propchange: jackrabbit/trunk/jackrabbit-core/src/test/performance/base/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java?rev=981864&view=auto ============================================================================== --- jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java (added) +++ jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java Tue Aug 3 13:26:03 2010 @@ -0,0 +1,112 @@ +/* + * 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.jackrabbit.performance; + +import static org.testng.AssertJUnit.fail; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Random; + +import javax.jcr.Node; +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import javax.jcr.SimpleCredentials; +import javax.jcr.version.Version; +import javax.jcr.version.VersionHistory; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.apache.jackrabbit.api.JackrabbitNodeTypeManager; +import org.apache.jackrabbit.core.RepositoryImpl; +import org.apache.jackrabbit.core.config.RepositoryConfig; + +public abstract class AbstractPerformanceTest { + + protected void createRepositories(String name) throws Exception { + // Create a repository using the Jackrabbit default configuration + createRepository( + name, + RepositoryImpl.class.getResourceAsStream("repository.xml")); + + // Create repositories for any special configurations included + File directory = new File(new File("src", "test"), "resources"); + File[] files = directory.listFiles(); + if (files != null) { + Arrays.sort(files); + for (File file : files) { + String xml = file.getName(); + if (file.isFile() && xml.endsWith(".xml")) { + createRepository( + name + "-" + xml.substring(0, xml.length() - 4), + FileUtils.openInputStream(file)); + } + } + } + } + + /** + * Creates a named test repository with the given configuration file. + * + * @param name name of the repository + * @param xml input stream for reading the repository configuration + * @throws Exception if the repository could not be created + */ + protected void createRepository(String name, InputStream xml) + throws Exception { + File directory = new File(new File("target", "repository"), name); + File configuration = new File(directory, "repository.xml"); + + // Copy the configuration file into the repository directory + try { + OutputStream output = FileUtils.openOutputStream(configuration); + try { + IOUtils.copy(xml, output); + } finally { + output.close(); + } + } finally { + xml.close(); + } + + // Create the repository + try { + RepositoryConfig config = RepositoryConfig.create( + configuration.getPath(), directory.getPath()); + RepositoryImpl repository = RepositoryImpl.create(config); + try { + Session session = repository.login( + new SimpleCredentials("admin", "admin".toCharArray())); + try { + createTestData(session); + } finally { + session.logout(); + } + } finally { + repository.shutdown(); + } + } catch (RepositoryException e) { + e.printStackTrace(); + fail("Create repository " + name); + } + } + +} Propchange: jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractPerformanceTest.java ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/resources/log4j.properties URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/resources/log4j.properties?rev=981864&view=auto ============================================================================== --- jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/resources/log4j.properties (added) +++ jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/resources/log4j.properties Tue Aug 3 13:26:03 2010 @@ -0,0 +1,21 @@ +# 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. + +log4j.rootLogger=INFO, file +log4j.appender.file=org.apache.log4j.FileAppender +log4j.appender.file.File=target/jcr.log +log4j.appender.file.layout=org.apache.log4j.PatternLayout +log4j.appender.file.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L)\n + Propchange: jackrabbit/trunk/jackrabbit-core/src/test/performance/base/src/main/resources/log4j.properties ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/pom.xml URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/pom.xml?rev=981864&view=auto ============================================================================== --- jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/pom.xml (added) +++ jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/pom.xml Tue Aug 3 13:26:03 2010 @@ -0,0 +1,58 @@ + + + + + + 4.0.0 + + + org.apache.jackrabbit + jackrabbit-perf-parent + SNAPSHOT + ../parent/pom.xml + + + jackrabbit-perf-jackrabbit10 + Jackrabbit 1.0 Performance Test + + + + org.apache.jackrabbit + jackrabbit-perf-base + ${project.version} + test + + + org.apache.jackrabbit + jackrabbit-core + 1.0 + test + + + jsr170 + jcr + + + + + + + Propchange: jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/src/test/java/org/apache/jackrabbit/performance/PerformanceTest.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/src/test/java/org/apache/jackrabbit/performance/PerformanceTest.java?rev=981864&view=auto ============================================================================== --- jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/src/test/java/org/apache/jackrabbit/performance/PerformanceTest.java (added) +++ jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/src/test/java/org/apache/jackrabbit/performance/PerformanceTest.java Tue Aug 3 13:26:03 2010 @@ -0,0 +1,21 @@ +/* + * 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.jackrabbit.performance; + +public class PerformanceTest extends AbstractPerformanceTest { + +} Propchange: jackrabbit/trunk/jackrabbit-core/src/test/performance/jackrabbit10/src/test/java/org/apache/jackrabbit/performance/PerformanceTest.java ------------------------------------------------------------------------------ svn:eol-style = native Added: jackrabbit/trunk/jackrabbit-core/src/test/performance/pom.xml URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/performance/pom.xml?rev=981864&view=auto ============================================================================== --- jackrabbit/trunk/jackrabbit-core/src/test/performance/pom.xml (added) +++ jackrabbit/trunk/jackrabbit-core/src/test/performance/pom.xml Tue Aug 3 13:26:03 2010 @@ -0,0 +1,47 @@ + + + + + + 4.0.0 + + + + + + + org.apache.jackrabbit + jackrabbit-perf-parent + SNAPSHOT + parent/pom.xml + + + jackrabbit-perf + Jackrabbit Performance Tests + pom + + + parent + base + jackrabbit21 + + + Propchange: jackrabbit/trunk/jackrabbit-core/src/test/performance/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native