Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-jmeter Wiki" 
for change notification.

The following page has been changed by Mikko Ohtamaa:
http://wiki.apache.org/jakarta-jmeter/BuildingPlugInWithEclipse

------------------------------------------------------------------------------
  = Building JMeter plug-in with Eclipse =
  
  Targetted to Eclipse 3.1 and JMeter 2.1 trunk version. JMeter isn't designed 
to be edited from Eclipse IDE, so some work has to be done before we get wheels 
running.
+ 
+ == Building JMeter from sources with Eclipse ==
+ 
+ It's useful to have JMeter Eclipse project in hand, since you need to do 
debugging and possible bug fixing of JMeter.
  
  1. Check out JMeter trunk from Subversion 
    * Get Subclipse plug-in for Eclipse http://subclipse.tigris.org/
@@ -64, +68 @@

  
     * Now Eclipse should build JMeter without errors (stop icons in source 
tree)
  
+ == Setting up plug-in project ==
+ 
+ This project will build your custom components and launch JMeter so that it 
will find them.
+ 
- 3. Set up your custom plug-in project
+ 1. Set up your custom plug-in project
     * Create a new Java project
     * Add jmeter-trunk to project dependencies
     * Create bin/ and src/ folders
@@ -96, +104 @@

  log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
  }}}
  
- 4. Setting up a JMeter launcher
+ 2. Setting up a JMeter launcher
     * Set working directory to bin/ in your project
         * JMeter is hard coded to look up ''jmeter.properties'' in the launch 
folder
         * E.g. ${workspace_loc:SIPPerformanceStresser/bin}
@@ -105, +113 @@

     * Main class: org.apache.jmeter.NewDriver
     * 
  
+ == Creating components ==
+ 
+ JMeter 2.x uses its internal TestBean-framework for adding new components. 
+ 
+ For each component you need
+ 1. An element class which interits from [TestElement, ConfigurationElement, 
XXXElement] and implements TestBean interface. TestBean interface marks classes 
which JMeter plug-in class loader loads automatically.
+ 2. Each TestBean class needs BeanInfoSupport class whichs describes the 
properties of the element class
+ 3. Properties file which gives out user interface strings for properties
+ 
+ Example:
+ 
+ * Here are some examples with some dummy non-working implemenation details
+ * fi.xxx.jmeter.sip.core.SIPReceiver implements TestBean extends 
AbstractSampler
+ 
+ {{{
+ package fi.xxx.jmeter.sip.core;
+ 
+ import org.apache.jmeter.samplers.AbstractSampler;
+ import org.apache.jmeter.samplers.Entry;
+ import org.apache.jmeter.samplers.SampleResult;
+ import org.apache.jmeter.testbeans.TestBean;
+ 
+ public class SIPReceiver extends AbstractSampler implements TestBean {
+ 
+       public SampleResult sample(Entry e) {
+               return null;
+       }
+ 
+ }
+ 
+ }}}
+ 
+ * fi.xxx.jmeter.sip.core.SIPReceiverBeanInfoSupport extends BeanInfoSupport
+ 
+ {{{
+ 
+ package fi.xxx.jmeter.sip.core;
+ 
+ import java.beans.PropertyDescriptor;
+ 
+ import org.apache.jmeter.config.CSVDataSet;
+ import org.apache.jmeter.testbeans.BeanInfoSupport;
+ 
+ public class SIPReceiverBeanInfoSupport extends BeanInfoSupport {
+       
+       public SIPReceiverBeanInfoSupport() {
+               super(SIPReceiver.class);
+               
+               createPropertyGroup("sip_receiver", new String[] { "filename", 
"variableNames", "delimiter" });
+               PropertyDescriptor p = property("filename");
+               p.setValue(NOT_UNDEFINED, Boolean.TRUE);
+               p.setValue(DEFAULT, "");
+               p.setValue(NOT_EXPRESSION, Boolean.TRUE);
+               p = property("variableNames");
+               p.setValue(NOT_UNDEFINED, Boolean.TRUE);
+               p.setValue(DEFAULT, "");
+               p.setValue(NOT_EXPRESSION, Boolean.TRUE);
+               p = property("delimiter");
+               p.setValue(NOT_UNDEFINED, Boolean.TRUE);
+               p.setValue(DEFAULT, ",");
+               p.setValue(NOT_EXPRESSION, Boolean.TRUE);
+       }
+ }
+ 
+ 
+ }}}
+ 
+ * fi/xxx/jmeter/sip/core/SIPreceiver.properties
+ 
+ {{{
+ 
+ displayName=SIP Receiver
+ sip_receiver.displayName=Configure SIP receiver
+ filename.displayName=Filename
+ filename.shortDescription=Name of the file (within your supporting file 
directory) that holds cvs data
+ variableNames.displayName=Variable Names (comma-delimited)
+ variableNames.shortDescription=List your variable names in order to match the 
order of columns in your csv data.  Separate by commas.
+ delimiter.displayName=Delimiter (use '\\t' for tab)
+ delimiter.shortDescription=Enter the delimiter ('\\t' for tab)
+ 
+ }}}
  
  
  == Notes ==

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

Reply via email to