01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * 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
31: DefaultSoapUIActionGroup<WsdlMessageAssertion> {
32: public WsdlMessageAssertionSoapUIActionGroup(String id, String name) {
33: super (id, name);
34: }
35:
36: @Override
37: public List<SoapUIActionMapping<WsdlMessageAssertion>> getActionMappings(
38: WsdlMessageAssertion modelItem) {
39: List<SoapUIActionMapping<WsdlMessageAssertion>> actions = super
40: .getActionMappings(modelItem);
41: List<SoapUIActionMapping<WsdlMessageAssertion>> result = new ArrayList<SoapUIActionMapping<WsdlMessageAssertion>>(
42: actions);
43:
44: int index = 0;
45:
46: if (modelItem.isConfigurable()) {
47: DefaultActionMapping<WsdlMessageAssertion> actionMapping = new DefaultActionMapping<WsdlMessageAssertion>(
48: ConfigureAssertionAction.SOAPUI_ACTION_ID, "ENTER",
49: null, true, modelItem);
50:
51: actionMapping.setName("Configure");
52: actionMapping.setDescription("Configures this Assertion");
53:
54: result.add(0, actionMapping);
55: index++;
56: }
57:
58: if (modelItem.isClonable()) {
59: DefaultActionMapping<WsdlMessageAssertion> actionMapping = new DefaultActionMapping<WsdlMessageAssertion>(
60: CloneAssertionAction.SOAPUI_ACTION_ID, "F9", null,
61: true, modelItem);
62:
63: result.add(1, actionMapping);
64: index++;
65: }
66:
67: result.add(1, SeperatorAction.getDefaultMapping());
68:
69: return result;
70: }
71: }
|