New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Include Controller to test plan (made of Include Controllers) without saving TestPlan leads to included code not being taken into account until save #3176
Comments
Soul Patch (migrated from Bugzilla): Following is the code flow : // N.B. The keys can be either JMeterTreeNode or TestElement TestCompiler.addNode() called which tries to cast the JMeterTreeNode received to TestElement and a ClassCastException is thrown. Need to investigate why the data.keySet returns a JMeterTreeNode. If it is acceptable then a code should be in place to extract the TestElement from the JMeterTreeNode to avoid the ClassCastException. |
Soul Patch (migrated from Bugzilla): /** {@inheritdoc} */ |
Soul Patch (migrated from Bugzilla): The method should look like this after adding the patch. /** {@inheritdoc} */ Created attachment IncludeControllerBug_src_core.patch: proposed patch containing the fix for the issue. IncludeControllerBug_src_core.patchIndex: org/apache/jmeter/threads/TestCompiler.java
===================================================================
--- org/apache/jmeter/threads/TestCompiler.java (revision 1509349)
+++ org/apache/jmeter/threads/TestCompiler.java (working copy)
@@ -137,7 +137,12 @@
/** {@inheritDoc} */
@Override
public void addNode(Object node, HashTree subTree) {
+ //Added to resolve the bug Bug 55334 - https://issues.apache.org/bugzilla/show_bug.cgi?id=55334
+ if(node instanceof JMeterTreeNode){
+ stack.addLast(((JMeterTreeNode)node).getTestElement());
+ }else{
stack.addLast((TestElement) node);
+ }
}
/** {@inheritDoc} */ |
@pmouawad (migrated from Bugzilla): URL: http://svn.apache.org/r1509647 Modified: |
@pmouawad (migrated from Bugzilla): This should be fixed now.
|
Soul Patch (Bug 55334):
In a Test Plan, add a Thread Group which has Include Controllers in it. Each Include controller has a valid Test Fragment file path specified. The Test Plan as a whole is Valid.
Run the Test Plan to completion. Now add another Include Controller to this Test Plan using Add -> Logic Controller -> Include Controller.
Add a valid file path of a Test Fragment (This could be a duplicate of one of the other Include Controllers already in the Test Plan)
Now run the Test Plan. The following exception is encountered in the logs.
ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.ClassCastException: org.apache.jmeter.gui.tree.JMeterTreeNode cannot be cast to org.apache.jmeter.testelement.TestElement
at org.apache.jmeter.threads.TestCompiler.addNode(TestCompiler.java:140)
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:1001)
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:986)
at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:532)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:252)
at java.lang.Thread.run(Unknown Source)
Severity: major
OS: All
The text was updated successfully, but these errors were encountered: