View Javadoc

    1   /*
    2    *  soapUI, copyright (C) 2004-2007 eviware.com
    3    *
    4    *  soapUI is free software; you can redistribute it and/or modify it under the
    5    *  terms of version 2.1 of the GNU Lesser General Public License as published by
    6    *  the Free Software Foundation.
    7    *
    8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
    9    *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    10   *  See the GNU Lesser General Public License for more details at gnu.org.
    11   */
    12
    13  package com.eviware.soapui.impl.wsdl.teststeps.actions;
    14
    15  import com.eviware.soapui.impl.wsdl.teststeps.WsdlMessageAssertion;
    16  import com.eviware.soapui.support.action.SoapUIActionRegistry.SeperatorAction;
    17  import com.eviware.soapui.support.action.support.DefaultActionMapping;
    18  import com.eviware.soapui.support.action.support.DefaultSoapUIActionGroup;
    19  import com.eviware.soapui.support.action.support.SoapUIActionMappingList;
    20
    21  /***
    22   * SoapUIActionGroup for a WsdlMessageAssertion
    23   *
    24   * @author ole.matzura
    25   */
    26
    27  public class WsdlMessageAssertionSoapUIActionGroup extends DefaultSoapUIActionGroup<WsdlMessageAssertion>
    28  {
    29  	public WsdlMessageAssertionSoapUIActionGroup( String id, String name )
    30  	{
    31  		super( id, name );
    32  	}
    33
    34  	@Override
    35  	public SoapUIActionMappingList<WsdlMessageAssertion> getActionMappings( WsdlMessageAssertion modelItem )
    36  	{
    37  		SoapUIActionMappingList<WsdlMessageAssertion> actions = super.getActionMappings( modelItem );
    38  		SoapUIActionMappingList<WsdlMessageAssertion> result = new SoapUIActionMappingList<WsdlMessageAssertion>(actions);
    39
    40  		int index = 0;
    41
    42  		if( modelItem.isConfigurable() )
    43  		{
    44  			DefaultActionMapping<WsdlMessageAssertion> actionMapping = new DefaultActionMapping<WsdlMessageAssertion>(
    45  						ConfigureAssertionAction.SOAPUI_ACTION_ID, "ENTER", null, true, null );
    46
    47  			actionMapping.setName( "Configure" );
    48  			actionMapping.setDescription( "Configures this Assertion" );
    49
    50  			result.add( 0, actionMapping);
    51  			index++;
    52  		}
    53
    54  		if( modelItem.isClonable() )
    55  		{
    56  			DefaultActionMapping<WsdlMessageAssertion> actionMapping = new DefaultActionMapping<WsdlMessageAssertion>(
    57  						CloneAssertionAction.SOAPUI_ACTION_ID, "F9", null, true, null );
    58
    59  			result.add( 1, actionMapping);
    60  			index++;
    61  		}
    62
    63  		result.add( 1, SeperatorAction.getDefaultMapping() );
    64
    65  		return result;
    66  	}
    67  }