aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test/resources/org/aspectj/systemtest/ajc164/declareMixin.xml
blob: 00a3fcdcd1e3a49cb879472bb32dea99f5680b07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>

<suite>

   <ajc-test dir="features164/declareMixin" title="casea">
     <compile files="CaseA.java" options="-1.8"/>
     <run class="CaseA">
       <stdout>
         <line text="Delegate factory invoked"/>
         <line text="methodOne running"/>
       </stdout>
     </run>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="caseb">
     <compile files="CaseB.java" options="-1.8"/>
     <run class="CaseB">
       <stdout>
         <line text="Delegate factory invoked"/>
         <line text="methodOne running"/>
       </stdout>
     </run>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="casec">
     <compile files="CaseC.java" options="-1.8"/>
     <run class="CaseC">
       <stdout>
         <line text="Delegate factory invoked for CaseC instance"/>
         <line text="methodOne running"/>
       </stdout>
     </run>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="cased">
     <compile files="CaseD.java" options="-1.8"/>
     <run class="CaseD">
       <stdout>
         <line text="Delegate factory invoked for CaseD instance"/>
         <line text="methodOne running"/>
       </stdout>
     </run>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="casee">
     <compile files="CaseE.java" options="-1.8"/>
     <run class="CaseE">
       <stdout>
         <line text="Delegate factory invoked for CaseE instance: a"/>
         <line text="methodOne running on CaseE instance: a"/>
         <line text="Delegate factory invoked for CaseE instance: b"/>
         <line text="methodTwo running on CaseE instance: b"/>
         <line text="methodOne running on CaseE instance: a"/>
         <line text="methodTwo running on CaseE instance: b"/>
       </stdout>
     </run>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="casee_concurrent">
     <compile files="CaseEConcurrent.java" options="-1.8"/>
     <run class="CaseEConcurrent">
       <stdout ordered="no">
         <!--
           Without the concurrency fix from https://github.com/eclipse-aspectj/aspectj/issues/198, each delegate factory
           would be invoked twice
         -->
         <line text="Delegate factory invoked for CaseEConcurrent instance: a"/>
         <line text="Delegate factory invoked for CaseEConcurrent instance: b"/>
         <line text="methodOne running on CaseEConcurrent instance: a"/>
         <line text="methodTwo running on CaseEConcurrent instance: a"/>
         <line text="methodOne running on CaseEConcurrent instance: b"/>
         <line text="methodTwo running on CaseEConcurrent instance: b"/>
       </stdout>
     </run>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="casef">
     <compile files="CaseF.java" options="-1.8"/>
     <run class="CaseF">
       <stdout>
         <line text="Delegate factory invoked for CaseF instance"/>
         <line text="methodOne running"/>
       </stdout>
     </run>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="caseg">
     <compile files="CaseG.java" options="-1.8"/>
     <run class="CaseG">
       <stdout>
         <line text="Delegate factory invoked for instance of A"/>
         <line text="run() executing on behalf of A"/>
         <line text="Delegate factory invoked for instance of B"/>
         <line text="run() executing on behalf of B"/>
       </stdout>
     </run>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="caseh">
     <compile files="CaseH.java" options="-1.8">
         <message kind="error" text="The value for annotation attribute DeclareMixin"/>
     </compile>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="casei">
     <compile files="CaseI.java" options="-1.8">
         <message kind="error" text="Types listed in the 'interfaces'"/>
     </compile>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="casej">
     <compile files="CaseJ.java" options="-1.8">
         <message kind="error" text="createImplementation1"/>
         <message kind="error" text="Method 'int X.createImplementation2(java.lang.Object)':  factory methods "/>
     </compile>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="casek">
     <compile files="CaseK.java" options="-1.8">
         <message kind="error" text="factory methods for a mixin can take a maximum of one parameter"/>
     </compile>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="casel">
     <compile files="CaseL.java" options="-1.8">
       <message kind="error" text="Cannot cast from CaseL to C"/>
     </compile>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="casem">
     <compile files="CaseM.java" options="-1.8">
       <message kind="error" text=": factory methods for a mixin must either return an interface type or specify interfaces in the annotation and return a class"/>
     </compile>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="casen">
     <compile files="CaseN.java" options="-1.8"/>
     <run class="CaseN">
       <stdout>
         <line text="foo() running"/>
       </stdout>
     </run>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="caseo">
     <compile files="CaseO.java" options="-1.8">
       <message kind="error" text="factory method does not return something that implements 'I'"/>
     </compile>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="casep">
     <compile files="CaseP.java" options="-1.8"/>
     <run class="CaseP">
       <stdout>
         <line text="foo() running"/>
       </stdout>
     </run>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="caseq">
     <compile files="CaseQ.java" options="-1.8"/>
     <run class="CaseQ">
       <stdout>
         <line text="foo() running"/>
         <line text="goo() running"/>
       </stdout>
     </run>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="caser">
     <compile files="CaseR.java" options="-1.8"/>
     <run class="CaseR">
       <stdout>
         <line text="true"/>
         <line text="false"/>
       </stdout>
     </run>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="cases">
     <compile files="CaseS.java" options="-1.8">
       <message kind="error" text="not compatible"/>
     </compile>
   </ajc-test>

   <ajc-test dir="features164/declareMixin" title="caset">
     <compile files="CaseT.java" options="-1.8 -showWeaveInfo">
       <message kind="weave" text="Mixing interface 'I' (CaseT.java) into type 'CaseT' (CaseT.java)"/>
     </compile>
   </ajc-test>
</suite>