alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

JMeter example source code file (Test.jmx)

This example JMeter source code file (Test.jmx) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - JMeter tags/keywords

argument, argument, arguments, arguments, c, c, javasampler, javasampler, ok, responsemessage, resultdata, sleep_mask, sleep_time, status

The JMeter Test.jmx source code

<jmeterTestPlan version="1.2" properties="1.8">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test" enabled="true">
      <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">
      <boolProp name="TestPlan.serialize_threadgroups">false
      <boolProp name="TestPlan.functional_mode">false
      <stringProp name="TestPlan.comments">Sample test for demonstrating JMeter Ant build script and Schematic stylesheet
    </TestPlan>
    <hashTree>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
        <longProp name="ThreadGroup.start_time">1143889321000
        <stringProp name="ThreadGroup.delay">
        <stringProp name="ThreadGroup.duration">
        <stringProp name="ThreadGroup.num_threads">3
        <boolProp name="ThreadGroup.scheduler">false
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
          <stringProp name="LoopController.loops">5
          <boolProp name="LoopController.continue_forever">false
        </elementProp>
        <longProp name="ThreadGroup.end_time">1143889321000
        <stringProp name="ThreadGroup.on_sample_error">continue
        <stringProp name="ThreadGroup.ramp_time">1
      </ThreadGroup>
      <hashTree>
        <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true">
          <stringProp name="CounterConfig.start">1
          <stringProp name="CounterConfig.incr">1000
          <stringProp name="CounterConfig.name">C
          <boolProp name="CounterConfig.per_user">false
          <stringProp name="CounterConfig.end">1000000
        </CounterConfig>
        <hashTree/>
        <JavaSampler guiclass="JavaTestSamplerGui" testclass="JavaSampler" testname="Sample 1" enabled="true">
          <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
            <collectionProp name="Arguments.arguments">
              <elementProp name="Sleep_Time" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">100
                <stringProp name="Argument.name">Sleep_Time
              </elementProp>
              <elementProp name="Sleep_Mask" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">0xFF
                <stringProp name="Argument.name">Sleep_Mask
              </elementProp>
              <elementProp name="Label" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">
                <stringProp name="Argument.name">Label
              </elementProp>
              <elementProp name="ResponseCode" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">200
                <stringProp name="Argument.name">ResponseCode
              </elementProp>
              <elementProp name="ResponseMessage" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">OK
                <stringProp name="Argument.name">ResponseMessage
              </elementProp>
              <elementProp name="Status" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">OK
                <stringProp name="Argument.name">Status
              </elementProp>
              <elementProp name="SamplerData" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">Request
                <stringProp name="Argument.name">SamplerData
              </elementProp>
              <elementProp name="ResultData" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">Response C=${C}
                <stringProp name="Argument.name">ResultData
              </elementProp>
            </collectionProp>
          </elementProp>
          <stringProp name="classname">org.apache.jmeter.protocol.java.test.JavaTest
        </JavaSampler>
        <hashTree>
          <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
            <collectionProp name="Asserion.test_strings">
              <stringProp name="51">3
            </collectionProp>
            <stringProp name="Assertion.test_field">Assertion.response_data
            <intProp name="Assertion.test_type">6
            <stringProp name="Assertion.assume_success">false
          </ResponseAssertion>
          <hashTree/>
        </hashTree>
        <JavaSampler guiclass="JavaTestSamplerGui" testclass="JavaSampler" testname="Sample 2" enabled="true">
          <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
            <collectionProp name="Arguments.arguments">
              <elementProp name="Sleep_Time" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">100
                <stringProp name="Argument.name">Sleep_Time
              </elementProp>
              <elementProp name="Sleep_Mask" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">0xFF
                <stringProp name="Argument.name">Sleep_Mask
              </elementProp>
              <elementProp name="Label" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">
                <stringProp name="Argument.name">Label
              </elementProp>
              <elementProp name="ResponseCode" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">200
                <stringProp name="Argument.name">ResponseCode
              </elementProp>
              <elementProp name="ResponseMessage" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">OK
                <stringProp name="Argument.name">ResponseMessage
              </elementProp>
              <elementProp name="Status" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">OK
                <stringProp name="Argument.name">Status
              </elementProp>
              <elementProp name="SamplerData" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">Request
                <stringProp name="Argument.name">SamplerData
              </elementProp>
              <elementProp name="ResultData" elementType="Argument">
                <stringProp name="Argument.metadata">=
                <stringProp name="Argument.value">Response C=${C} Tn=${__threadNum}
                <stringProp name="Argument.name">ResultData
              </elementProp>
            </collectionProp>
          </elementProp>
          <stringProp name="classname">org.apache.jmeter.protocol.java.test.JavaTest
        </JavaSampler>
        <hashTree/>
      </hashTree>
    </hashTree>
  </hashTree>
</jmeterTestPlan>

Other JMeter examples (source code examples)

Here is a short list of links related to this JMeter Test.jmx source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.