Source Code Cross Referenced for CFlowTest.java in  » Aspect-oriented » aspectwerkz-2.0 » test » 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 » Aspect oriented » aspectwerkz 2.0 » test 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**************************************************************************************
002:         * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved.                 *
003:         * http://aspectwerkz.codehaus.org                                                    *
004:         * ---------------------------------------------------------------------------------- *
005:         * The software in this package is published under the terms of the LGPL license      *
006:         * a copy of which has been included with this distribution in the license.txt file.  *
007:         **************************************************************************************/package test;
008:
009:        import junit.framework.TestCase;
010:
011:        /**
012:         * test "pc AND (cf OR cf2)"
013:         *
014:         * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr</a>
015:         * @author <a href="mailto:alex@gnilux.com">Alexandre Vasseur </a>
016:         */
017:        public class CFlowTest extends TestCase implements  Loggable {
018:            private String m_logString = "";
019:
020:            public CFlowTest(String name) {
021:                super (name);
022:            }
023:
024:            public void testCallWithinCFlow() {
025:                m_logString = "";
026:                step1(); //will have cflow and will call step2()
027:                assertEquals("step1 advice-before step2 advice-after ",
028:                        m_logString);
029:            }
030:
031:            public void testCallWithinCFlowAnonymous() {
032:                m_logString = "";
033:                step1Anonymous(); //will have cflow and will call step2()
034:                assertEquals(
035:                        "step1Anonymous advice-beforeAnonymous step2Anonymous advice-afterAnonymous ",
036:                        m_logString);
037:            }
038:
039:            public void testCallWithinCFlowWithinCflow() {
040:                m_logString = "";
041:                step1_A(); //will have cflow and will call step1_B that will call step2_B()
042:                assertEquals(
043:                        "step1_A step1_B advice-before2 step2_B advice-after2 ",
044:                        m_logString);
045:            }
046:
047:            public void testCallOutsideCFlow() {
048:                m_logString = "";
049:                step2();
050:                assertEquals("step2 ", m_logString);
051:            }
052:
053:            public void testCallWithinCFlow_B() {
054:                m_logString = "";
055:                step1_B(); //will have cflow and will call step2_B() but is NOT in step1_A cflow
056:                assertEquals("step1_B step2_B ", m_logString);
057:            }
058:
059:            public void testCallOutsideCFlowAnonymous() {
060:                m_logString = "";
061:                step2Anonymous();
062:                assertEquals("step2Anonymous ", m_logString);
063:            }
064:
065:            public void testCflowOnMySelfForPrecedence() {
066:                m_logString = "";
067:                cflowOnMyself();
068:                assertEquals("cflowOnMyself advice-cflowOnMyself ", m_logString);
069:            }
070:
071:            //    //FIXME: see the aspect, pc is deactivated - see AW-251
072:            //    public void testCallWithinNotCFlow_C() {
073:            //        m_logString = "";
074:            //        step1_C(); //will have "NOT cflow" and will call step2_C
075:            //        assertEquals("step1_C step2_C ", m_logString);
076:            //        m_logString = "";
077:            //        step2_C(); //should be advised since not in step1_C cflow
078:            //        assertEquals("advice-beforeC step2_C advice-afterC ", m_logString);
079:            //    }
080:
081:            public static void main(String[] args) {
082:                junit.textui.TestRunner.run(suite());
083:            }
084:
085:            public static junit.framework.Test suite() {
086:                return new junit.framework.TestSuite(CFlowTest.class);
087:            }
088:
089:            // ==== methods to test ====
090:            public void log(final String wasHere) {
091:                m_logString += wasHere;
092:            }
093:
094:            public void step1() {
095:                log("step1 ");
096:                step2();
097:            }
098:
099:            public void step1Anonymous() {
100:                log("step1Anonymous ");
101:                step2Anonymous();
102:            }
103:
104:            public void step1_B() {
105:                log("step1_B ");
106:                step2_B();
107:            }
108:
109:            public void step1_A() {
110:                log("step1_A ");
111:                step1_B();
112:            }
113:
114:            public void step2() {
115:                log("step2 ");
116:            }
117:
118:            public void step2Anonymous() {
119:                log("step2Anonymous ");
120:            }
121:
122:            public void step2_B() {
123:                log("step2_B ");
124:            }
125:
126:            public void step1_C() {
127:                log("step1_C ");
128:                step2_C();
129:            }
130:
131:            public void step2_C() {
132:                log("step2_C ");
133:            }
134:
135:            public void cflowOnMyself() {
136:                log("cflowOnMyself ");
137:            }
138:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.