Source Code Cross Referenced for WSIF.java in  » Workflow-Engines » wfmopen-2.1.1 » tools » 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 » Workflow Engines » wfmopen 2.1.1 » tools 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is part of the WfMOpen project.
003:         * Copyright (C) 2001-2003 Danet GmbH (www.danet.de), GS-AN.
004:         * All rights reserved.
005:         *
006:         * This program is free software; you can redistribute it and/or modify
007:         * it under the terms of the GNU General Public License as published by
008:         * the Free Software Foundation; either version 2 of the License, or
009:         * (at your option) any later version.
010:         *
011:         * This program is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014:         * GNU General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU General Public License
017:         * along with this program; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
019:         * 
020:         * $Id: WSIF.java,v 1.2 2006/09/29 12:32:08 drmlipp Exp $
021:         *
022:         * $Log: WSIF.java,v $
023:         * Revision 1.2  2006/09/29 12:32:08  drmlipp
024:         * Consistently using WfMOpen as projct name now.
025:         *
026:         * Revision 1.1.1.2  2003/12/19 13:01:45  drmlipp
027:         * Updated to 1.1rc1
028:         *
029:         * Revision 1.8  2003/10/21 21:00:45  lipp
030:         * Moved EJBClientTest to new junit sub-package.
031:         *
032:         * Revision 1.7  2003/10/08 12:39:40  huaiyang
033:         * make test weblogic compatible.
034:         *
035:         * Revision 1.6  2003/06/27 09:44:03  lipp
036:         * Fixed copyright/license information.
037:         *
038:         * Revision 1.5  2003/06/02 14:19:05  huaiyang
039:         * change the check.
040:         *
041:         * Revision 1.4  2003/05/28 15:17:21  huaiyang
042:         * integrate the testWSIF- and testWSIFBasic.xml
043:         *
044:         * Revision 1.3  2003/05/28 13:59:39  huaiyang
045:         * new test of googleSearch.
046:         *
047:         * Revision 1.2  2003/04/16 19:58:49  lipp
048:         * Adapted to jdk 1.4
049:         *
050:         * Revision 1.1  2003/03/26 11:14:34  huaiyang
051:         * initial.
052:         *
053:         *
054:         */
055:        package tools;
056:
057:        import java.util.Iterator;
058:        import java.util.Map;
059:
060:        import junit.framework.Test;
061:        import junit.framework.TestSuite;
062:        import process.WfMOpenTestCase;
063:        import de.danet.an.workflow.api.ProcessDefinitionDirectory;
064:        import de.danet.an.workflow.api.ProcessMgr;
065:        import de.danet.an.workflow.omgcore.WfProcess;
066:        import de.danet.an.util.junit.EJBClientTest;
067:
068:        /**
069:         * Test the tool of WSIFDynamicInvocationTool.
070:         * @author <a href="mailto:weidauer@danet.de">Christian Weidauer</a>
071:         * @version 1.0
072:         */
073:        public class WSIF extends WfMOpenTestCase {
074:            private ProcessDefinitionDirectory pdd = null;
075:
076:            /**
077:             * Constructor of this TestCase
078:             * @param name a <code>String</code> value
079:             */
080:            public WSIF(String name) {
081:                super (name);
082:            }
083:
084:            /**
085:             * Construct this test suite.
086:             * @return a <code>Test</code> value
087:             */
088:            public static Test suite() {
089:                TestSuite suite = new TestSuite();
090:                suite.addTest(new WSIF("importProcessDefinitions"));
091:                // suite.addTest(new WSIF("checkWSIFToolInvocation"));
092:                // suite.addTest(new WSIF("googleSearch"));
093:                suite.addTest(new WSIF("removeProcessDefinition"));
094:                return new EJBClientTest(plc, suite);
095:            }
096:
097:            /**
098:             * Initialisation.
099:             * The <code>setUp</code> method defines the way a state change is 
100:             * realized. Override this method to change this way.
101:             * @exception Exception if an error occurs
102:             */
103:            protected void setUp() throws Exception {
104:                super .setUp();
105:                xpdlFile = "/tools/testWSIF.xml";
106:                System.out.println("xpdlFile = " + xpdlFile);
107:                pdd = workflowService().processDefinitionDirectory();
108:            }
109:
110:            /**
111:             * Test a simple process definition with a simple soap tool invocation. 
112:             * @exception Exception if an error occurs
113:             */
114:            public void checkWSIFToolInvocation() throws Exception {
115:                // create the process
116:                ProcessDefinitionDirectory pdd = workflowService()
117:                        .processDefinitionDirectory();
118:                // dynamic invoke WSIF with WSDL definition as DOM tree.
119:                ProcessMgr pmgr = pdd.processMgr("st-testWSIF", "testWSIF1");
120:                WfProcess process = pmgr.createProcess(defaultRequester());
121:                process.start();
122:                checkResult(process);
123:                // dynamic invoke WSIF with WSDL definition retrieved from URL.
124:                ProcessMgr pmgr2 = pdd.processMgr("st-testWSIF", "testWSIF2");
125:                WfProcess process2 = pmgr2.createProcess(defaultRequester());
126:                process2.start();
127:                checkResult(process2);
128:            }
129:
130:            /**
131:             * Test a soap tool invocation which returns a complex data type of JDOM 
132:             * element. 
133:             * @exception Exception if an error occurs
134:             */
135:            public void googleSearch() throws Exception {
136:                ProcessMgr pmgr3 = pdd.processMgr("st-testWSIF", "testWSIF3");
137:                WfProcess process3 = pmgr3.createProcess(defaultRequester());
138:                process3.start();
139:                Thread.sleep(30000);
140:                Map map = (Map) process3.result();
141:                for (Iterator it2 = map.keySet().iterator(); it2.hasNext();) {
142:                    String name = (String) it2.next();
143:                    System.out.println("name = " + name);
144:                    if (name.equals("searchresult")) {
145:                        String returnResult = (String) map.get(name);
146:                        System.out.println("return = " + returnResult);
147:                    }
148:                }
149:            }
150:
151:            private void checkResult(WfProcess process) throws Exception {
152:                // wait so that invocation of the WSIF tool for the first activity 
153:                // is completed. Wait time is needed for wsdl fetch and wsif dynamic
154:                // calling.
155:                Thread.sleep(10000);
156:                Map map = (Map) process.result();
157:                for (Iterator it2 = map.keySet().iterator(); it2.hasNext();) {
158:                    String name = (String) it2.next();
159:                    if (name.equals("Result")) {
160:                        float stockquote = Float.parseFloat((String) map
161:                                .get(name));
162:                        System.out.println("stockquote of " + name + " = "
163:                                + stockquote);
164:                        assertTrue(stockquote != 0);
165:                    }
166:                }
167:            }
168:
169:            /**
170:             * Test a simple process definition with a simple soap tool invocation. 
171:             * @exception Exception if an error occurs
172:             */
173:            public void removeProcessDefinition() throws Exception {
174:                removeProcessDefinition("st-testWSIF", "testWSIF1");
175:                removeProcessDefinition("st-testWSIF", "testWSIF2");
176:                removeProcessDefinition("st-testWSIF", "testWSIF3");
177:            }
178:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.