Author: pmouawad
Date: Sun Sep 17 20:47:27 2017
New Revision: 1808653

URL: http://svn.apache.org/viewvc?rev=1808653&view=rev
Log:
Increase test coverage of JDBC Request and Configuration

Added:
    jmeter/trunk/bin/testfiles/JDBC_TESTS.csv
    jmeter/trunk/bin/testfiles/JDBC_TESTS.jmx   (with props)
    jmeter/trunk/bin/testfiles/JDBC_TESTS.xml   (with props)
Modified:
    jmeter/trunk/build.properties
    jmeter/trunk/build.xml
    jmeter/trunk/test/src/org/apache/jmeter/JMeterVersionTest.java

Added: jmeter/trunk/bin/testfiles/JDBC_TESTS.csv
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/bin/testfiles/JDBC_TESTS.csv?rev=1808653&view=auto
==============================================================================
--- jmeter/trunk/bin/testfiles/JDBC_TESTS.csv (added)
+++ jmeter/trunk/bin/testfiles/JDBC_TESTS.csv Sun Sep 17 20:47:27 2017
@@ -0,0 +1,12 @@
+label,responseCode,responseMessage,threadName,dataType,success,grpThreads,allThreads,SampleCount,ErrorCount
+JDBC_DROP_TABLE,42501 -5501,java.sql.SQLSyntaxErrorException: user lacks 
privilege or object not found: USERS in statement [drop table USERS],setUp 
Thread Group 1-1,text,true,1,1,1,0
+JDBC_CREATE_TABLE,200,OK,setUp Thread Group 1-1,text,true,1,1,1,0
+JDBC_INSERT,200,OK,Thread Group 1-1,text,true,1,1,1,0
+JDBC_SELECT,200,OK,Thread Group 1-1,text,true,1,1,1,0
+JDBC_SELECT_PREPARED,200,OK,Thread Group 1-1,text,true,1,1,1,0
+JDBC_COMMIT,200,OK,Thread Group 1-1,text,true,1,1,1,0
+JDBC_INSERT_VICTOR_HUGO,200,OK,Thread Group 1-1,text,true,1,1,1,0
+JDBC_CHECK_COUNT_2,200,OK,Thread Group 1-1,text,true,1,1,1,0
+JDBC_ROLLBACK,200,OK,Thread Group 1-1,text,true,1,1,1,0
+JDBC_CHECK_COUNT_1,200,OK,Thread Group 1-1,text,true,1,1,1,0
+CheckTransaction,200,"Number of samples in transaction : 4, number of failing 
samples : 0",Thread Group 1-1,,true,1,1,1,0

Added: jmeter/trunk/bin/testfiles/JDBC_TESTS.jmx
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/bin/testfiles/JDBC_TESTS.jmx?rev=1808653&view=auto
==============================================================================
--- jmeter/trunk/bin/testfiles/JDBC_TESTS.jmx (added)
+++ jmeter/trunk/bin/testfiles/JDBC_TESTS.jmx Sun Sep 17 20:47:27 2017
@@ -0,0 +1,524 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jmeterTestPlan version="1.2" properties="3.2" jmeter="3.3-SNAPSHOT.20170917">
+  <hashTree>
+    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" 
enabled="true">
+      <stringProp name="TestPlan.comments"></stringProp>
+      <boolProp name="TestPlan.functional_mode">false</boolProp>
+      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
+      <elementProp name="TestPlan.user_defined_variables" 
elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" 
testname="User Defined Variables" enabled="true">
+        <collectionProp name="Arguments.arguments"/>
+      </elementProp>
+      <stringProp 
name="TestPlan.user_define_classpath">../lib/opt/hsqldb-2.4.0.jar</stringProp>
+    </TestPlan>
+    <hashTree>
+      <JDBCDataSource guiclass="TestBeanGUI" testclass="JDBCDataSource" 
testname="JDBC Connection Configuration" enabled="true">
+        <boolProp name="autocommit">false</boolProp>
+        <stringProp name="checkQuery"></stringProp>
+        <stringProp name="connectionAge">5000</stringProp>
+        <stringProp name="dataSource">dbConfig</stringProp>
+        <stringProp name="dbUrl">jdbc:hsqldb:mem:mymemdb</stringProp>
+        <stringProp name="driver">org.hsqldb.jdbc.JDBCDriver</stringProp>
+        <boolProp name="keepAlive">true</boolProp>
+        <stringProp name="password"></stringProp>
+        <stringProp name="poolMax">1</stringProp>
+        <stringProp name="timeout">10000</stringProp>
+        <stringProp name="transactionIsolation">DEFAULT</stringProp>
+        <stringProp name="trimInterval">60000</stringProp>
+        <stringProp name="username">SA</stringProp>
+      </JDBCDataSource>
+      <hashTree/>
+      <SetupThreadGroup guiclass="SetupThreadGroupGui" 
testclass="SetupThreadGroup" testname="setUp Thread Group" enabled="true">
+        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
+        <elementProp name="ThreadGroup.main_controller" 
elementType="LoopController" guiclass="LoopControlPanel" 
testclass="LoopController" testname="Loop Controller" enabled="true">
+          <boolProp name="LoopController.continue_forever">false</boolProp>
+          <stringProp name="LoopController.loops">1</stringProp>
+        </elementProp>
+        <stringProp name="ThreadGroup.num_threads">1</stringProp>
+        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
+        <longProp name="ThreadGroup.start_time">1505666719000</longProp>
+        <longProp name="ThreadGroup.end_time">1505666719000</longProp>
+        <boolProp name="ThreadGroup.scheduler">false</boolProp>
+        <stringProp name="ThreadGroup.duration"></stringProp>
+        <stringProp name="ThreadGroup.delay"></stringProp>
+      </SetupThreadGroup>
+      <hashTree>
+        <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" 
testname="JDBC_DROP_TABLE" enabled="true">
+          <stringProp name="dataSource">dbConfig</stringProp>
+          <stringProp name="query">drop table USERS;
+</stringProp>
+          <stringProp name="queryArguments"></stringProp>
+          <stringProp name="queryArgumentsTypes"></stringProp>
+          <stringProp name="queryTimeout"></stringProp>
+          <stringProp name="queryType">Update Statement</stringProp>
+          <stringProp name="resultSetHandler">Store as String</stringProp>
+          <stringProp name="resultVariable"></stringProp>
+          <stringProp name="variableNames"></stringProp>
+        </JDBCSampler>
+        <hashTree>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="RA_IgnoreError" enabled="true">
+            <collectionProp name="Asserion.test_strings"/>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">true</boolProp>
+            <intProp name="Assertion.test_type">16</intProp>
+          </ResponseAssertion>
+          <hashTree/>
+        </hashTree>
+        <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" 
testname="JDBC_CREATE_TABLE" enabled="true">
+          <stringProp name="dataSource">dbConfig</stringProp>
+          <stringProp name="query">create table USERS (
+   id INT IDENTITY NOT NULL,
+   title VARCHAR(50) NOT NULL,
+   author VARCHAR(20) NOT NULL,
+   submission_date DATE,
+   PRIMARY KEY (id) 
+);</stringProp>
+          <stringProp name="queryArguments"></stringProp>
+          <stringProp name="queryArgumentsTypes"></stringProp>
+          <stringProp name="queryTimeout"></stringProp>
+          <stringProp name="queryType">Update Statement</stringProp>
+          <stringProp name="resultSetHandler">Store as String</stringProp>
+          <stringProp name="resultVariable"></stringProp>
+          <stringProp name="variableNames"></stringProp>
+        </JDBCSampler>
+        <hashTree>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="RA_IgnoreError" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp name="-1157542694">0 updates</stringProp>
+            </collectionProp>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">16</intProp>
+          </ResponseAssertion>
+          <hashTree/>
+        </hashTree>
+      </hashTree>
+      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" 
testname="Thread Group" enabled="true">
+        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
+        <elementProp name="ThreadGroup.main_controller" 
elementType="LoopController" guiclass="LoopControlPanel" 
testclass="LoopController" testname="Loop Controller" enabled="true">
+          <boolProp name="LoopController.continue_forever">false</boolProp>
+          <stringProp name="LoopController.loops">1</stringProp>
+        </elementProp>
+        <stringProp name="ThreadGroup.num_threads">1</stringProp>
+        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
+        <longProp name="ThreadGroup.start_time">1505666862000</longProp>
+        <longProp name="ThreadGroup.end_time">1505666862000</longProp>
+        <boolProp name="ThreadGroup.scheduler">false</boolProp>
+        <stringProp name="ThreadGroup.duration"></stringProp>
+        <stringProp name="ThreadGroup.delay"></stringProp>
+      </ThreadGroup>
+      <hashTree>
+        <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" 
testname="JDBC_INSERT" enabled="true">
+          <stringProp name="dataSource">dbConfig</stringProp>
+          <stringProp name="query">INSERT INTO USERS(title,author, 
submission_date) VALUES (&apos;Mr&apos;, &apos;Philip K. Dick&apos;, 
CURRENT_DATE)</stringProp>
+          <stringProp name="queryArguments"></stringProp>
+          <stringProp name="queryArgumentsTypes"></stringProp>
+          <stringProp name="queryTimeout"></stringProp>
+          <stringProp name="queryType">Update Statement</stringProp>
+          <stringProp name="resultSetHandler">Store as String</stringProp>
+          <stringProp name="resultVariable"></stringProp>
+          <stringProp name="variableNames"></stringProp>
+        </JDBCSampler>
+        <hashTree>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp name="1329970139">1 updates</stringProp>
+            </collectionProp>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">16</intProp>
+          </ResponseAssertion>
+          <hashTree/>
+        </hashTree>
+        <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" 
testname="JDBC_SELECT" enabled="true">
+          <stringProp name="dataSource">dbConfig</stringProp>
+          <stringProp name="query">select title,author,submission_date from 
USERS where id = 0</stringProp>
+          <stringProp name="queryArguments"></stringProp>
+          <stringProp name="queryArgumentsTypes"></stringProp>
+          <stringProp name="queryTimeout"></stringProp>
+          <stringProp name="queryType">Select Statement</stringProp>
+          <stringProp name="resultSetHandler">Store as String</stringProp>
+          <stringProp name="resultVariable">result</stringProp>
+          <stringProp 
name="variableNames">title,author,submission_date</stringProp>
+        </JDBCSampler>
+        <hashTree>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp name="2501">Mr</stringProp>
+            </collectionProp>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">8</intProp>
+            <stringProp name="Assertion.scope">variable</stringProp>
+            <stringProp name="Scope.variable">title_1</stringProp>
+          </ResponseAssertion>
+          <hashTree/>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp name="1324166668">Philip K. Dick</stringProp>
+            </collectionProp>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">8</intProp>
+            <stringProp name="Assertion.scope">variable</stringProp>
+            <stringProp name="Scope.variable">author_1</stringProp>
+          </ResponseAssertion>
+          <hashTree/>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp name="-253830980">${__time(yyyy-MM-dd,)}</stringProp>
+            </collectionProp>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">8</intProp>
+            <stringProp name="Assertion.scope">variable</stringProp>
+            <stringProp name="Scope.variable">submission_date_1</stringProp>
+          </ResponseAssertion>
+          <hashTree/>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp name="49">1</stringProp>
+            </collectionProp>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">8</intProp>
+            <stringProp name="Assertion.scope">variable</stringProp>
+            <stringProp name="Scope.variable">author_#</stringProp>
+          </ResponseAssertion>
+          <hashTree/>
+          <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" 
testname="JA_checkResult" enabled="true">
+            <stringProp 
name="cacheKey">23bf5ad0-233a-4505-971a-9273ea02c9c4</stringProp>
+            <stringProp name="filename"></stringProp>
+            <stringProp name="parameters"></stringProp>
+            <stringProp name="script">import java.util.Map;
+def list = vars.getObject(&quot;result&quot;);
+if (list.size()==1) {
+       Map map = list.get(0);
+       if(map.get(&quot;AUTHOR&quot;).equals(&quot;Philip K. Dick&quot;)) {
+               AssertionResult.setFailure(false);
+       } else {
+               AssertionResult.setFailure(true);
+               AssertionResult.setFailureMessage(&quot;Expected first row 
AUTHOR to be equal to &apos;Philip K. Dick&apos;&quot;);
+       }
+} else {
+       AssertionResult.setFailure(true);
+       AssertionResult.setFailureMessage(&quot;Expected 1 row in result, 
got:&quot;+list.size());
+}
+
+</stringProp>
+            <stringProp name="scriptLanguage">groovy</stringProp>
+          </JSR223Assertion>
+          <hashTree/>
+          <DebugPostProcessor guiclass="TestBeanGUI" 
testclass="DebugPostProcessor" testname="Debug PostProcessor" enabled="true">
+            <boolProp name="displayJMeterProperties">false</boolProp>
+            <boolProp name="displayJMeterVariables">true</boolProp>
+            <boolProp name="displaySamplerProperties">true</boolProp>
+            <boolProp name="displaySystemProperties">false</boolProp>
+          </DebugPostProcessor>
+          <hashTree/>
+        </hashTree>
+        <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" 
testname="JDBC_SELECT_PREPARED" enabled="true">
+          <stringProp name="dataSource">dbConfig</stringProp>
+          <stringProp name="query">select title,author,submission_date from 
USERS where id = ?</stringProp>
+          <stringProp name="queryArguments">0</stringProp>
+          <stringProp name="queryArgumentsTypes">INTEGER</stringProp>
+          <stringProp name="queryTimeout"></stringProp>
+          <stringProp name="queryType">Prepared Select Statement</stringProp>
+          <stringProp name="resultSetHandler">Store as String</stringProp>
+          <stringProp name="resultVariable">result</stringProp>
+          <stringProp 
name="variableNames">title,author,submission_date</stringProp>
+        </JDBCSampler>
+        <hashTree>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp name="2501">Mr</stringProp>
+            </collectionProp>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">8</intProp>
+            <stringProp name="Assertion.scope">variable</stringProp>
+            <stringProp name="Scope.variable">title_1</stringProp>
+          </ResponseAssertion>
+          <hashTree/>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp name="1324166668">Philip K. Dick</stringProp>
+            </collectionProp>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">8</intProp>
+            <stringProp name="Assertion.scope">variable</stringProp>
+            <stringProp name="Scope.variable">author_1</stringProp>
+          </ResponseAssertion>
+          <hashTree/>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp name="-253830980">${__time(yyyy-MM-dd,)}</stringProp>
+            </collectionProp>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">8</intProp>
+            <stringProp name="Assertion.scope">variable</stringProp>
+            <stringProp name="Scope.variable">submission_date_1</stringProp>
+          </ResponseAssertion>
+          <hashTree/>
+          <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
+            <collectionProp name="Asserion.test_strings">
+              <stringProp name="49">1</stringProp>
+            </collectionProp>
+            <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+            <boolProp name="Assertion.assume_success">false</boolProp>
+            <intProp name="Assertion.test_type">8</intProp>
+            <stringProp name="Assertion.scope">variable</stringProp>
+            <stringProp name="Scope.variable">author_#</stringProp>
+          </ResponseAssertion>
+          <hashTree/>
+          <DebugPostProcessor guiclass="TestBeanGUI" 
testclass="DebugPostProcessor" testname="Debug PostProcessor" enabled="true">
+            <boolProp name="displayJMeterProperties">false</boolProp>
+            <boolProp name="displayJMeterVariables">true</boolProp>
+            <boolProp name="displaySamplerProperties">true</boolProp>
+            <boolProp name="displaySystemProperties">false</boolProp>
+          </DebugPostProcessor>
+          <hashTree/>
+          <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" 
testname="JA_checkResult" enabled="true">
+            <stringProp 
name="cacheKey">23bf5ad0-233a-4505-971a-9273ea02c9c4</stringProp>
+            <stringProp name="filename"></stringProp>
+            <stringProp name="parameters"></stringProp>
+            <stringProp name="script">import java.util.Map;
+def list = vars.getObject(&quot;result&quot;);
+if (list.size()==1) {
+       Map map = list.get(0);
+       if(map.get(&quot;AUTHOR&quot;).equals(&quot;Philip K. Dick&quot;)) {
+               AssertionResult.setFailure(false);
+       } else {
+               AssertionResult.setFailure(true);
+               AssertionResult.setFailureMessage(&quot;Expected first row 
AUTHOR to be equal to &apos;Philip K. Dick&apos;&quot;);
+       }
+} else {
+       AssertionResult.setFailure(true);
+       AssertionResult.setFailureMessage(&quot;Expected 1 row in result, 
got:&quot;+list.size());
+}
+
+</stringProp>
+            <stringProp name="scriptLanguage">groovy</stringProp>
+          </JSR223Assertion>
+          <hashTree/>
+        </hashTree>
+        <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" 
testname="JDBC_COMMIT" enabled="true">
+          <stringProp name="dataSource">dbConfig</stringProp>
+          <stringProp name="queryType">Commit</stringProp>
+          <stringProp name="query"></stringProp>
+          <stringProp name="queryArguments"></stringProp>
+          <stringProp name="queryArgumentsTypes"></stringProp>
+          <stringProp name="variableNames"></stringProp>
+          <stringProp name="resultVariable"></stringProp>
+          <stringProp name="queryTimeout"></stringProp>
+          <stringProp name="resultSetHandler">Store as String</stringProp>
+        </JDBCSampler>
+        <hashTree/>
+        <TransactionController guiclass="TransactionControllerGui" 
testclass="TransactionController" testname="CheckTransaction" enabled="true">
+          <boolProp name="TransactionController.includeTimers">false</boolProp>
+          <boolProp name="TransactionController.parent">false</boolProp>
+        </TransactionController>
+        <hashTree>
+          <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" 
testname="JDBC_INSERT_VICTOR_HUGO" enabled="true">
+            <stringProp name="dataSource">dbConfig</stringProp>
+            <stringProp name="query">INSERT INTO USERS(title,author, 
submission_date) VALUES (?, ?, ?)</stringProp>
+            <stringProp name="queryArguments">Mr,Victor 
Hugo,${__time(yyyy-MM-dd,)}</stringProp>
+            <stringProp 
name="queryArgumentsTypes">VARCHAR,VARCHAR,DATE</stringProp>
+            <stringProp name="queryTimeout"></stringProp>
+            <stringProp name="queryType">Prepared Update Statement</stringProp>
+            <stringProp name="resultSetHandler">Store as String</stringProp>
+            <stringProp name="resultVariable"></stringProp>
+            <stringProp name="variableNames"></stringProp>
+          </JDBCSampler>
+          <hashTree>
+            <DebugPostProcessor guiclass="TestBeanGUI" 
testclass="DebugPostProcessor" testname="Debug PostProcessor" enabled="true">
+              <boolProp name="displayJMeterProperties">false</boolProp>
+              <boolProp name="displayJMeterVariables">true</boolProp>
+              <boolProp name="displaySamplerProperties">true</boolProp>
+              <boolProp name="displaySystemProperties">false</boolProp>
+            </DebugPostProcessor>
+            <hashTree/>
+            <ResponseAssertion guiclass="AssertionGui" 
testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
+              <collectionProp name="Asserion.test_strings">
+                <stringProp name="1329970139">1 updates</stringProp>
+              </collectionProp>
+              <stringProp 
name="Assertion.test_field">Assertion.response_data</stringProp>
+              <boolProp name="Assertion.assume_success">false</boolProp>
+              <intProp name="Assertion.test_type">16</intProp>
+            </ResponseAssertion>
+            <hashTree/>
+          </hashTree>
+          <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" 
testname="JDBC_CHECK_COUNT_2" enabled="true">
+            <stringProp name="dataSource">dbConfig</stringProp>
+            <stringProp name="query">select count(1) as number_user from 
USERS</stringProp>
+            <stringProp name="queryArguments"></stringProp>
+            <stringProp name="queryArgumentsTypes">INTEGER</stringProp>
+            <stringProp name="queryTimeout"></stringProp>
+            <stringProp name="queryType">Select Statement</stringProp>
+            <stringProp name="resultSetHandler">Store as String</stringProp>
+            <stringProp name="resultVariable">number_users</stringProp>
+            <stringProp name="variableNames">number_user</stringProp>
+          </JDBCSampler>
+          <hashTree>
+            <DebugPostProcessor guiclass="TestBeanGUI" 
testclass="DebugPostProcessor" testname="Debug PostProcessor" enabled="true">
+              <boolProp name="displayJMeterProperties">false</boolProp>
+              <boolProp name="displayJMeterVariables">true</boolProp>
+              <boolProp name="displaySamplerProperties">true</boolProp>
+              <boolProp name="displaySystemProperties">false</boolProp>
+            </DebugPostProcessor>
+            <hashTree/>
+            <JSR223Assertion guiclass="TestBeanGUI" 
testclass="JSR223Assertion" testname="JA_checkResult" enabled="true">
+              <stringProp 
name="cacheKey">23bf5ad0-233a-4505-971a-9273ea02c9c4</stringProp>
+              <stringProp name="filename"></stringProp>
+              <stringProp name="parameters"></stringProp>
+              <stringProp name="script">import java.util.Map;
+def list = vars.getObject(&quot;number_users&quot;);
+if (list.size()==1) {
+       Map map = list.get(0);
+       if(map.get(&quot;NUMBER_USER&quot;).equals(2L)) {
+               AssertionResult.setFailure(false);
+       } else {
+               AssertionResult.setFailure(true);
+               AssertionResult.setFailureMessage(&quot;Expected number of Rows 
to be equal to 2&quot;);
+       }
+} else {
+       AssertionResult.setFailure(true);
+       AssertionResult.setFailureMessage(&quot;Expected 1 row in result, 
got:&quot;+list.size());
+}
+
+</stringProp>
+              <stringProp name="scriptLanguage">groovy</stringProp>
+            </JSR223Assertion>
+            <hashTree/>
+          </hashTree>
+          <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" 
testname="JDBC_ROLLBACK" enabled="true">
+            <stringProp name="dataSource">dbConfig</stringProp>
+            <stringProp name="queryType">Rollback</stringProp>
+            <stringProp name="query"></stringProp>
+            <stringProp name="queryArguments"></stringProp>
+            <stringProp name="queryArgumentsTypes"></stringProp>
+            <stringProp name="variableNames"></stringProp>
+            <stringProp name="resultVariable"></stringProp>
+            <stringProp name="queryTimeout"></stringProp>
+            <stringProp name="resultSetHandler">Store as String</stringProp>
+          </JDBCSampler>
+          <hashTree/>
+          <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" 
testname="JDBC_CHECK_COUNT_1" enabled="true">
+            <stringProp name="dataSource">dbConfig</stringProp>
+            <stringProp name="query">select count(1) as number_user from 
USERS</stringProp>
+            <stringProp name="queryArguments"></stringProp>
+            <stringProp name="queryArgumentsTypes">INTEGER</stringProp>
+            <stringProp name="queryTimeout"></stringProp>
+            <stringProp name="queryType">Select Statement</stringProp>
+            <stringProp name="resultSetHandler">Store as String</stringProp>
+            <stringProp name="resultVariable">number_users</stringProp>
+            <stringProp name="variableNames">number_user</stringProp>
+          </JDBCSampler>
+          <hashTree>
+            <DebugPostProcessor guiclass="TestBeanGUI" 
testclass="DebugPostProcessor" testname="Debug PostProcessor" enabled="true">
+              <boolProp name="displayJMeterProperties">false</boolProp>
+              <boolProp name="displayJMeterVariables">true</boolProp>
+              <boolProp name="displaySamplerProperties">true</boolProp>
+              <boolProp name="displaySystemProperties">false</boolProp>
+            </DebugPostProcessor>
+            <hashTree/>
+            <JSR223Assertion guiclass="TestBeanGUI" 
testclass="JSR223Assertion" testname="JA_checkResult" enabled="true">
+              <stringProp 
name="cacheKey">23bf5ad0-233a-4505-971a-9273ea02c9c4</stringProp>
+              <stringProp name="filename"></stringProp>
+              <stringProp name="parameters"></stringProp>
+              <stringProp name="script">import java.util.Map;
+def list = vars.getObject(&quot;number_users&quot;);
+if (list.size()==1) {
+       Map map = list.get(0);
+       if(map.get(&quot;NUMBER_USER&quot;).equals(1L)) {
+               AssertionResult.setFailure(false);
+       } else {
+               AssertionResult.setFailure(true);
+               AssertionResult.setFailureMessage(&quot;Expected number of Rows 
to be equal to 1&quot;);
+       }
+} else {
+       AssertionResult.setFailure(true);
+       AssertionResult.setFailureMessage(&quot;Expected 1 row in result, 
got:&quot;+list.size());
+}
+
+</stringProp>
+              <stringProp name="scriptLanguage">groovy</stringProp>
+            </JSR223Assertion>
+            <hashTree/>
+          </hashTree>
+        </hashTree>
+      </hashTree>
+      <ResultCollector guiclass="ViewResultsFullVisualizer" 
testclass="ResultCollector" testname="View Results Tree" enabled="true">
+        <boolProp name="ResultCollector.error_logging">false</boolProp>
+        <objProp>
+          <name>saveConfig</name>
+          <value class="SampleSaveConfiguration">
+            <time>false</time>
+            <latency>false</latency>
+            <timestamp>false</timestamp>
+            <success>true</success>
+            <label>true</label>
+            <code>true</code>
+            <message>true</message>
+            <threadName>true</threadName>
+            <dataType>true</dataType>
+            <encoding>false</encoding>
+            <assertions>true</assertions>
+            <subresults>true</subresults>
+            <responseData>false</responseData>
+            <samplerData>false</samplerData>
+            <xml>false</xml>
+            <fieldNames>true</fieldNames>
+            <responseHeaders>false</responseHeaders>
+            <requestHeaders>false</requestHeaders>
+            <responseDataOnError>false</responseDataOnError>
+            
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
+            <assertionsResultsToSave>0</assertionsResultsToSave>
+            <threadCounts>true</threadCounts>
+            <sampleCount>true</sampleCount>
+          </value>
+        </objProp>
+        <stringProp name="filename">JDBC_TESTS.csv</stringProp>
+      </ResultCollector>
+      <hashTree/>
+      <ResultCollector guiclass="SimpleDataWriter" testclass="ResultCollector" 
testname="Simple Data Writer" enabled="true">
+        <boolProp name="ResultCollector.error_logging">false</boolProp>
+        <objProp>
+          <name>saveConfig</name>
+          <value class="SampleSaveConfiguration">
+            <time>false</time>
+            <latency>false</latency>
+            <timestamp>false</timestamp>
+            <success>true</success>
+            <label>true</label>
+            <code>true</code>
+            <message>true</message>
+            <threadName>true</threadName>
+            <dataType>true</dataType>
+            <encoding>false</encoding>
+            <assertions>true</assertions>
+            <subresults>true</subresults>
+            <responseData>false</responseData>
+            <samplerData>false</samplerData>
+            <xml>true</xml>
+            <fieldNames>false</fieldNames>
+            <responseHeaders>false</responseHeaders>
+            <requestHeaders>false</requestHeaders>
+            <responseDataOnError>false</responseDataOnError>
+            
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
+            <assertionsResultsToSave>0</assertionsResultsToSave>
+            <threadCounts>true</threadCounts>
+            <sampleCount>true</sampleCount>
+          </value>
+        </objProp>
+        <stringProp name="filename">JDBC_TESTS.xml</stringProp>
+      </ResultCollector>
+      <hashTree/>
+    </hashTree>
+    <WorkBench guiclass="WorkBenchGui" testclass="WorkBench" 
testname="WorkBench" enabled="true">
+      <boolProp name="WorkBench.save">true</boolProp>
+    </WorkBench>
+    <hashTree/>
+  </hashTree>
+</jmeterTestPlan>

Propchange: jmeter/trunk/bin/testfiles/JDBC_TESTS.jmx
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: jmeter/trunk/bin/testfiles/JDBC_TESTS.xml
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/bin/testfiles/JDBC_TESTS.xml?rev=1808653&view=auto
==============================================================================
--- jmeter/trunk/bin/testfiles/JDBC_TESTS.xml (added)
+++ jmeter/trunk/bin/testfiles/JDBC_TESTS.xml Sun Sep 17 20:47:27 2017
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<testResults version="1.2">
+<sample s="true" lb="JDBC_DROP_TABLE" rc="42501 -5501" 
rm="java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: 
USERS in statement [drop table USERS]" tn="setUp Thread Group 1-1" dt="text" 
sc="1" ec="0" ng="1" na="1">
+  <assertionResult>
+    <name>RA_IgnoreError</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+</sample>
+<sample s="true" lb="JDBC_CREATE_TABLE" rc="200" rm="OK" tn="setUp Thread 
Group 1-1" dt="text" sc="1" ec="0" ng="1" na="1">
+  <assertionResult>
+    <name>RA_IgnoreError</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+</sample>
+<sample s="true" lb="JDBC_INSERT" rc="200" rm="OK" tn="Thread Group 1-1" 
dt="text" sc="1" ec="0" ng="1" na="1">
+  <assertionResult>
+    <name>Response Assertion</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+</sample>
+<sample s="true" lb="JDBC_SELECT" rc="200" rm="OK" tn="Thread Group 1-1" 
dt="text" sc="1" ec="0" ng="1" na="1">
+  <assertionResult>
+    <name>Response Assertion</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+  <assertionResult>
+    <name>Response Assertion</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+  <assertionResult>
+    <name>Response Assertion</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+  <assertionResult>
+    <name>Response Assertion</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+  <assertionResult>
+    <name>JA_checkResult</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+  <sample s="true" lb="Debug PostProcessor" rc="200" rm="OK" tn="Thread Group 
1-1" dt="text" sc="1" ec="0" ng="0" na="0"/>
+</sample>
+<sample s="true" lb="JDBC_SELECT_PREPARED" rc="200" rm="OK" tn="Thread Group 
1-1" dt="text" sc="1" ec="0" ng="1" na="1">
+  <assertionResult>
+    <name>Response Assertion</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+  <assertionResult>
+    <name>Response Assertion</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+  <assertionResult>
+    <name>Response Assertion</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+  <assertionResult>
+    <name>Response Assertion</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+  <assertionResult>
+    <name>JA_checkResult</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+  <sample s="true" lb="Debug PostProcessor" rc="200" rm="OK" tn="Thread Group 
1-1" dt="text" sc="1" ec="0" ng="0" na="0"/>
+</sample>
+<sample s="true" lb="JDBC_COMMIT" rc="200" rm="OK" tn="Thread Group 1-1" 
dt="text" sc="1" ec="0" ng="1" na="1"/>
+<sample s="true" lb="JDBC_INSERT_VICTOR_HUGO" rc="200" rm="OK" tn="Thread 
Group 1-1" dt="text" sc="1" ec="0" ng="1" na="1">
+  <assertionResult>
+    <name>Response Assertion</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+  <sample s="true" lb="Debug PostProcessor" rc="200" rm="OK" tn="Thread Group 
1-1" dt="text" sc="1" ec="0" ng="0" na="0"/>
+</sample>
+<sample s="true" lb="JDBC_CHECK_COUNT_2" rc="200" rm="OK" tn="Thread Group 
1-1" dt="text" sc="1" ec="0" ng="1" na="1">
+  <assertionResult>
+    <name>JA_checkResult</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+  <sample s="true" lb="Debug PostProcessor" rc="200" rm="OK" tn="Thread Group 
1-1" dt="text" sc="1" ec="0" ng="0" na="0"/>
+</sample>
+<sample s="true" lb="JDBC_ROLLBACK" rc="200" rm="OK" tn="Thread Group 1-1" 
dt="text" sc="1" ec="0" ng="1" na="1"/>
+<sample s="true" lb="JDBC_CHECK_COUNT_1" rc="200" rm="OK" tn="Thread Group 
1-1" dt="text" sc="1" ec="0" ng="1" na="1">
+  <assertionResult>
+    <name>JA_checkResult</name>
+    <failure>false</failure>
+    <error>false</error>
+  </assertionResult>
+  <sample s="true" lb="Debug PostProcessor" rc="200" rm="OK" tn="Thread Group 
1-1" dt="text" sc="1" ec="0" ng="0" na="0"/>
+</sample>
+<sample s="true" lb="CheckTransaction" rc="200" rm="Number of samples in 
transaction : 4, number of failing samples : 0" tn="Thread Group 1-1" dt="" 
sc="1" ec="0" ng="1" na="1"/>
+
+</testResults>

Propchange: jmeter/trunk/bin/testfiles/JDBC_TESTS.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jmeter/trunk/bin/testfiles/JDBC_TESTS.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: jmeter/trunk/build.properties
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/build.properties?rev=1808653&r1=1808652&r2=1808653&view=diff
==============================================================================
--- jmeter/trunk/build.properties (original)
+++ jmeter/trunk/build.properties Sun Sep 17 20:47:27 2017
@@ -431,3 +431,9 @@ jacocoant.version            = 0.7.9
 jacocoant.jar                = org.jacoco.ant-${jacocoant.version}-nodeps.jar
 jacocoant.loc                = 
${maven2.repo}/org/jacoco/org.jacoco.ant/${jacocoant.version}
 jacocoant.md5                = 134a9863234844bf156143dad39564e2
+
+# Optional for use by JDBC_TESTS.jmx
+hsqldb.version                  = 2.4.0
+hsqldb.jar                      = hsqldb-${hsqldb.version}.jar
+hsqldb.loc                      = 
${maven2.repo}/org/hsqldb/hsqldb/${hsqldb.version}
+hsqldb.md5                      = 72cae1d3ef411edc74bc3ff4d12bd47c
\ No newline at end of file

Modified: jmeter/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/build.xml?rev=1808653&r1=1808652&r2=1808653&view=diff
==============================================================================
--- jmeter/trunk/build.xml (original)
+++ jmeter/trunk/build.xml Sun Sep 17 20:47:27 2017
@@ -2724,6 +2724,11 @@ run JMeter unless all the JMeter jars ar
       <param name="batchtest.jmx" value="TEST_HTTPS.jmx"/>
       <param name="skip.batchtest" value="${skip.test_https}" />
     </antcall>
+      
+    <antcall target="batchtest">
+      <param name="batchtest.name" value="JDBC_TESTS"/>
+      <param name="batchtest.jmx" value="JDBC_TESTS.jmx"/>
+    </antcall>
 
     <antcall target="batchtest">
       <param name="batchtest.name" value="Bug60607"/>
@@ -3179,6 +3184,7 @@ run JMeter unless all the JMeter jars ar
     <process_jarfile jarname="xmlpull"/>
     <process_jarfile jarname="xpp3"/>
     <process_jarfile jarname="xstream"/>
+    <process_jarfile jarname="hsqldb" dest.dir="${lib.coverage}" />
     <process_jarfile jarname="jacocoant" dest.dir="${lib.coverage}" />
     <process_jarfile jarname="sonarqube-ant-task" dest.dir="${lib.coverage}" />
   </target>

Modified: jmeter/trunk/test/src/org/apache/jmeter/JMeterVersionTest.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/JMeterVersionTest.java?rev=1808653&r1=1808652&r2=1808653&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/JMeterVersionTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/JMeterVersionTest.java Sun Sep 17 
20:47:27 2017
@@ -114,8 +114,8 @@ public class JMeterVersionTest extends J
         versions.remove("rat");
         propNames.remove("rat-tasks");
         versions.remove("rat-tasks");
-        // remove optional jacoco and sonar jars (required for coverage 
reporting, not required for jmeter)
-        for (String optLib : Arrays.asList("jacocoant", "sonarqube-ant-task")) 
{
+        // remove optional hsqldb, jacoco and sonar jars (required for 
coverage reporting, not required for jmeter)
+        for (String optLib : Arrays.asList("jacocoant", "sonarqube-ant-task", 
"hsqldb")) {
             propNames.remove(optLib);
             versions.remove(optLib);
         }


Reply via email to