Source Code Cross Referenced for TestCaseOptionsAction.java in  » Web-Services » soapui-1.7.5 » com » eviware » soapui » impl » wsdl » actions » testcase » 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.actions.testcase 
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.actions.testcase;
014:
015:        import com.eviware.soapui.impl.wsdl.support.HelpUrls;
016:        import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase;
017:        import com.eviware.soapui.settings.HttpSettings;
018:        import com.eviware.soapui.support.UISupport;
019:        import com.eviware.soapui.support.action.support.AbstractSoapUIAction;
020:        import com.eviware.soapui.support.types.StringToStringMap;
021:        import com.eviware.x.form.XForm;
022:        import com.eviware.x.form.XFormDialog;
023:        import com.eviware.x.form.XFormDialogBuilder;
024:        import com.eviware.x.form.XFormFactory;
025:        import com.eviware.x.form.XFormField;
026:        import com.eviware.x.form.XFormFieldListener;
027:        import com.eviware.x.form.XForm.FieldType;
028:
029:        /**
030:         * Options dialog for testcases
031:         * 
032:         * @author Ole.Matzura
033:         */
034:
035:        public class TestCaseOptionsAction extends
036:                AbstractSoapUIAction<WsdlTestCase> {
037:            private static final String KEEP_SESSION = "Session";
038:            private static final String FAIL_ON_ERROR = "Abort on Error";
039:            private static final String FAIL_TESTCASE_ON_ERROR = "Fail TestCase on Error";
040:            private static final String DISCARD_OK_RESULTS = "Discard OK Results";
041:            private static final String SOCKET_TIMEOUT = "Socket timeout";
042:            private static final String SEARCH_PROPERTIES = "Search Properties";
043:            public static final String SOAPUI_ACTION_ID = "TestCaseOptionsAction";
044:
045:            private XFormDialog dialog;
046:            private XForm form;
047:
048:            public TestCaseOptionsAction() {
049:                super ("Options", "Sets options for this TestCase");
050:            }
051:
052:            public void perform(WsdlTestCase testCase, Object param) {
053:                if (dialog == null) {
054:                    XFormDialogBuilder builder = XFormFactory
055:                            .createDialogBuilder("TestCase Options");
056:                    form = builder.createForm("Basic");
057:                    form.addCheckBox(SEARCH_PROPERTIES,
058:                            "Search preceding teststeps for property values");
059:                    form.addCheckBox(KEEP_SESSION, "Maintain HTTP session");
060:                    form.addCheckBox(FAIL_ON_ERROR, "Fail on error")
061:                            .addFormFieldListener(new XFormFieldListener() {
062:
063:                                public void valueChanged(
064:                                        XFormField sourceField,
065:                                        String newValue, String oldValue) {
066:                                    form
067:                                            .getFormField(
068:                                                    FAIL_TESTCASE_ON_ERROR)
069:                                            .setEnabled(
070:                                                    !Boolean
071:                                                            .parseBoolean(newValue));
072:                                }
073:                            });
074:
075:                    form.addCheckBox(FAIL_TESTCASE_ON_ERROR,
076:                            "Fail TestCase if it has failed TestSteps");
077:                    form
078:                            .addCheckBox(DISCARD_OK_RESULTS,
079:                                    "Discards successfull testresults to preserve memory");
080:                    form.addTextField(SOCKET_TIMEOUT,
081:                            "Socket timeout in milliseconds", FieldType.TEXT);
082:
083:                    dialog = builder
084:                            .buildDialog(
085:                                    builder
086:                                            .buildOkCancelHelpActions(HelpUrls.TESTCASEOPTIONS_HELP_URL),
087:                                    "Specify general options for this TestCase",
088:                                    UISupport.OPTIONS_ICON);
089:                }
090:
091:                StringToStringMap values = new StringToStringMap();
092:
093:                values.put(SEARCH_PROPERTIES, String.valueOf(testCase
094:                        .getSearchProperties()));
095:                values.put(KEEP_SESSION, String.valueOf(testCase
096:                        .getKeepSession()));
097:                values.put(FAIL_ON_ERROR, String.valueOf(testCase
098:                        .getFailOnError()));
099:                values.put(FAIL_TESTCASE_ON_ERROR, String.valueOf(testCase
100:                        .getFailTestCaseOnErrors()));
101:                values.put(DISCARD_OK_RESULTS, String.valueOf(testCase
102:                        .getDiscardOkResults()));
103:                values.put(SOCKET_TIMEOUT, String.valueOf(testCase
104:                        .getSettings().getString(HttpSettings.SOCKET_TIMEOUT,
105:                                "")));
106:
107:                dialog.getFormField(FAIL_TESTCASE_ON_ERROR).setEnabled(
108:                        !Boolean.parseBoolean(String.valueOf(testCase
109:                                .getFailOnError())));
110:
111:                values = dialog.show(values);
112:
113:                if (dialog.getReturnValue() == XFormDialog.OK_OPTION) {
114:                    try {
115:                        testCase.setSearchProperties(Boolean
116:                                .parseBoolean(values.get(SEARCH_PROPERTIES)));
117:                        testCase.setKeepSession(Boolean.parseBoolean(values
118:                                .get(KEEP_SESSION)));
119:                        testCase.setDiscardOkResults(Boolean
120:                                .parseBoolean(values.get(DISCARD_OK_RESULTS)));
121:                        testCase.setFailOnError(Boolean.parseBoolean(values
122:                                .get(FAIL_ON_ERROR)));
123:                        testCase.setFailTestCaseOnErrors(Boolean
124:                                .parseBoolean(values
125:                                        .get(FAIL_TESTCASE_ON_ERROR)));
126:                        String timeout = values.get(SOCKET_TIMEOUT);
127:                        if (timeout.trim().length() == 0)
128:                            testCase.getSettings().clearSetting(
129:                                    HttpSettings.SOCKET_TIMEOUT);
130:                        else
131:                            testCase.getSettings().setString(
132:                                    HttpSettings.SOCKET_TIMEOUT, timeout);
133:                    } catch (Exception e1) {
134:                        UISupport.showErrorMessage(e1.getMessage());
135:                    }
136:                }
137:            }
138:        }
www__.j_ava___2___s__.__c___om___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.