Source Code Cross Referenced for WsdlTestStep.java in  » Web-Services » soapui-1.7.5 » com » eviware » soapui » impl » wsdl » teststeps » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Services » soapui 1.7.5 » com.eviware.soapui.impl.wsdl.teststeps 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  soapUI, copyright (C) 2004-2007 eviware.com 
003:         *
004:         *  soapUI is free software; you can redistribute it and/or modify it under the 
005:         *  terms of version 2.1 of the GNU Lesser General Public License as published by 
006:         *  the Free Software Foundation.
007:         *
008:         *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
009:         *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
010:         *  See the GNU Lesser General Public License for more details at gnu.org.
011:         */
012:
013:        package com.eviware.soapui.impl.wsdl.teststeps;
014:
015:        import java.util.ArrayList;
016:        import java.util.Collection;
017:        import java.util.HashMap;
018:        import java.util.HashSet;
019:        import java.util.Map;
020:        import java.util.Set;
021:
022:        import com.eviware.soapui.config.TestStepConfig;
023:        import com.eviware.soapui.impl.wsdl.AbstractWsdlModelItem;
024:        import com.eviware.soapui.impl.wsdl.WsdlInterface;
025:        import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase;
026:        import com.eviware.soapui.model.PanelBuilder;
027:        import com.eviware.soapui.model.testsuite.TestRunContext;
028:        import com.eviware.soapui.model.testsuite.TestRunner;
029:        import com.eviware.soapui.model.testsuite.TestStep;
030:        import com.eviware.soapui.model.testsuite.TestStepProperty;
031:
032:        /**
033:         * Base class for WSDL TestCase test steps.
034:         *  
035:         * @author Ole.Matzura
036:         */
037:
038:        abstract public class WsdlTestStep extends
039:                AbstractWsdlModelItem<TestStepConfig> implements  TestStep {
040:            private final WsdlTestCase testCase;
041:            private Map<String, TestStepProperty> properties;
042:            private Set<WsdlTestStepListener> listeners = new HashSet<WsdlTestStepListener>();
043:            private final boolean forLoadTest;
044:            private final boolean hasEditor;
045:
046:            protected WsdlTestStep(WsdlTestCase testCase,
047:                    TestStepConfig config, boolean hasEditor,
048:                    boolean forLoadTest) {
049:                super (config, testCase, null);
050:
051:                this .testCase = testCase;
052:                this .hasEditor = hasEditor;
053:                this .forLoadTest = forLoadTest;
054:            }
055:
056:            public boolean hasEditor() {
057:                return hasEditor;
058:            }
059:
060:            public boolean isForLoadTest() {
061:                return forLoadTest;
062:            }
063:
064:            /**
065:             * Called after creation of all teststeps, should be used for inter-test-step initializations
066:             * @param config 
067:             */
068:
069:            public void postInit(TestStepConfig config) {
070:            }
071:
072:            protected PanelBuilder createPanelBuilder() {
073:                return null;
074:            }
075:
076:            public WsdlTestCase getTestCase() {
077:                return testCase;
078:            }
079:
080:            /**
081:             * Called from WsdlTestCase when moving a teststep due to no move functionality
082:             * in xmlbeans generated arrays. 
083:             * 
084:             * @param config the new config to use, will be a copy of the existing one. The current
085:             * will be invalid
086:             */
087:
088:            public void resetConfigOnMove(TestStepConfig config) {
089:                setConfig(config);
090:            }
091:
092:            public boolean cancel() {
093:                return false;
094:            }
095:
096:            public String[] getPropertyNames() {
097:                if (properties == null)
098:                    return new String[0];
099:
100:                String[] result = new String[properties.size()];
101:                int ix = 0;
102:                for (TestStepProperty property : properties.values())
103:                    result[ix++] = property.getName();
104:
105:                return result;
106:            }
107:
108:            public TestStepProperty getProperty(String name) {
109:                return properties == null || name == null ? null : properties
110:                        .get(name.toUpperCase());
111:            }
112:
113:            public String getPropertyValue(String name) {
114:                if (properties == null)
115:                    return null;
116:
117:                TestStepProperty testStepProperty = properties.get(name
118:                        .toUpperCase());
119:                return testStepProperty == null ? null : testStepProperty
120:                        .getValue();
121:            }
122:
123:            public void setPropertyValue(String name, String value) {
124:                if (properties == null)
125:                    return;
126:
127:                TestStepProperty testStepProperty = properties.get(name
128:                        .toUpperCase());
129:                if (testStepProperty != null) {
130:                    testStepProperty.setValue(value);
131:                }
132:            }
133:
134:            protected void addProperty(TestStepProperty property) {
135:                if (properties == null)
136:                    properties = new HashMap<String, TestStepProperty>();
137:
138:                properties.put(property.getName().toUpperCase(), property);
139:            }
140:
141:            protected void deleteProperty(String name) {
142:                if (properties != null)
143:                    properties.remove(name.toUpperCase());
144:            }
145:
146:            protected void propertyRenamed(String oldName) {
147:                if (properties == null)
148:                    return;
149:
150:                TestStepProperty testStepProperty = properties.get(oldName
151:                        .toUpperCase());
152:                if (testStepProperty == null)
153:                    return;
154:
155:                properties.remove(oldName.toUpperCase());
156:                String newName = testStepProperty.getName();
157:                properties.put(newName.toUpperCase(), testStepProperty);
158:
159:                firePropertyRenamed(oldName, newName);
160:            }
161:
162:            public void addTestStepListener(WsdlTestStepListener listener) {
163:                listeners.add(listener);
164:            }
165:
166:            public void removeTestStepListener(WsdlTestStepListener listener) {
167:                listeners.remove(listener);
168:            }
169:
170:            protected void firePropertyAdded(String name) {
171:                WsdlTestStepListener[] array = listeners
172:                        .toArray(new WsdlTestStepListener[listeners.size()]);
173:                for (WsdlTestStepListener listener : array) {
174:                    listener.propertyAdded(name);
175:                }
176:            }
177:
178:            protected void firePropertyRemoved(String name) {
179:                WsdlTestStepListener[] array = listeners
180:                        .toArray(new WsdlTestStepListener[listeners.size()]);
181:                for (WsdlTestStepListener listener : array) {
182:                    listener.propertyRemoved(name);
183:                }
184:            }
185:
186:            protected void firePropertyRenamed(String oldName, String newName) {
187:                WsdlTestStepListener[] array = listeners
188:                        .toArray(new WsdlTestStepListener[listeners.size()]);
189:                for (WsdlTestStepListener listener : array) {
190:                    listener.propertyRenamed(oldName, newName);
191:                }
192:            }
193:
194:            protected void firePropertyValueChanged(String name,
195:                    String oldValue, String newValue) {
196:                if (oldValue == null && newValue == null)
197:                    return;
198:
199:                if (oldValue != null && oldValue.equals(newValue))
200:                    return;
201:
202:                if (newValue != null && newValue.equals(oldValue))
203:                    return;
204:
205:                WsdlTestStepListener[] array = listeners
206:                        .toArray(new WsdlTestStepListener[listeners.size()]);
207:                for (WsdlTestStepListener listener : array) {
208:                    listener.propertyValueChanged(name, oldValue, newValue);
209:                }
210:            }
211:
212:            public boolean dependsOn(AbstractWsdlModelItem modelItem) {
213:                return false;
214:            }
215:
216:            public String getTestStepTitle() {
217:                return getTestCase().getTestSuite().getName() + "#"
218:                        + getTestCase().getName();
219:            }
220:
221:            /**
222:             * Called after cloning for custom behaviour
223:             * 
224:             * @param sourceStep step we were cloned from
225:             */
226:
227:            public WsdlTestStep clone(WsdlTestCase targetTestCase, String name) {
228:                onSave();
229:                TestStepConfig newConfig = (TestStepConfig) getConfig().copy();
230:                newConfig.setName(name);
231:                return targetTestCase.addTestStep(newConfig);
232:            }
233:
234:            public void finish(TestRunner testRunner,
235:                    TestRunContext testRunContext) {
236:            }
237:
238:            public void prepare(TestRunner testRunner,
239:                    TestRunContext testRunContext) throws Exception {
240:            }
241:
242:            public Collection<WsdlInterface> getRequiredInterfaces() {
243:                return new ArrayList<WsdlInterface>();
244:            }
245:
246:            public boolean isDisabled() {
247:                return getConfig().getDisabled();
248:            }
249:
250:            public void setDisabled(boolean disabled) {
251:                boolean oldDisabled = isDisabled();
252:
253:                if (disabled)
254:                    getConfig().setDisabled(disabled);
255:                else
256:                    getConfig().unsetDisabled();
257:
258:                notifyPropertyChanged(DISABLED_PROPERTY, oldDisabled, disabled);
259:            }
260:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.