Source Code Cross Referenced for ModelUtilTests.java in  » IDE-Eclipse » jdt » org » eclipse » jdt » compiler » apt » tests » 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 » IDE Eclipse » jdt » org.eclipse.jdt.compiler.apt.tests 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*******************************************************************************
02:         * Copyright (c) 2007 BEA Systems, Inc.
03:         * All rights reserved. This program and the accompanying materials
04:         * are made available under the terms of the Eclipse Public License v1.0
05:         * which accompanies this distribution, and is available at
06:         * http://www.eclipse.org/legal/epl-v10.html
07:         *
08:         * Contributors:
09:         *    wharley@bea.com - initial API and implementation
10:         *******************************************************************************/package org.eclipse.jdt.compiler.apt.tests;
11:
12:        import java.io.File;
13:        import java.io.IOException;
14:        import java.util.ArrayList;
15:        import java.util.List;
16:
17:        import javax.tools.JavaCompiler;
18:        import javax.tools.ToolProvider;
19:
20:        import junit.framework.TestCase;
21:
22:        /**
23:         * 
24:         */
25:        public class ModelUtilTests extends TestCase {
26:            // Processor class names; see corresponding usage in the processor classes.
27:            private static final String ELEMENTUTILSPROC = "org.eclipse.jdt.compiler.apt.tests.processors.elementutils.ElementUtilsProc";
28:            private static final String TYPEUTILSPROC = "org.eclipse.jdt.compiler.apt.tests.processors.typeutils.TypeUtilsProc";
29:
30:            @Override
31:            protected void setUp() throws Exception {
32:                super .setUp();
33:                BatchTestUtils.init();
34:            }
35:
36:            /**
37:             * Validate the testElements test against the javac compiler.
38:             * @throws IOException 
39:             */
40:            public void testElementsWithSystemCompiler() throws IOException {
41:                JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
42:                internalTest(compiler, ELEMENTUTILSPROC);
43:            }
44:
45:            /**
46:             * Test the Elements utility implementation.
47:             * @throws IOException 
48:             */
49:            public void testElementsWithEclipseCompiler() throws IOException {
50:                JavaCompiler compiler = BatchTestUtils.getEclipseCompiler();
51:                internalTest(compiler, ELEMENTUTILSPROC);
52:            }
53:
54:            /**
55:             * Validate the testTypes test against the javac compiler.
56:             * @throws IOException 
57:             */
58:            public void testTypesWithSystemCompiler() throws IOException {
59:                JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
60:                internalTest(compiler, TYPEUTILSPROC);
61:            }
62:
63:            /**
64:             * Test the Types utility implementation.
65:             * @throws IOException 
66:             */
67:            public void testTypesWithEclipseCompiler() throws IOException {
68:                JavaCompiler compiler = BatchTestUtils.getEclipseCompiler();
69:                internalTest(compiler, TYPEUTILSPROC);
70:            }
71:
72:            /**
73:             * Test functionality by running a particular processor against the types in
74:             * resources/targets.  The processor must support "*" (the set of all annotations) 
75:             * and must report its errors or success via the methods in BaseProcessor.
76:             * @throws IOException
77:             */
78:            private void internalTest(JavaCompiler compiler,
79:                    String processorClass) throws IOException {
80:                System.clearProperty(processorClass);
81:                File targetFolder = TestUtils.concatPath(BatchTestUtils
82:                        .getSrcFolderName(), "targets", "model");
83:                BatchTestUtils.copyResources("targets/model", targetFolder);
84:
85:                List<String> options = new ArrayList<String>();
86:                options.add("-A" + processorClass);
87:                BatchTestUtils.compileTree(compiler, options, targetFolder);
88:
89:                // If it succeeded, the processor will have set this property to "succeeded";
90:                // if not, it will set it to an error value.
91:                assertEquals("succeeded", System.getProperty(processorClass));
92:            }
93:
94:            @Override
95:            protected void tearDown() throws Exception {
96:                super.tearDown();
97:            }
98:
99:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.