Bug 56602 - serialized test elements lose some properties
Summary: serialized test elements lose some properties
Status: RESOLVED DUPLICATE of bug 56080
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.11
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-06 19:48 UTC by Nikolai Grigoriev
Modified: 2014-06-06 22:07 UTC (History)
1 user (show)



Attachments
Dummy test with ViewResultsFullVisualizer (2.22 KB, text/plain)
2014-06-06 20:08 UTC, Nikolai Grigoriev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolai Grigoriev 2014-06-06 19:48:06 UTC
I have recently moved to Jmeter 2.11 from 2.9 and immediately noticed that all of my tests got corrupted. I have verified with one test using the original file and found that it is enough to open and save the test to get it corrupted.

It seems to me that some object properties just simply do not get written to the XML file. I found that it is not only my plug-ins but also some other 3rd party plug-ins suffer.

I did the diff between "before" and "after" saving the JMX file using JMeter and I see a few changes like this:

       <ResultCollector guiclass="StatVisualizer" testclass="ResultCollector" testname="Aggregate Report" enabled="true">
         <boolProp name="ResultCollector.error_logging">false</boolProp>
         <objProp>
-          <name>saveConfig</name>


           <objProp>
-            <name>discreete_buckets</name>
             <value class="java.util.ArrayList">
               <com.mycompany.jmeter.utils.DDRRangeRecord>
-                <probability>50.0</probability>

I started looking at what could be the reason and found that my record class (the one that JMeter eventually serializes) is like this:

public class A implements Serializable {
...
  field A with getter and setter
}

public class B extends A implements Serializable {
  field B with getter and setter
  field C with getter and setter
}

So, fields B and C get serialized, A does not. If I add A to the class B - it works.

With Jmeter 2.9 all A,B and C would be serialized.
Comment 1 Nikolai Grigoriev 2014-06-06 20:08:25 UTC
Created attachment 31694 [details]
Dummy test with ViewResultsFullVisualizer

This is probably one of the test cases. This was created with JMeter 2.9. Open it in 2.11, save and compare with the original. You will see that the element "name" (<name>saveConfig</name>) will disappear from the resulting JMX file.
Comment 2 Nikolai Grigoriev 2014-06-06 20:44:31 UTC
I did some more testing and, unfortunately, found that it was all caused by Java 1.8. With 1.7 it seems to be working correctly. So, the issue is there but it seems to be really caused by JDK 1.8 or compatibility of some libraries with JDK 1.8.
Comment 3 Philippe Mouawad 2014-06-06 21:41:42 UTC
Hello,
We fixed an issue with Java8 , see 56080.
Could you make a test with nightly build:
http://jmeter.apache.org/nightly.html


> Installing JMeter runtime
Download the _bin and _lib files
Unpack the archives into the same directory structure
The other archives are not needed to run JMeter.
Comment 4 Nikolai Grigoriev 2014-06-06 21:44:28 UTC
Will try it, thanks for the hint. I was trying to find the matching existing issue before creating new one but could not come up with appropriate keywords :)
Comment 5 Nikolai Grigoriev 2014-06-06 22:07:26 UTC
Indeed it is a duplicate. I only had to replace xstream-1.4.4.jar with xstream-1.4.6.jar to get it working with jdk 1.8.

*** This bug has been marked as a duplicate of bug 56080 ***