13 Testing Tips
13 Testing Tips
Properly sizing JTR nodes JVM heaps
At the moment every JTR node (both active and passive) stores test results, that’s to say outcomes, only in memory. For this reason you should pay attention correctly sizing the heap of the JVMs running JTR nodes. The memory requirement grows linearly in the number of runs, epochs and runner instances active on the node.
In order to properly size the heap you should consider that typically a default outcome (an outcome instance belonging to the jtr.test.impl.DefaultOutcome class) requires something like 50 bytes. This quantification is not absolute since outcomes change in size according to both user-messages you put into them and exceptions caught and stored into them by the JTR runtime.
Anyway, considering such a measure can help you in quantifying the amount of heap you should reserve to the JTR-node. The formula you can apply is like the following:
∑ ( 50 * runsi-th category * epochs * instance_counti-th category )
where i iterates over the number of configured and active categories. This limitation will be removed in one of the next releases.
Always specify the right set of factories
Please, remember to properly define the required set of JTR components implementations in the factories section of your jtr.xml file. The default set is the following one:
<factories>
<factory key="IAssignmentPolicyFactory"
fqn="jtr.assigner.impl.DefaultAssignmentPolicyFactory" />
<factory key="IOutcomeFactory"
fqn="jtr.test.impl.DefaultOutcomeFactory" />
<factory key="IWsHelperFactory"
fqn="jtr.ws.jaxws.JaxWsHelperFactory" />
<factory key="ITestCompletionListener"
fqn="jtr.test.impl.DefaultTestCompletionListener" />
<factory key="ITestResultDisplayer"
fqn="jtr.test.impl.DefaultTestResultDisplayer" />
<factory key="ITestResultsExporter"
fqn="jtr.test.results.exporters.impl.ExcelExporter" />
<factory key="ITestScriptingEngine" fqn="jtr.script.impl.BshScriptEngine" />
<factory key="ITestStatFunctions"
fqn="jtr.lang.functions.impl.DefaultStatFunctionsFactory" />
</factories>
When the jtr.xml file is required?
The jtr.xml file is required by every JTR-based test-suite.
As far as JTR EDiT sessions are concerned, the jtr.xml file is required only by the JTR active-node: JTR passive-nodes will be dynamically instructed by JTR active-nodes on the test-suites that must be executed.
JTR passive-nodes dynamic configuration
You don’t need to manually deploy neither any third-party library you need to use during your tests nor your own JTR runners into JTR passive-nodes’ classpaths.
JTR-passive nodes are dynamically configured by JTR active-nodes for proper test execution.