KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ch > ethz > prose > AbstractExtensionTest


1 // $Id: AbstractExtensionTest.java,v 1.2 2004/05/12 17:26:50 anicoara Exp $
2
// =====================================================================
3
//
4
// (history at end)
5
//
6

7 package ch.ethz.prose;
8
9 // used packages
10
import java.util.List JavaDoc;
11
12 import junit.framework.*;
13 import ch.ethz.prose.crosscut.*;
14 import ch.ethz.prose.filter.PointCutter;
15
16 /**
17  * JUnit testcase for class DefaultAspect (Black).
18  *
19  * @version $Revision: 1.2 $
20  * @author Andrei Popovici
21  */

22 public
23 class AbstractExtensionTest extends TestCase {
24
25   //fixture
26
List JavaDoc cross1 = null;
27   List JavaDoc cross2 = null;
28   DefaultAspect exampleExt1 = new DefaultAspect()
29   {
30   };
31
32   DefaultAspect exampleExt2 = new DefaultAspect() {
33       Crosscut c1 = new MethodCut() {
34           public void METHOD_ARGS() {}
35
36           protected PointCutter pointCutter() { return null;}
37       };
38
39       Crosscut c2 = new MethodCut() {
40           void METHOD_ARGS(ANY thisObj, REST params) {}
41
42           protected PointCutter pointCutter() { return null;}
43       };
44   };
45
46   /**
47    * Construct test with given name.
48    * @param name test name
49    */

50   public AbstractExtensionTest(String JavaDoc name)
51   {
52     super(name);
53   }
54
55   /**
56    * Set up fixture.
57    */

58   protected void setUp()
59   {
60     cross1 = exampleExt1.getCrosscuts();
61     cross2 = exampleExt2.getCrosscuts();
62   }
63
64   protected void tearDown()
65   {
66   }
67
68   // test whether the extension produces correct crosscuts
69
public void testCrosscuts()
70   {
71     assertNotNull(cross1);
72     assertTrue("crosscut 1 has no elements", cross1.isEmpty());
73
74     assertNotNull(cross2);
75     assertTrue("crosscut has 2 methods",cross2.size() == 2);
76   }
77
78   /**
79    * Test suite.
80    * @return test instance
81    */

82   public static Test suite()
83   {
84     return new TestSuite(AbstractExtensionTest.class);
85   }
86
87
88 }
89
90
91 //======================================================================
92
//
93
// $Log: AbstractExtensionTest.java,v $
94
// Revision 1.2 2004/05/12 17:26:50 anicoara
95
// Adapt Junit tests to 3.8.1 version and the new package structure
96
//
97
// Revision 1.1.1.1 2003/07/02 15:30:42 apopovic
98
// Imported from ETH Zurich
99
//
100
// Revision 1.1 2003/05/05 14:02:33 popovici
101
// renaming from runes to prose
102
//
103
// Revision 1.11 2003/04/27 13:08:41 popovici
104
// Specializers renamed to PointCutter
105
//
106
// Revision 1.10 2003/04/17 15:43:47 popovici
107
// crosscuts renamed to 'getCrosscuts'
108
// createCrosscuts renamed to 'crosscuts'
109
//
110
// Revision 1.9 2003/04/17 15:15:01 popovici
111
// Extension->Aspect renaming
112
//
113
// Revision 1.8 2003/04/17 12:49:38 popovici
114
// Refactoring of the crosscut package
115
// ExceptionCut renamed to ThrowCut
116
// McutSignature is now SignaturePattern
117
//
118
// Revision 1.7 2003/04/17 08:46:42 popovici
119
// Important functionality additions
120
// - Cflow specializers
121
// - Restructuring of the MethodCut, SetCut, ThrowCut, and GetCut (they are much smaller)
122
// - Transactional capabilities
123
// - Total refactoring of Specializer evaluation, which permits fine-grained distinction
124
// between static and dynamic specializers.
125
// - Functionality pulled up in abstract classes
126
// - Uniformization of advice methods patterns and names
127
//
128
// Revision 1.6 2003/03/05 08:31:22 popovici
129
// Bug fix afeer import organization
130
//
131
// Revision 1.5 2003/03/04 18:36:06 popovici
132
// Organization of imprts
133
//
134
// Revision 1.4 2002/06/06 14:39:54 popovici
135
// Renamings: FunctionalCrosscut->MethodCut
136
// AllFields->SetCut
137
// SetCu.fieldModiticationAdvice -> SetCut.setAdvice
138
//
139
// Revision 1.3 2002/06/04 12:36:09 popovici
140
// AllLocations occurences replaced with FunctionalCrosscut
141
//
142
// Revision 1.2 2002/02/05 11:20:02 smarkwal
143
// modifications to test JVMAI-based implementation
144
//
145
// Revision 1.1.1.1 2001/11/29 18:13:30 popovici
146
// Sources from runes
147
//
148
// Revision 1.1.2.1 2000/10/24 17:59:51 popovici
149
// Initial Revision
150
//
151
Popular Tags