Author: pmouawad Date: Sat Oct 28 14:36:27 2017 New Revision: 1813635 URL: http://svn.apache.org/viewvc?rev=1813635&view=rev Log: Improve JDBC Tests - Add tests on errors - Add tests for Callable Statements
Modified: jmeter/trunk/bin/testfiles/JDBC_TESTS.csv jmeter/trunk/bin/testfiles/JDBC_TESTS.jmx jmeter/trunk/bin/testfiles/JDBC_TESTS.xml Modified: jmeter/trunk/bin/testfiles/JDBC_TESTS.csv URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/testfiles/JDBC_TESTS.csv?rev=1813635&r1=1813634&r2=1813635&view=diff ============================================================================== --- jmeter/trunk/bin/testfiles/JDBC_TESTS.csv (original) +++ jmeter/trunk/bin/testfiles/JDBC_TESTS.csv Sat Oct 28 14:36:27 2017 @@ -1,13 +1,20 @@ label,responseCode,responseMessage,threadName,dataType,success,grpThreads,allThreads,SampleCount,ErrorCount +JDBC_DROP_PROCEDURE,200,OK,setUp Thread Group 1-1,text,true,1,1,1,0 JDBC_DROP_TABLE,200,OK,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 -JDBC_INSERT_2,200,OK,Thread Group 1-1,text,true,1,1,1,0 +JDBC_CREATE_PROCEDURE,200,OK,setUp Thread Group 1-1,text,true,1,1,1,0 +JDBC_INSERT,200,OK,TG-OK 1-1,text,true,1,1,1,0 +JDBC_CALL_PROCEDURE,200,OK,TG-OK 1-1,text,true,1,1,1,0 +JDBC_SELECT,200,OK,TG-OK 1-1,text,true,1,1,1,0 +JDBC_SELECT_PREPARED,200,OK,TG-OK 1-1,text,true,1,1,1,0 +JDBC_COMMIT,200,OK,TG-OK 1-1,text,true,1,1,1,0 +JDBC_INSERT_VICTOR_HUGO,200,OK,TG-OK 1-1,text,true,1,1,1,0 +JDBC_CHECK_COUNT_3,200,OK,TG-OK 1-1,text,true,1,1,1,0 +JDBC_ROLLBACK,200,OK,TG-OK 1-1,text,true,1,1,1,0 +JDBC_CHECK_COUNT_1,200,OK,TG-OK 1-1,text,true,1,1,1,0 +CheckTransaction,200,"Number of samples in transaction : 4, number of failing samples : 0",TG-OK 1-1,,true,1,1,1,0 +JDBC_INSERT_2,200,OK,TG-OK 1-1,text,true,1,1,1,0 +JDBC_NoConfig,000,java.lang.IllegalArgumentException: Variable Name must not be null in JDBC_NoConfig,TG-Errors 2-1,text,true,1,1,1,0 +JDBC_Wrong_Sql,42581 -5581,java.sql.SQLSyntaxErrorException: unexpected token: WHERE,TG-Errors 2-1,text,true,1,1,1,0 +JDBC_With_Failing_PreProcessor,200,OK,TG-Errors 2-1,text,true,1,1,1,0 +JDBC_With_Failing_PostProcessor,200,OK,TG-Errors 2-1,text,true,1,1,1,0 Modified: jmeter/trunk/bin/testfiles/JDBC_TESTS.jmx URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/testfiles/JDBC_TESTS.jmx?rev=1813635&r1=1813634&r2=1813635&view=diff ============================================================================== --- jmeter/trunk/bin/testfiles/JDBC_TESTS.jmx (original) +++ jmeter/trunk/bin/testfiles/JDBC_TESTS.jmx Sat Oct 28 14:36:27 2017 @@ -4,7 +4,7 @@ <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> + <boolProp name="TestPlan.serialize_threadgroups">true</boolProp> <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> <collectionProp name="Arguments.arguments"/> </elementProp> @@ -42,6 +42,29 @@ <stringProp name="ThreadGroup.delay"></stringProp> </SetupThreadGroup> <hashTree> + <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="JDBC_DROP_PROCEDURE" enabled="true"> + <stringProp name="dataSource">dbConfig</stringProp> + <stringProp name="query">drop PROCEDURE new_user IF EXISTS; +</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" 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> <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="JDBC_DROP_TABLE" enabled="true"> <stringProp name="dataSource">dbConfig</stringProp> <stringProp name="query">drop table USERS IF EXISTS; @@ -67,13 +90,43 @@ </hashTree> <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="JDBC_CREATE_TABLE" enabled="true"> <stringProp name="dataSource">dbConfig</stringProp> - <stringProp name="query">create table USERS ( + <stringProp name="query">create table IF NOT EXISTS USERS ( id INT IDENTITY NOT NULL, title VARCHAR(50) NOT NULL, author VARCHAR(20) NOT NULL, submission_date DATE, PRIMARY KEY (id) -);</stringProp> +); + +</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" 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> + <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="JDBC_CREATE_PROCEDURE" enabled="true"> + <stringProp name="dataSource">dbConfig</stringProp> + <stringProp name="query">CREATE PROCEDURE new_user(title VARCHAR(50), author VARCHAR(50)) + MODIFIES SQL DATA DYNAMIC RESULT SETS 1 + BEGIN ATOMIC + DECLARE result CURSOR FOR SELECT * FROM USERS WHERE ID = IDENTITY(); + INSERT INTO USERS VALUES (DEFAULT, title, author, CURRENT_DATE); + OPEN result; + END ;</stringProp> <stringProp name="queryArguments"></stringProp> <stringProp name="queryArgumentsTypes"></stringProp> <stringProp name="queryTimeout"></stringProp> @@ -94,7 +147,7 @@ <hashTree/> </hashTree> </hashTree> - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true"> + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="TG-OK" 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> @@ -131,6 +184,86 @@ </ResponseAssertion> <hashTree/> </hashTree> + <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="JDBC_CALL_PROCEDURE" enabled="true"> + <stringProp name="dataSource">dbConfig</stringProp> + <stringProp name="query">call new_user(?, ?)</stringProp> + <stringProp name="queryArguments">Mr,Fiodor Dostoievski</stringProp> + <stringProp name="queryArgumentsTypes">VARCHAR,VARCHAR</stringProp> + <stringProp name="queryTimeout"></stringProp> + <stringProp name="queryType">Callable Statement</stringProp> + <stringProp name="resultSetHandler">Store as String</stringProp> + <stringProp name="resultVariable">result</stringProp> + <stringProp name="variableNames">id,title,author</stringProp> + </JDBCSampler> + <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">id_1</stringProp> + </ResponseAssertion> + <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="-1486782315">Fiodor Dostoievski</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="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("result"); +if (list.size()==1) { + Map map = list.get(0); + if(map.get("AUTHOR").equals("Fiodor Dostoievski")) { + AssertionResult.setFailure(false); + } else { + AssertionResult.setFailure(true); + AssertionResult.setFailureMessage("Expected first row AUTHOR to be equal to 'Fiodor Dostoievski'"); + } +} else { + AssertionResult.setFailure(true); + AssertionResult.setFailureMessage("Expected 1 row in result, got:"+list.size()); +} + +</stringProp> + <stringProp name="scriptLanguage">groovy</stringProp> + </JSR223Assertion> + <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> @@ -330,7 +463,7 @@ if (list.size()==1) { </ResponseAssertion> <hashTree/> </hashTree> - <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="JDBC_CHECK_COUNT_2" enabled="true"> + <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="JDBC_CHECK_COUNT_3" enabled="true"> <stringProp name="dataSource">dbConfig</stringProp> <stringProp name="query">select count(1) as number_user from USERS</stringProp> <stringProp name="queryArguments"></stringProp> @@ -350,11 +483,11 @@ if (list.size()==1) { def list = vars.getObject("number_users"); if (list.size()==1) { Map map = list.get(0); - if(map.get("NUMBER_USER").equals(2L)) { + if(map.get("NUMBER_USER").equals(3L)) { AssertionResult.setFailure(false); } else { AssertionResult.setFailure(true); - AssertionResult.setFailureMessage("Expected number of Rows to be equal to 2"); + AssertionResult.setFailureMessage("Expected number of Rows to be equal to 3"); } } else { AssertionResult.setFailure(true); @@ -398,11 +531,11 @@ if (list.size()==1) { def list = vars.getObject("number_users"); if (list.size()==1) { Map map = list.get(0); - if(map.get("NUMBER_USER").equals(1L)) { + if(map.get("NUMBER_USER").equals(2L)) { AssertionResult.setFailure(false); } else { AssertionResult.setFailure(true); - AssertionResult.setFailureMessage("Expected number of Rows to be equal to 1"); + AssertionResult.setFailureMessage("Expected number of Rows to be equal to 2"); } } else { AssertionResult.setFailure(true); @@ -462,7 +595,7 @@ if (list.size()==1) { <hashTree/> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_number_user_before_equal1" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="49">1</stringProp> + <stringProp name="50">2</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.request_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> @@ -473,7 +606,7 @@ if (list.size()==1) { <hashTree/> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_number_user_after_equal2" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="50">2</stringProp> + <stringProp name="51">3</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.request_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> @@ -506,6 +639,240 @@ if (list.size()==1) { <hashTree/> </hashTree> </hashTree> + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="TG-Errors" 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_NoConfig" enabled="true"> + <stringProp name="dataSource"></stringProp> + <stringProp name="query">INSERT INTO USERS(title,author, submission_date) VALUES ('Mr', 'Philip K. Dick', 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="-1643270117">Variable Name must not be null in JDBC_NoConfig</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_message</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_Wrong_Sql" enabled="true"> + <stringProp name="dataSource">dbConfig</stringProp> + <stringProp name="query">select title,author,submission_date 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="1180728046">java.sql.SQLSyntaxErrorException:</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_message</stringProp> + <boolProp name="Assertion.assume_success">true</boolProp> + <intProp name="Assertion.test_type">16</intProp> + <stringProp name="Assertion.scope">all</stringProp> + <stringProp name="Scope.variable">title_1</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="JDBC_With_Failing_PreProcessor" enabled="true"> + <stringProp name="dataSource">dbConfig</stringProp> + <stringProp name="queryType">Prepared Update Statement</stringProp> + <stringProp name="query">INSERT INTO USERS(title,author, submission_date) VALUES (?, ?, ?)</stringProp> + <stringProp name="queryArguments">Mr,Leon Tolstoi,${__time(yyyy-MM-dd,)}</stringProp> + <stringProp name="queryArgumentsTypes">VARCHAR,VARCHAR,DATE</stringProp> + <stringProp name="variableNames"></stringProp> + <stringProp name="resultVariable"></stringProp> + <stringProp name="queryTimeout"></stringProp> + <stringProp name="resultSetHandler">Store as String</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/> + <JDBCPreProcessor guiclass="TestBeanGUI" testclass="JDBCPreProcessor" testname="JDBC PreProcessor" enabled="true"> + <stringProp name="dataSource"></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"></stringProp> + <stringProp name="variableNames">number_user_before</stringProp> + </JDBCPreProcessor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_number_user_after_count" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="49">1</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.request_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">number_user_after_#</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="JDBC_With_Failing_PostProcessor" enabled="true"> + <stringProp name="dataSource">dbConfig</stringProp> + <stringProp name="queryType">Prepared Update Statement</stringProp> + <stringProp name="query">INSERT INTO USERS(title,author, submission_date) VALUES (?, ?, ?)</stringProp> + <stringProp name="queryArguments">Mr,Leon Tolstoi,${__time(yyyy-MM-dd,)}</stringProp> + <stringProp name="queryArgumentsTypes">VARCHAR,VARCHAR,DATE</stringProp> + <stringProp name="variableNames"></stringProp> + <stringProp name="resultVariable"></stringProp> + <stringProp name="queryTimeout"></stringProp> + <stringProp name="resultSetHandler">Store as String</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/> + <JDBCPostProcessor guiclass="TestBeanGUI" testclass="JDBCPostProcessor" testname="JDBC PostProcessor" enabled="true"> + <stringProp name="dataSource"></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"></stringProp> + <stringProp name="variableNames">number_user_after</stringProp> + </JDBCPostProcessor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_number_user_after_count" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="49">1</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.request_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">number_user_after_#</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="JDBC_With_Failing_PreProcessor" enabled="true"> + <stringProp name="dataSource">dbConfig</stringProp> + <stringProp name="queryType">Prepared Update Statement</stringProp> + <stringProp name="query">INSERT INTO USERS(title,author, submission_date) VALUES (?, ?, ?)</stringProp> + <stringProp name="queryArguments">Mr,Leon Tolstoi,${__time(yyyy-MM-dd,)}</stringProp> + <stringProp name="queryArgumentsTypes">VARCHAR,VARCHAR,DATE</stringProp> + <stringProp name="variableNames"></stringProp> + <stringProp name="resultVariable"></stringProp> + <stringProp name="queryTimeout"></stringProp> + <stringProp name="resultSetHandler">Store as String</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/> + <JDBCPreProcessor guiclass="TestBeanGUI" testclass="JDBCPreProcessor" testname="JDBC PreProcessor" enabled="true"> + <stringProp name="dataSource">dbConfig</stringProp> + <stringProp name="query">select count(1) as number_user 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"></stringProp> + <stringProp name="variableNames">number_user_before</stringProp> + </JDBCPreProcessor> + <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_With_Failing_PostProcessor" enabled="true"> + <stringProp name="dataSource">dbConfig</stringProp> + <stringProp name="queryType">Prepared Update Statement</stringProp> + <stringProp name="query">INSERT INTO USERS(title,author, submission_date) VALUES (?, ?, ?)</stringProp> + <stringProp name="queryArguments">Mr,Leon Tolstoi,${__time(yyyy-MM-dd,)}</stringProp> + <stringProp name="queryArgumentsTypes">VARCHAR,VARCHAR,DATE</stringProp> + <stringProp name="variableNames"></stringProp> + <stringProp name="resultVariable"></stringProp> + <stringProp name="queryTimeout"></stringProp> + <stringProp name="resultSetHandler">Store as String</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/> + <JDBCPostProcessor guiclass="TestBeanGUI" testclass="JDBCPostProcessor" testname="JDBC PostProcessor" enabled="true"> + <stringProp name="dataSource">dbConfig</stringProp> + <stringProp name="query">select count(1) as number_user 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"></stringProp> + <stringProp name="variableNames">number_user_after</stringProp> + </JDBCPostProcessor> + <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> + </hashTree> <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> <boolProp name="ResultCollector.error_logging">false</boolProp> <objProp> Modified: jmeter/trunk/bin/testfiles/JDBC_TESTS.xml URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/testfiles/JDBC_TESTS.xml?rev=1813635&r1=1813634&r2=1813635&view=diff ============================================================================== --- jmeter/trunk/bin/testfiles/JDBC_TESTS.xml (original) +++ jmeter/trunk/bin/testfiles/JDBC_TESTS.xml Sat Oct 28 14:36:27 2017 @@ -1,5 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <testResults version="1.2"> +<sample s="true" lb="JDBC_DROP_PROCEDURE" rc="200" rm="OK" tn="setUp Thread Group 1-1" dt="text" sc="1" ec="0" ng="1" na="1"> + <assertionResult> + <name>RA</name> + <failure>false</failure> + <error>false</error> + </assertionResult> +</sample> <sample s="true" lb="JDBC_DROP_TABLE" rc="200" rm="OK" tn="setUp Thread Group 1-1" dt="text" sc="1" ec="0" ng="1" na="1"> <assertionResult> <name>RA</name> @@ -14,14 +21,48 @@ <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"> +<sample s="true" lb="JDBC_CREATE_PROCEDURE" rc="200" rm="OK" tn="setUp Thread Group 1-1" dt="text" sc="1" ec="0" ng="1" na="1"> + <assertionResult> + <name>RA</name> + <failure>false</failure> + <error>false</error> + </assertionResult> +</sample> +<sample s="true" lb="JDBC_INSERT" rc="200" rm="OK" tn="TG-OK 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_CALL_PROCEDURE" rc="200" rm="OK" tn="TG-OK 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> -<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"> +<sample s="true" lb="JDBC_SELECT" rc="200" rm="OK" tn="TG-OK 1-1" dt="text" sc="1" ec="0" ng="1" na="1"> <assertionResult> <name>Response Assertion</name> <failure>false</failure> @@ -48,7 +89,7 @@ <error>false</error> </assertionResult> </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"> +<sample s="true" lb="JDBC_SELECT_PREPARED" rc="200" rm="OK" tn="TG-OK 1-1" dt="text" sc="1" ec="0" ng="1" na="1"> <assertionResult> <name>Response Assertion</name> <failure>false</failure> @@ -75,31 +116,31 @@ <error>false</error> </assertionResult> </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"> +<sample s="true" lb="JDBC_COMMIT" rc="200" rm="OK" tn="TG-OK 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="TG-OK 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_CHECK_COUNT_2" 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_3" rc="200" rm="OK" tn="TG-OK 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> -<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"> +<sample s="true" lb="JDBC_ROLLBACK" rc="200" rm="OK" tn="TG-OK 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="TG-OK 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> -<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"/> -<sample s="true" lb="JDBC_INSERT_2" rc="200" rm="OK" tn="Thread Group 1-1" dt="text" sc="1" ec="0" ng="1" na="1"> +<sample s="true" lb="CheckTransaction" rc="200" rm="Number of samples in transaction : 4, number of failing samples : 0" tn="TG-OK 1-1" dt="" sc="1" ec="0" ng="1" na="1"/> +<sample s="true" lb="JDBC_INSERT_2" rc="200" rm="OK" tn="TG-OK 1-1" dt="text" sc="1" ec="0" ng="1" na="1"> <assertionResult> <name>Response Assertion</name> <failure>false</failure> @@ -126,5 +167,35 @@ <error>false</error> </assertionResult> </sample> +<sample s="true" lb="JDBC_NoConfig" rc="000" rm="java.lang.IllegalArgumentException: Variable Name must not be null in JDBC_NoConfig" tn="TG-Errors 2-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_Wrong_Sql" rc="42581 -5581" rm="java.sql.SQLSyntaxErrorException: unexpected token: WHERE" tn="TG-Errors 2-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_With_Failing_PreProcessor" rc="200" rm="OK" tn="TG-Errors 2-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="TG-Errors 2-1" dt="text" sc="1" ec="0" ng="0" na="0"/> +</sample> +<sample s="true" lb="JDBC_With_Failing_PostProcessor" rc="200" rm="OK" tn="TG-Errors 2-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="TG-Errors 2-1" dt="text" sc="1" ec="0" ng="0" na="0"/> +</sample> </testResults>