Source Code Cross Referenced for J2EEVersionGenerator.java in  » Testing » mockrunner-0.4 » com » mockrunner » gen » 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 » Testing » mockrunner 0.4 » com.mockrunner.gen 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.mockrunner.gen;
002:
003:        import java.util.HashMap;
004:        import java.util.Map;
005:
006:        import com.mockrunner.gen.proc.JavaLineProcessor;
007:
008:        public class J2EEVersionGenerator {
009:            public static void main(String[] args) throws Exception {
010:                VersionGenerator generator = new VersionGenerator(
011:                        prepareProcessorMapJ2EE13(), getGeneratorNameJ2EE13(),
012:                        getRootTargetDirJ2EE13(), getRootSourceDir(),
013:                        getProcessedPackagesJ2EE13());
014:                generator.doSynchronize();
015:                generator = new VersionGenerator(prepareProcessorMapJ2EE14(),
016:                        getGeneratorNameJ2EE14(), getRootTargetDirJ2EE14(),
017:                        getRootSourceDir(), getProcessedPackagesJ2EE14());
018:                generator.doSynchronize();
019:            }
020:
021:            private static String getGeneratorNameJ2EE13() {
022:                return "Web J2EE1.3";
023:            }
024:
025:            private static String getGeneratorNameJ2EE14() {
026:                return "Web J2EE1.4";
027:            }
028:
029:            private static String getRootTargetDirJ2EE13() {
030:                return "srcj2ee1.3";
031:            }
032:
033:            private static String getRootTargetDirJ2EE14() {
034:                return "srcj2ee1.4";
035:            }
036:
037:            private static String getRootSourceDir() {
038:                return "src";
039:            }
040:
041:            private static String[] getProcessedPackagesJ2EE13() {
042:                return new String[] { "com/mockrunner/tag",
043:                        "com/mockrunner/mock/web" };
044:            }
045:
046:            private static String[] getProcessedPackagesJ2EE14() {
047:                return new String[] { "com/mockrunner/mock/web" };
048:            }
049:
050:            private static Map prepareProcessorMapJ2EE13() {
051:                Map webFiles = new HashMap();
052:
053:                webFiles.putAll(prepareProcessorMapJ2EE14());
054:
055:                JavaLineProcessor mockPageContextProc = getProcessorForClass(
056:                        "com.mockrunner.mock.web.MockPageContext", webFiles);
057:                mockPageContextProc
058:                        .addLine("import javax.servlet.jsp.el.ExpressionEvaluator;");
059:                mockPageContextProc
060:                        .addLine("import javax.servlet.jsp.el.VariableResolver;");
061:                mockPageContextProc
062:                        .addLine("private ExpressionEvaluator evaluator;");
063:                mockPageContextProc
064:                        .addLine("private VariableResolver resolver;");
065:                mockPageContextProc
066:                        .addLine("evaluator = new MockExpressionEvaluator();");
067:                mockPageContextProc
068:                        .addLine("resolver = new MockVariableResolver();");
069:                mockPageContextProc
070:                        .addBlock("public void setExpressionEvaluator(ExpressionEvaluator evaluator)");
071:                mockPageContextProc
072:                        .addBlock("public void setVariableResolver(VariableResolver resolver)");
073:                mockPageContextProc
074:                        .addBlock("public ExpressionEvaluator getExpressionEvaluator()");
075:                mockPageContextProc
076:                        .addBlock("public VariableResolver getVariableResolver()");
077:
078:                JavaLineProcessor mockRequestProc = getProcessorForClass(
079:                        "com.mockrunner.mock.web.MockHttpServletRequest",
080:                        webFiles);
081:                mockRequestProc
082:                        .addLine("import javax.servlet.ServletRequestAttributeEvent;");
083:                mockRequestProc
084:                        .addLine("import javax.servlet.ServletRequestAttributeListener;");
085:                mockRequestProc.addLine("private List attributeListener;");
086:                mockRequestProc.addLine("attributeListener = new ArrayList();");
087:                mockRequestProc
088:                        .addLine("callAttributeListenersRemovedMethod(key, value);");
089:                mockRequestProc
090:                        .addLine("handleAttributeListenerCalls(key, value, oldValue);");
091:                mockRequestProc
092:                        .addBlock("public void addAttributeListener(ServletRequestAttributeListener listener)");
093:                mockRequestProc
094:                        .addBlock("private void handleAttributeListenerCalls(String key, Object value, Object oldValue)");
095:                mockRequestProc
096:                        .addBlock("private void callAttributeListenersAddedMethod(String key, Object value)");
097:                mockRequestProc
098:                        .addBlock("private void callAttributeListenersReplacedMethod(String key, Object value)");
099:                mockRequestProc
100:                        .addBlock("private void callAttributeListenersRemovedMethod(String key, Object value)");
101:                mockRequestProc
102:                        .addBlock("private ServletContext getServletContext()");
103:
104:                JavaLineProcessor nestedTagProc = getProcessorForClass(
105:                        "com.mockrunner.tag.NestedTag", webFiles);
106:                nestedTagProc
107:                        .addLine("import javax.servlet.jsp.tagext.JspTag;");
108:                nestedTagProc.addLine("public JspTag getWrappedTag();");
109:                nestedTagProc
110:                        .addLine("public NestedTag addTagChild(JspTag tag);");
111:                nestedTagProc
112:                        .addLine("public NestedTag addTagChild(JspTag tag, Map attributeMap);");
113:
114:                JavaLineProcessor nestedStandardTagProc = getProcessorForClass(
115:                        "com.mockrunner.tag.NestedStandardTag", webFiles);
116:                nestedStandardTagProc
117:                        .addLine("import javax.servlet.jsp.tagext.JspTag;");
118:                nestedStandardTagProc
119:                        .addLine("import javax.servlet.jsp.tagext.SimpleTag;");
120:                nestedStandardTagProc.addBlock("public JspTag getWrappedTag()");
121:                nestedStandardTagProc
122:                        .addBlock("public NestedTag addTagChild(JspTag tag)");
123:                nestedStandardTagProc
124:                        .addBlock("public NestedTag addTagChild(JspTag tag, Map attributeMap)");
125:                nestedStandardTagProc
126:                        .addBlock("else if(child instanceof SimpleTag)");
127:                nestedStandardTagProc
128:                        .addBlock("else if(childTag instanceof SimpleTag)");
129:
130:                JavaLineProcessor nestedBodyTagProc = getProcessorForClass(
131:                        "com.mockrunner.tag.NestedBodyTag", webFiles);
132:                nestedBodyTagProc
133:                        .addLine("import javax.servlet.jsp.tagext.JspTag;");
134:                nestedBodyTagProc
135:                        .addLine("import javax.servlet.jsp.tagext.SimpleTag;");
136:                nestedBodyTagProc.addBlock("public JspTag getWrappedTag()");
137:                nestedBodyTagProc
138:                        .addBlock("public NestedTag addTagChild(JspTag tag)");
139:                nestedBodyTagProc
140:                        .addBlock("public NestedTag addTagChild(JspTag tag, Map attributeMap)");
141:                nestedBodyTagProc
142:                        .addBlock("else if(child instanceof SimpleTag)");
143:                nestedBodyTagProc
144:                        .addBlock("else if(childTag instanceof SimpleTag)");
145:
146:                JavaLineProcessor tagTestModuleProc = getProcessorForClass(
147:                        "com.mockrunner.tag.TagTestModule", webFiles);
148:                tagTestModuleProc
149:                        .addLine("import javax.servlet.jsp.tagext.JspTag;");
150:                tagTestModuleProc
151:                        .addBlock("public JspTag createWrappedTag(Class tagClass)");
152:                tagTestModuleProc
153:                        .addBlock("public JspTag createWrappedTag(Class tagClass, Map attributes)");
154:                tagTestModuleProc
155:                        .addBlock("public NestedTag setTag(JspTag tag)");
156:                tagTestModuleProc
157:                        .addBlock("public NestedTag setTag(JspTag tag, Map attributes)");
158:                tagTestModuleProc.addBlock("public JspTag getWrappedTag()");
159:                tagTestModuleProc.addBlock("public void doTag()");
160:                tagTestModuleProc.addBlock("if(isSimpleTag())");
161:                tagTestModuleProc.addBlock("private boolean isSimpleTag()");
162:
163:                JavaLineProcessor tagTestAdapterProc = getProcessorForClass(
164:                        "com.mockrunner.tag.TagTestCaseAdapter", webFiles);
165:                tagTestAdapterProc
166:                        .addLine("import javax.servlet.jsp.tagext.JspTag;");
167:                tagTestAdapterProc
168:                        .addBlock("protected JspTag createWrappedTag(Class tagClass)");
169:                tagTestAdapterProc
170:                        .addBlock("protected JspTag createWrappedTag(Class tagClass, Map attributes)");
171:                tagTestAdapterProc.addBlock("protected JspTag getWrappedTag()");
172:                tagTestAdapterProc
173:                        .addBlock("protected NestedTag setTag(JspTag tag)");
174:                tagTestAdapterProc
175:                        .addBlock("protected NestedTag setTag(JspTag tag, Map attributes)");
176:                tagTestAdapterProc.addBlock("protected void doTag()");
177:                webFiles.put("com.mockrunner.tag.BasicTagTestCaseAdapter",
178:                        tagTestAdapterProc);
179:
180:                JavaLineProcessor tagUtilProc = getProcessorForClass(
181:                        "com.mockrunner.tag.TagUtil", webFiles);
182:                tagUtilProc.addLine("import javax.servlet.jsp.JspContext;");
183:                tagUtilProc
184:                        .addLine("import javax.servlet.jsp.tagext.DynamicAttributes;");
185:                tagUtilProc
186:                        .addLine("import javax.servlet.jsp.tagext.SimpleTag;");
187:                tagUtilProc.addBlock("else if(tag instanceof SimpleTag)");
188:                tagUtilProc
189:                        .addBlock("private static void checkJspContext(Object pageContext)");
190:                tagUtilProc
191:                        .addBlock("Object currentValue = attributes.get(currentName);");
192:                tagUtilProc
193:                        .addBlock("else if(tag instanceof DynamicAttributes)");
194:                tagUtilProc
195:                        .addBlock("private static void populateDynamicAttribute(Object tag, String name, DynamicAttribute attribute) throws JspException");
196:                tagUtilProc
197:                        .addBlock("else if(nextChild instanceof NestedSimpleTag)");
198:                tagUtilProc
199:                        .addBlock("else if(pageContext instanceof JspContext)");
200:
201:                webFiles.put("com.mockrunner.tag.DynamicAttribute",
202:                        Boolean.FALSE);
203:                webFiles.put("com.mockrunner.tag.NestedSimpleTag",
204:                        Boolean.FALSE);
205:
206:                webFiles.put("com.mockrunner.mock.web.MockVariableResolver",
207:                        Boolean.FALSE);
208:                webFiles.put("com.mockrunner.mock.web.MockFunctionMapper",
209:                        Boolean.FALSE);
210:                webFiles.put("com.mockrunner.mock.web.MockJspFragment",
211:                        Boolean.FALSE);
212:                webFiles.put("com.mockrunner.mock.web.MockExpression",
213:                        Boolean.FALSE);
214:                webFiles.put("com.mockrunner.mock.web.MockExpressionEvaluator",
215:                        Boolean.FALSE);
216:
217:                return webFiles;
218:            }
219:
220:            private static Map prepareProcessorMapJ2EE14() {
221:                Map webFiles = new HashMap();
222:
223:                JavaLineProcessor mockPageContextProc = getProcessorForClass(
224:                        "com.mockrunner.mock.web.MockPageContext", webFiles);
225:                mockPageContextProc.addLine("import javax.el.ELContext;");
226:                mockPageContextProc.addLine("private ELContext elContext;");
227:                mockPageContextProc
228:                        .addBlock("public void setELContext(ELContext elContext)");
229:                mockPageContextProc.addBlock("public ELContext getELContext()");
230:
231:                JavaLineProcessor mockJspFactoryProc = getProcessorForClass(
232:                        "com.mockrunner.mock.web.MockJspFactory", webFiles);
233:                mockJspFactoryProc
234:                        .addLine("import javax.servlet.jsp.JspApplicationContext;");
235:                mockJspFactoryProc
236:                        .addLine("private JspApplicationContext applicationContext;");
237:                mockJspFactoryProc
238:                        .addBlock("public void setJspApplicationContext(JspApplicationContext applicationContext)");
239:                mockJspFactoryProc
240:                        .addBlock("public JspApplicationContext getJspApplicationContext(ServletContext context)");
241:
242:                webFiles.put("com.mockrunner.mock.web.JasperJspFactory",
243:                        Boolean.FALSE);
244:
245:                return webFiles;
246:            }
247:
248:            private static JavaLineProcessor getProcessorForClass(
249:                    String className, Map jdbcFiles) {
250:                JavaLineProcessor processor = (JavaLineProcessor) jdbcFiles
251:                        .get(className);
252:                if (null == processor) {
253:                    processor = new JavaLineProcessor();
254:                    jdbcFiles.put(className, processor);
255:                }
256:                return processor;
257:            }
258:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.