I am currently developing a JAVA Serialization sampler. I have 2 issues : 1) My current implementation is a 'clone' of the SoapSampler. The current use is the following 1) Add in lib/ext the JAR of the class you will have to Serialize/Unserialize 2) Do a recording of the scenario with the proxy . The Content-type for the binary types must be set to the Content-type used by the application to send the serialized POST 3) Replace the HTTP Sampler by a Java Serialized sampler 3.1) Load the file POST*.binary ( for example POST9192898739932004659.binary) in the file. It generate the Xstream stream 3.2) Put variable in the Xstream stream When the test plan is run, the java object are dynamically generated In order to automate this process, the proxy should recognize this stream : + The current solution for SamplerCreatorFactory relies on Content-type + The SamplerCreator interface splits between - createSampler : creates the sampler with (currently) only parses the header - populateSampler : fill more fields with a full parsing (header+Body) I could like to create different Sampler not on the content-type basis but on a content basis. For example, for Java Serialized sampler, I would choose to create this sampler with the following pseudo-code isserial=0 if ( content_type is in allowed_content_type_for_Java_ser && request_type == POST){ try{ post_body.readObject() isserial=1 }catch { } if (isserial == 1){ create Java Serial Sampler } so only post with a valid body for Sampler is allowed The disadvantage of this method is that we have to (fully) parse the request to choose the type. What is your preferred method to implement the integration in the proxy ? Regards,
Created attachment 29632 [details] JavaSerializedSampler.java
Created attachment 29633 [details] JavaSerializedSamplerGui.java
Created attachment 29634 [details] Patch
Hi, I completed my first version of the Java Serialization implementation . You can find attached the full patch with : - Specific Sampler - Specific SamplerGui - Specific SamplerCreator which try to recognize the Java Serialized Object and if it fails it calls DefaultSamplerCreator. It is a simple method but it could be better to throw an exception in specific Creator and then use the DefaultSamplerCreator. - Specific message.properties It currently does not contains the documentation. It we want to merge this sampler into HTTP Sampler, I would like to discuss how to define the Gui : + a third panel "Java Serialized Object" with the two first "Parameters" and "Post Body" and integrate into the HTTP Sampler class + Retake the URLConfigGui and extend it with only 2 panels "Parameters" and "Post Body" and having a separate Sampler class Thanks for your comments,
Created attachment 29652 [details] Patch for Java Serialization v1
Niche technology nowadays. Closing as WONTFIX
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2999