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 java.util.ArrayList;
    16  import java.util.List;
    17
    18  import com.eviware.soapui.impl.wsdl.teststeps.WsdlMessageAssertion;
    19  import com.eviware.soapui.support.action.SoapUIActionMapping;
    20  import com.eviware.soapui.support.action.SoapUIActionRegistry.SeperatorAction;
    21  import com.eviware.soapui.support.action.support.DefaultActionMapping;
    22  import com.eviware.soapui.support.action.support.DefaultSoapUIActionGroup;
    23
    24  /***
    25   * SoapUIActionGroup for a WsdlMessageAssertion
    26   *
    27   * @author ole.matzura
    28   */
    29
    30  public class WsdlMessageAssertionSoapUIActionGroup extends DefaultSoapUIActionGroup<WsdlMessageAssertion>
    31  {
    32  	public WsdlMessageAssertionSoapUIActionGroup( String id, String name )
    33  	{
    34  		super( id, name );
    35  	}
    36
    37  	@Override
    38  	public List<SoapUIActionMapping<WsdlMessageAssertion>> getActionMappings( WsdlMessageAssertion modelItem )
    39  	{
    40  		List<SoapUIActionMapping<WsdlMessageAssertion>> actions = super.getActionMappings( modelItem );
    41  		List<SoapUIActionMapping<WsdlMessageAssertion>> result = new ArrayList<SoapUIActionMapping<WsdlMessageAssertion>>(actions);
    42
    43  		int index = 0;
    44
    45  		if( modelItem.isConfigurable() )
    46  		{
    47  			DefaultActionMapping<WsdlMessageAssertion> actionMapping = new DefaultActionMapping<WsdlMessageAssertion>(
    48  						ConfigureAssertionAction.SOAPUI_ACTION_ID, "ENTER", null, true, modelItem );
    49
    50  			actionMapping.setName( "Configure" );
    51  			actionMapping.setDescription( "Configures this Assertion" );
    52
    53  			result.add( 0, actionMapping);
    54  			index++;
    55  		}
    56
    57  		if( modelItem.isClonable() )
    58  		{
    59  			DefaultActionMapping<WsdlMessageAssertion> actionMapping = new DefaultActionMapping<WsdlMessageAssertion>(
    60  						CloneAssertionAction.SOAPUI_ACTION_ID, "F9", null, true, modelItem );
    61
    62  			result.add( 1, actionMapping);
    63  			index++;
    64  		}
    65
    66  		result.add( 1, SeperatorAction.getDefaultMapping() );
    67
    68  		return result;
    69  	}
    70  }