Changeset: 11c44e2cc988 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=11c44e2cc988 Modified Files: java/tests/Test_PSsomeamount.java java/tests/build.xml sql/jdbc/tests/Tests/All sql/jdbc/tests/Tests/Test_PSlargeamount.SQL.bat sql/jdbc/tests/Tests/Test_PSlargeamount.SQL.sh sql/jdbc/tests/Tests/Test_PSlargeamount.stable.err sql/jdbc/tests/Tests/Test_PSlargeamount.stable.out sql/jdbc/tests/Tests/Test_PSlargeamount.timeout sql/jdbc/tests/Tests/Test_PSsomeamount.SQL.bat sql/jdbc/tests/Tests/Test_PSsomeamount.SQL.sh sql/jdbc/tests/Tests/Test_PSsomeamount.stable.err sql/jdbc/tests/Tests/Test_PSsomeamount.stable.out sql/jdbc/tests/Tests/Test_PSsomeamount.timeout Branch: Dec2011 Log Message:
Test_PSlargeamount: introduce little brother Test_PSsomeamount largeamount (100000) just takes too much resources to be acceptable. someamount (10000) takes a lot less, while still sort of stressing the server in the same way, as intended by the test. diffs (112 lines): diff --git a/java/tests/Test_PSsomeamount.java b/java/tests/Test_PSsomeamount.java new file mode 100644 --- /dev/null +++ b/java/tests/Test_PSsomeamount.java @@ -0,0 +1,56 @@ +/* + * The contents of this file are subject to the MonetDB Public License + * Version 1.1 (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.monetdb.org/Legal/MonetDBLicense + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * + * The Original Code is the MonetDB Database System. + * + * The Initial Developer of the Original Code is CWI. + * Portions created by CWI are Copyright (C) 1997-July 2008 CWI. + * Copyright August 2008-2012 MonetDB B.V. + * All Rights Reserved. + */ + +import java.sql.*; +import java.util.*; + +/* Create a lot of PreparedStatements, to emulate webloads such as those + * from Hibernate. */ + +public class Test_PSsomeamount { + public static void main(String[] args) throws Exception { + Class.forName("nl.cwi.monetdb.jdbc.MonetDriver"); + Connection con = DriverManager.getConnection(args[0]); + Statement stmt = con.createStatement(); + PreparedStatement pstmt; + + // >> true: auto commit should be on + System.out.println("0. true\t" + con.getAutoCommit()); + + try { + System.out.println("1. Preparing and executing a unique statement"); + for (int i = 0; i < 10000; i++) { + pstmt = con.prepareStatement("select " + i + ", " + i + " = ?"); + pstmt.setInt(1, i); + ResultSet rs = pstmt.executeQuery(); + if (rs.next() && i % 1000 == 0) { + System.out.println(rs.getInt(1) + ", " + rs.getBoolean(2)); + } + /* this call should cause resources on the server to be + * freed */ + pstmt.close(); + } + } catch (SQLException e) { + System.out.println("FAILED :( "+ e.getMessage()); + System.out.println("ABORTING TEST!!!"); + } + + con.close(); + } +} diff --git a/java/tests/build.xml b/java/tests/build.xml --- a/java/tests/build.xml +++ b/java/tests/build.xml @@ -112,6 +112,7 @@ All Rights Reserved. <antcall target="Test_PSgeneratedkeys" /> <antcall target="Test_PSlargeresponse" /> <antcall target="Test_PSlargeamount" /> + <antcall target="Test_PSsomeamount" /> <antcall target="Test_PSlargebatchval" /> <antcall target="Test_PStimedate" /> <antcall target="Test_PStimezone" /> @@ -219,6 +220,12 @@ All Rights Reserved. </antcall> </target> + <target name="Test_PSsomeamount"> + <antcall target="test_class"> + <param name="test.class" value="Test_PSsomeamount" /> + </antcall> + </target> + <target name="Test_PSlargebatchval"> <antcall target="test_class"> <param name="test.class" value="Test_PSlargebatchval" /> diff --git a/sql/jdbc/tests/Tests/All b/sql/jdbc/tests/Tests/All --- a/sql/jdbc/tests/Tests/All +++ b/sql/jdbc/tests/Tests/All @@ -6,7 +6,7 @@ HAVE_JDBCTESTS?Test_Csavepoints HAVE_JDBCTESTS?Test_Ctransaction HAVE_JDBCTESTS?Test_Dobjects HAVE_JDBCTESTS?Test_PSgeneratedkeys -HAVE_JDBCTESTS?Test_PSlargeamount +HAVE_JDBCTESTS?Test_PSsomeamount HAVE_JDBCTESTS?Test_PSlargebatchval HAVE_JDBCTESTS?Test_PStimedate HAVE_JDBCTESTS?Test_PStimezone diff --git a/sql/jdbc/tests/Tests/Test_PSlargeamount.SQL.bat b/sql/jdbc/tests/Tests/Test_PSsomeamount.SQL.bat rename from sql/jdbc/tests/Tests/Test_PSlargeamount.SQL.bat rename to sql/jdbc/tests/Tests/Test_PSsomeamount.SQL.bat diff --git a/sql/jdbc/tests/Tests/Test_PSlargeamount.SQL.sh b/sql/jdbc/tests/Tests/Test_PSsomeamount.SQL.sh rename from sql/jdbc/tests/Tests/Test_PSlargeamount.SQL.sh rename to sql/jdbc/tests/Tests/Test_PSsomeamount.SQL.sh diff --git a/sql/jdbc/tests/Tests/Test_PSlargeamount.stable.err b/sql/jdbc/tests/Tests/Test_PSsomeamount.stable.err rename from sql/jdbc/tests/Tests/Test_PSlargeamount.stable.err rename to sql/jdbc/tests/Tests/Test_PSsomeamount.stable.err diff --git a/sql/jdbc/tests/Tests/Test_PSlargeamount.stable.out b/sql/jdbc/tests/Tests/Test_PSsomeamount.stable.out rename from sql/jdbc/tests/Tests/Test_PSlargeamount.stable.out rename to sql/jdbc/tests/Tests/Test_PSsomeamount.stable.out diff --git a/sql/jdbc/tests/Tests/Test_PSlargeamount.timeout b/sql/jdbc/tests/Tests/Test_PSsomeamount.timeout rename from sql/jdbc/tests/Tests/Test_PSlargeamount.timeout rename to sql/jdbc/tests/Tests/Test_PSsomeamount.timeout _______________________________________________ Checkin-list mailing list [email protected] http://mail.monetdb.org/mailman/listinfo/checkin-list
