jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lybarger <mlybar...@gmail.com>
Subject Re: using a raw object output stream
Date Thu, 04 Apr 2013 18:11:20 GMT
thanks for the feedback.  my "file" is a java properties object which seems
to be be some type of binary stuff.  i'm not sure i can easily store that
off.

i was able to code my test of the server side code by using a BeanShell
sampler and basically copying the client code.  It's only 15 lines or so.



On Thu, Apr 4, 2013 at 10:30 AM, sebb <sebbaz@gmail.com> wrote:

> On 2 April 2013 16:10, Mark Lybarger <mlybarger@gmail.com> wrote:
>
> > I have an applet that has some code to send objects to the server. The
> > sendComand is below. I did a quick record of the traffic with jmeter,
> and i
> > can replay it just nicely, but i cannot figure out how to customize the
> > data that is sent. Can anyone help with ideas on how to test this type of
> > http traffic?
> >
>
> Use the facility to send an entire file as the content:
>
> "If it is a POST or PUT or PATCH request and there is a single file whose
> 'Parameter name' attribute (below) is omitted, then the file is sent as the
> entire body of the request, i.e. no wrappers are added. This allows
> arbitrary bodies to be sent."
>
>
> > Thanks,
> > -mark-
> >
> >  private void sendCommand(URLConnection urlConnection, Properties
> command)
> > throws Exception
> > {
> > urlConnection.setDoInput(true);
> > urlConnection.setDoOutput(true);
> >
> > urlConnection.setUseCaches (false);
> > urlConnection.setDefaultUseCaches (false);
> >
> > // Specify the content type that we will send binary data
> > urlConnection.setRequestProperty ("Content-Type",
> > "application/octet-stream");
> >
> > // Send command
> > ObjectOutputStream objOutputStream = new
> > ObjectOutputStream(urlConnection.getOutputStream());
> > objOutputStream.writeObject(command);
> > objOutputStream.flush();
> > objOutputStream.close();
> > }
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message