Skip to content
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

serialized test elements lose some properties #3383

Closed
asfimport opened this issue Jun 6, 2014 · 5 comments
Closed

serialized test elements lose some properties #3383

asfimport opened this issue Jun 6, 2014 · 5 comments

Comments

@asfimport
Copy link
Collaborator

Nikolai Grigoriev (Bug 56602):
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.

Severity: normal
OS: All

Duplicated by:

@asfimport
Copy link
Collaborator Author

Nikolai Grigoriev (migrated from Bugzilla):
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.

Created attachment dummy-2.9.jmx: Dummy test with ViewResultsFullVisualizer

dummy-2.9.jmx
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.4" jmeter="2.9 r1437961">
  <hashTree>
    <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>
      <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"></stringProp>
    </TestPlan>
    <hashTree>
      <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
        <boolProp name="ResultCollector.error_logging">false</boolProp>
        <objProp>
          <name>saveConfig</name>
          <value class="SampleSaveConfiguration">
            <time>true</time>
            <latency>true</latency>
            <timestamp>true</timestamp>
            <success>true</success>
            <label>true</label>
            <code>true</code>
            <message>true</message>
            <threadName>true</threadName>
            <dataType>true</dataType>
            <encoding>false</encoding>
            <assertions>true</assertions>
            <subresults>true</subresults>
            <responseData>false</responseData>
            <samplerData>false</samplerData>
            <xml>false</xml>
            <fieldNames>false</fieldNames>
            <responseHeaders>false</responseHeaders>
            <requestHeaders>false</requestHeaders>
            <responseDataOnError>false</responseDataOnError>
            <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
            <assertionsResultsToSave>0</assertionsResultsToSave>
            <bytes>true</bytes>
          </value>
        </objProp>
        <stringProp name="TestPlan.comments">test</stringProp>
        <stringProp name="filename"></stringProp>
      </ResultCollector>
      <hashTree/>
    </hashTree>
  </hashTree>
</jmeterTestPlan>

@asfimport
Copy link
Collaborator Author

Nikolai Grigoriev (migrated from Bugzilla):
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.

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
Hello,
We fixed an issue with Java8 , see #3310.
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.

@asfimport
Copy link
Collaborator Author

Nikolai Grigoriev (migrated from Bugzilla):
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 :)

@asfimport
Copy link
Collaborator Author

Nikolai Grigoriev (migrated from Bugzilla):
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 #3310

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant