https://issues.apache.org/bugzilla/show_bug.cgi?id=54205

            Bug ID: 54205
           Summary: Add Java Serialization sampler
           Product: JMeter
           Version: 2.8
          Hardware: PC
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: HTTP
          Assignee: issues@jmeter.apache.org
          Reporter: etienne.carri...@gmail.com
    Classification: Unclassified

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,

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to