db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r469588 - in /db/derby/code/trunk: java/testing/ java/testing/org/apache/derbyTesting/perf/ java/testing/org/apache/derbyTesting/perf/basic/ java/testing/org/apache/derbyTesting/perf/basic/jdbc/ tools/ant/properties/
Date Tue, 31 Oct 2006 18:05:31 GMT
Author: djd
Date: Tue Oct 31 10:05:31 2006
New Revision: 469588

URL: http://svn.apache.org/viewvc?view=rev&rev=469588
Log:
DERBY-1970 Add initial performance test that uses the new JDBCPerfTestCase class.
Contributed by Sunitha Kambhampati ksunithaghm@gmail.com

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/_Suite.java   (with
props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/jdbc/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/jdbc/ValuesTest.java
  (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/build.xml   (with props)
Modified:
    db/derby/code/trunk/java/testing/build.xml
    db/derby/code/trunk/tools/ant/properties/dirs.properties

Modified: db/derby/code/trunk/java/testing/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/build.xml?view=diff&rev=469588&r1=469587&r2=469588
==============================================================================
--- db/derby/code/trunk/java/testing/build.xml (original)
+++ db/derby/code/trunk/java/testing/build.xml Tue Oct 31 10:05:31 2006
@@ -80,7 +80,8 @@
     <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/multi/stress"/>

     <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/master"/> 
     <ant dir="${derby.testing.src.dir}/${derby.testing.suites.dir}"/>
-    <ant dir="${derby.testing.src.dir}/${derby.testing.system.dir}/oe"/> 
+    <ant dir="${derby.testing.src.dir}/${derby.testing.system.dir}/oe"/>
+  	<ant dir="${derby.testing.src.dir}/${derby.testing.perf.dir}"/> 
   </target>
 
 <!--             ============= End Targets ==============                -->

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/_Suite.java?view=auto&rev=469588
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/_Suite.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/_Suite.java Tue Oct
31 10:05:31 2006
@@ -0,0 +1,47 @@
+/*
+
+Derby - Class org.apache.derbyTesting.perf.basic._Suite
+
+    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.derbyTesting.perf.basic;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.derbyTesting.junit.BaseTestCase;
+import org.apache.derbyTesting.perf.basic.jdbc.*;
+
+/**
+ * Basic Performance Suite
+ */
+public class _Suite extends BaseTestCase{
+    
+    public static Test suite()
+    {
+        TestSuite suite = new TestSuite("BasicPerf");
+        
+        suite.addTest(ValuesTest.suite());
+
+        return suite;
+    }
+    
+    public _Suite(String name) {
+        super(name);
+    }
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/_Suite.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/jdbc/ValuesTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/jdbc/ValuesTest.java?view=auto&rev=469588
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/jdbc/ValuesTest.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/jdbc/ValuesTest.java
Tue Oct 31 10:05:31 2006
@@ -0,0 +1,141 @@
+/*
+ *
+ * Derby - Class ValuesTest
+ *
+ * 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.derbyTesting.perf.basic.jdbc;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.PreparedStatement;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.derbyTesting.junit.TestConfiguration;
+import org.apache.derbyTesting.junit.JDBCPerfTestCase;
+
+/**
+ * Add performance tests that use VALUES statement 
+ */
+public class ValuesTest extends JDBCPerfTestCase{
+    
+    private PreparedStatement ps;
+    
+    /**
+     * @return Tests that should be run as part of this class.
+     */
+    public static Test suite()
+    {
+        int iterations = 100000;
+        int repeats = 4;
+        
+        TestSuite suite = new TestSuite("ValuesTest");
+        
+        // To add embed tests.
+        suite.addTest(new ValuesTest("fetchByColumnName",iterations,repeats));
+        suite.addTest(new ValuesTest("fetchByColumnNumber",iterations,repeats));
+        
+        // To add client tests.
+        TestSuite client = new TestSuite("Client_ValuesTest");
+        client.addTest(new ValuesTest("fetchByColumnName",iterations,repeats));
+        client.addTest(new ValuesTest("fetchByColumnNumber",iterations,repeats));
+        suite.addTest(TestConfiguration.clientServerDecorator(client));
+        
+        return suite;   
+    }
+    
+    
+    public ValuesTest(String name,int iterations,int repeats) {
+        super(name,iterations,repeats);
+    }
+    
+    public ValuesTest(String name)
+    {
+        super(name);
+    }
+    
+    /**
+     * Setup for the tests that query the simple VALUES statement.
+     * Open a connection to the database, and prepare the query here
+     */
+    public void setUp() throws SQLException
+    {
+        println("Setup()::ValuesTest");
+        ps = openDefaultConnection().prepareStatement(
+                "SELECT * FROM TABLE(VALUES (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5))
AS"+
+                " T(\"cOlumN1\", COLUMN2, \"column3\")",
+                ResultSet.TYPE_FORWARD_ONLY,
+                ResultSet.CONCUR_READ_ONLY,
+                ResultSet.CLOSE_CURSORS_AT_COMMIT);
+        
+    }
+    
+    /**
+     * Query is a simple VALUES statement.
+     * <P>
+     * "SELECT * FROM TABLE(VALUES (1,1,1), (2,2,2), (3,3,3), (4,4,4),
+     * (5,5,5)) AS T(\"cOlumN1\", COLUMN2, \"column3\")",
+     * ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, 
+     * ResultSet.CLOSE_CURSORS_AT_COMMIT);
+     * <P>
+     * This test fetches data using column name
+     */
+    public void fetchByColumnName()
+    throws SQLException
+    {
+        ResultSet rs = ps.executeQuery();
+        while (rs.next()) {
+            rs.getInt("column1");
+            rs.getInt("COLUMN2");
+            rs.getInt("column3");
+        }
+        rs.close();    
+    }
+    
+    /**
+     * Query is a simple VALUES statement.
+     * <P>
+     * "SELECT * FROM TABLE(VALUES (1,1,1), (2,2,2), (3,3,3), (4,4,4), 
+     * (5,5,5)) AS T(\"cOlumN1\", COLUMN2, \"column3\")",
+     * ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, 
+     * ResultSet.CLOSE_CURSORS_AT_COMMIT);
+     * <P>
+     * This test fetches data using column number
+     */
+    public void fetchByColumnNumber()
+    throws SQLException
+    {
+        ResultSet rs = ps.executeQuery();
+        while (rs.next()) {
+            rs.getInt(1);
+            rs.getInt(2);
+            rs.getInt(3);
+        }
+        rs.close();    
+    }
+    
+    /**
+     * cleanup resources
+     */
+    public void tearDown() throws Exception
+    {
+        println("ValuesTest::tearDown");
+        ps.close();
+        ps = null;
+        super.tearDown();
+    }
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/basic/jdbc/ValuesTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/build.xml?view=auto&rev=469588
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/build.xml (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/build.xml Tue Oct 31 10:05:31
2006
@@ -0,0 +1,103 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+
+<!-- ==================================================================== -->
+<!--                         Derby build file                             -->
+<!-- ==================================================================== -->
+
+<project default="perfcomponents" basedir="../../../../../..">
+
+<!-- ==================================================================== -->
+<!--                           Set properties                             -->
+<!-- ==================================================================== -->
+
+  <property name="properties.dir" value="tools/ant/properties"/>
+
+  <!-- User settings -->
+  <property file="${user.home}/ant.properties"/>
+
+  <!-- Significant dirs -->
+  <property file="${properties.dir}/dirs.properties"/>
+  <property file="${properties.dir}/derbytesting.properties"/>
+
+  <!-- Compiler settings -->
+  <property file="${properties.dir}/defaultcompiler.properties"/>
+  <property file="${properties.dir}/${build.compiler}.properties"/>
+
+  <!-- Parser properties -->
+  <property file="${properties.dir}/parser.properties"/>
+
+  <!-- Compile-time classpath properties files -->
+  <property file="${properties.dir}/extrapath.properties"/>
+  <property file="${properties.dir}/compilepath.properties"/>
+  <property file="${user.home}/properties/derbytesting.properties"/>
+  <property file="${ant.home}/properties/derbytesting.properties"/>
+
+  <!-- Release and Version info -->
+  <property file="${properties.dir}/release.properties"/>
+
+<!--             ============ Begin Targets ==============                -->
+ 
+  <target name="perfcomponents" 
+          description="Build Derby Performance test components">
+    <javac
+      source="1.4"
+      target="1.4"
+      bootclasspath="${empty}"
+      nowarn="on"
+      debug="${debug}"
+      depend="${depend}"
+      deprecation="${deprecation}"
+      optimize="${optimize}"
+      proceed="${proceed}"
+      verbose="${verbose}" 
+      srcdir="${derby.testing.src.dir}"
+      destdir="${out.dir}">
+      <classpath>
+        <pathelement path="${java14compile.classpath}"/>
+        <pathelement path="${junit}"/>
+      </classpath>
+      <include name="${derby.testing.perf.dir}/basic/jdbc/ValuesTest.java"/>
+    </javac>
+    <javac
+      source="1.3"
+      target="1.3"
+      bootclasspath="${empty}"
+      nowarn="on"
+      debug="${debug}"
+      depend="${depend}"
+      deprecation="${deprecation}"
+      optimize="${optimize}"
+      proceed="${proceed}"
+      verbose="${verbose}" 
+      srcdir="${derby.testing.src.dir}"
+      destdir="${out.dir}">
+      <classpath>
+        <pathelement path="${compile.classpath}"/>
+        <pathelement path="${junit}"/>
+      </classpath>
+      <exclude name="${derby.testing.perf.dir}/basic/jdbc/ValuesTest.java"/>
+      <include name="${derby.testing.perf.dir}/**/*.java"/>
+    </javac>
+  </target>
+
+<!--             ============= End Targets ==============                -->
+
+<!--             ============= End Project ==============                -->
+
+</project>

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/tools/ant/properties/dirs.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/ant/properties/dirs.properties?view=diff&rev=469588&r1=469587&r2=469588
==============================================================================
--- db/derby/code/trunk/tools/ant/properties/dirs.properties (original)
+++ db/derby/code/trunk/tools/ant/properties/dirs.properties Tue Oct 31 10:05:31 2006
@@ -61,5 +61,6 @@
 derby.testing.functest.dir=${derby.testing.dir}/functionTests
 derby.testing.unittest.dir=${derby.testing.dir}/unitTests
 derby.testing.junit.dir=${derby.testing.dir}/junit
+derby.testing.perf.dir=${derby.testing.dir}/perf
 derby.testing.suites.dir=${derby.testing.functest.dir}/suites
 derby.testing.system.dir=${derby.testing.dir}/system



Mime
View raw message