Extending soapUI with plugins, soapUI

My previous post showed you how to create a custom TestStep in soapUI harboring some of many extension mechanisms available. My main gripe with the post after it was done was how hard it was to distribute the actual plugin; a bunch of files that all had to be saved to different folders to get it all working correctly. This bothered me to the extent that I sat down and created support for a simple plugin file format in soapUI allowing you to package up your extensions/listeners/factories/resources into one file which you conveniently can drop in a “plugins” folder under the soapUI bin folder. Let’s have a quick look at the format and how the EmailTestStep is packaged with it.

The Plugin File Format

The format is simple – it’s basically a jar file containing the classes that are needed for the plugin together with a number of configuration files that would otherwise have to be dropped into the file system:

  • META-INF/factories.xml : should contain all factory definitions
  • META-INF/listeners.xml : should contain all custom listeners
  • META-INF/actions.xml : should contain all custom actions

Any images/icons required by your plugin can be put in here as well which make them available to the UISupport.createImageIcon( path ) method. 

The EmailTestStep Plugin

The EmailTestStep plugin thus contains the following files:

  • soapui/demo/testeps/email/EMailTestStep.class
  • soapui/demo/testeps/email/EMailTestStepDesktopPanel$1.class
  • soapui/demo/testeps/email/EMailTestStepDesktopPanel$2.class
  • soapui/demo/testeps/email/EMailTestStepDesktopPanel$3.class
  • soapui/demo/testeps/email/EMailTestStepDesktopPanel.class
  • soapui/demo/testeps/email/EMailTestStepFactory.class
  • soapui/demo/testeps/email/EMailTestStepPanelBuilderFactoryl$EMailTestStepPanelBuilder.class
  • soapui/demo/testeps/email/EMailTestStepPanelBuilderFactoryl.class
  • META-INF/factories.xml : the emailteststep-factories.xml file
  • META-INF/actions.xml : the emailteststep-actions.xml file
  • email.png – the icon used for the TestStep

If we drop this jar (named emailteststep-plugin.jar) in the soapUIbinplugins folder the plugin will be picked up just as before, which you can see in the soapUI log:

 

  • Wed Feb 01 22:47:29 CET 2012:INFO:Adding plugin from [C:workspacesoapui-pro-4.0.2-maintenancepluginsemailteststep-plugin.jar]
  • Wed Feb 01 22:47:29 CET 2012:INFO:Adding factory [class soapui.demo.teststeps.email.EMailTestStepFactory]
  • Wed Feb 01 22:47:29 CET 2012:INFO:Adding factory [class soapui.demo.teststeps.email.EMailTestStepPanelBuilderFactory] 

Building this jar file from a corresponding eclipse project was straight forward. Here is the project layout:

(The “Referenced Libraries” folder contains all libraries in the soapUIlib and soapUIbin folders)

Exporting the plugin as a jar file from within eclipse (Use the FileExport…) option will create the jar seen at the bottom of the above screenshot, ready to be deployed in your soapUI installation.

Wrap-up

That’s it! Be sure to download the latest nightly build to get the above plugin-support and download the emailteststep-plugin.jar and save it to a <soapUI>binplugins folder before you start soapUI – that’s all that’s needed to start using this new TestStep.

As always, Thank you for your time!

/Ole

 

 

Comments

  1. Dave Miles says:

    The download link of http://blog.smartbear.com/Files/emailteststep-plugin.jar for the plugin gives a file not found page then a re-direct. Could it be fixed please? Also will this example work for any version of SoapUI (pro or oss)? Thanks.

  2. Prashant Kaw says:

    Hi Dave, 
     
    Apologies for the 404 – broke when we moved our blog.  
     
    I’ve fixed the link to the downloadable file. You can download it from the article or here: http://support.smartbear.com/Files/emailteststep-plugin.jar&nbsp;
     
    I’ve asked for an internal expert to get back to you on the Pro vs. OSS version question. 
     
    /Prashant 
    @bloggerbear

  3. Dave: It will work for all versions of soapUI.

  4. Sharon Tam says:

    Hi, I am using soapUI 4.5.1. I have trouble getting soapUI to unmarshall my custom classes. My custom java classes all implement Externalizable interface. I get this error: 
    Thu May 09 15:31:02 EDT 2013:ERROR:An error occured [flex.messaging.io.SerializationException: Class 'flex.messaging.io.amf.ASObject' must implement java.io.Externalizable to receive client IExternalizable instances.], see error log for details 
    Thu May 09 15:31:02 EDT 2013:INFO:Error getting response for [Logon]; ClientStatusException  
    message: flex.messaging.io.SerializationException: Class ‘flex.messaging.io.amf.ASObject’ must implement java.io.Externalizable to receive client IExternalizable instances. 
    code: AMFConnection.Call.Failed 
     
     
    it will understand my custom class and output if I change it to implement Serializable. It doesn’t seem soapUI uses the readExternal() from my custom classes. Can you please tell me what I need to do in order to soapUI to work with my custom classes that implement Externalizable interface?  
     
    Thanks a lot 
    Sharon

  5. Hi Sharon, 
     
    If you are a SoapUI Pro customer then please get in touch with our Support team to help you with this, otherwise I suggest you post this on the open-source suppor forum at http://forum.soapui.org/viewforum.php?f=5 to see if you get some help there… 
     
    Good Luck! 
     
    /Ole 
    SmartBear Software

Speak Your Mind

*