Hello,
I found out :) The solution is really simple : into the modifyElement, just
call the super.configureTestElement method and that's done !!!
Regards,
Cedric
On Fri, May 9, 2008 at 11:57 AM, sebb <[EMAIL PROTECTED]> wrote:
> On 06/05/2008, Cédric Tabin <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> >
> > > I'm currently working on JMeter and I'm implementing my own GUI
> classes
> > > with my own Assertion classes. My problem is that JMeter doesn't add
> > > automatically the 'guiclass' propety into the jmx file when I save
> it....
> > > You'll find below my classes.
>
> The getGUI_CLASS() is not used by JMeter.
>
> I suggest you start by copying an existing Assertion class and modify
> that to suit.
>
> BTW, what are you trying to achieve with the class?
>
> > >
> > > Thanks & best regards,
> > > Cedric
> > >
> > >
> > >
> //----------------------------------------------------------------------------------------------------------------------------------------
> > > package com.sai;
> > >
> > > import org.apache.jmeter.assertions.Assertion;
> > > import org.apache.jmeter.assertions.AssertionResult;
> > > import org.apache.jmeter.samplers.SampleResult;
> > > import org.apache.jmeter.testelement.AbstractTestElement;
> > > import org.apache.jmeter.testelement.TestElement;
> > >
> > > public class AssertionBasicTest extends AbstractTestElement implements
> > > Assertion, TestElement
> > > {
> > >
> > > public AssertionResult getResult(SampleResult result) {
> > > AssertionResult ar = new AssertionResult("test assertion");
> > > String data = new String(result.getResponseData());
> > > System.out.println("Response data : "+data);
> > > ar.setFailureMessage("Test de failure");
> > > ar.setFailure(true);
> > > return ar;
> > > }
> > >
> > > public static String getGUI_CLASS() {
> > > return "com.sai.AssertionSamplerTest";
> > > }
> > > }
> > >
> > >
> > >
> > >
> //----------------------------------------------------------------------------------------------------------------------------------------
> > > package com.sai;
> > >
> > > import java.awt.BorderLayout;
> > > import javax.swing.Box;
> > > import org.apache.jmeter.assertions.ResponseAssertion;
> > > import org.apache.jmeter.assertions.SizeAssertion;
> > > import org.apache.jmeter.assertions.gui.AbstractAssertionGui;
> > > import org.apache.jmeter.gui.GUIFactory;
> > > import org.apache.jmeter.testelement.TestElement;
> > >
> > > public class AssertionSamplerTest extends AbstractAssertionGui
> > > {
> > > public AssertionSamplerTest()
> > > {
> > > init();
> > > }
> > >
> > >
> > > public String getLabelResource() {
> > > return "samplelabel";
> > > }
> > >
> > > private void init()
> > > {
> > > setLayout(new BorderLayout());
> > > setBorder(makeBorder());
> > > Box box = Box.createVerticalBox();
> > > box.add(makeTitlePanel());
> > > add(box,BorderLayout.NORTH);
> > > }
> > >
> > > public TestElement createTestElement() {
> > > return new AssertionBasicTest();
> > > }
> > >
> > > public void modifyTestElement(TestElement element) {
> > > element.setName("FailureSample");
> > > }
> > >
> > > @Override
> > > public void configure(TestElement element) {
> > > super.configure(element);
> > > }
> > > }
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>