Hello,

I am trying to building a Simple Java Request to send JMS messages to an application. I read the JMeter user documents, the FAQ and now searching this Mailling list. I still cannot see my AbstractJavaSamplerClient Class into the Java Request Combo box. I did follow the document JMeter Extension Scenario (7.0 Install your extension) by setting the search_paths property.

My class compile all right. I did a jar and drop it under the �/lib/ext� folder (like in the doc).

Is there issues with the classpath or with the search_paths property ?

Is there something more to do then implementing the JavaSamplerClient interface or I have to edit the GuiTest.jmx ?

Thank you

PS : Please don�t tell me to look a SleepTest sample.

//--------- Sample Java Request

public class HvSampler extends AbstractJavaSamplerClient
{

        static private Arguments _arguments;
        static
        {
                _arguments = new Arguments();
                _arguments.addArgument("myArg1",",myValue1");
                _arguments.addArgument("myArg2",",myValue2");
        }

        public Arguments getDefaultParameters()
        {
                return _arguments;
        }
        public void setupTest(JavaSamplerContext context)
        {
                System.out.println("inside setUp");

        }

        public SampleResult runTest(JavaSamplerContext context)
        {
                System.out.println("inside runTest");
                printContext(context);
                try
                {
                        Thread.sleep(2000);
                }
                catch (InterruptedException e){ e.printStackTrace();}
                return getSampleResult();
        }

        public void teardownTest(JavaSamplerContext context)
        {
                System.out.println("inside teadDown");
        }
        private SampleResult getSampleResult()
        {
                SampleResult r = new SampleResult();
                r.setSuccessful(true);
                r.setResponseMessage("coucou");
                return r;
        }
        private void printContext(JavaSamplerContext ctx)
        {
                Iterator iterator = ctx.getParameterNamesIterator();
                System.out.println("SamplerContext :");
                while (iterator.hasNext())
                {
                        String  name= (String) iterator.next();
                        String value = ctx.getParameter(name);
                        System.out.println(name+ "=" + value);
                }
                System.out.println("");
        }
}



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to