aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test/resources/org/aspectj/systemtest/ajc174/ajc174.xml
blob: 456fb412f3d96cb6209c0982384d80c94907083f (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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>

<suite>

	<ajc-test dir="bugs174/ajdt_markers" title="ajdt markers">
		<compile files="Code.java" options="-1.5 -showWeaveInfo">
		</compile>
	</ajc-test>


	<ajc-test dir="bugs174/extra_inserts" title="extra inserts">
		<compile files="Code.java" options="-1.5">
			<message kind="warning" line="8"  text="Call to foo made inside class Bar"/>
			<message kind="warning" line="15" text="Call to foo made inside class Boo"/>
			<message kind="warning" line="8"  text="Call to foo made inside member booble"/>
			<message kind="warning" line="15" text="Call to foo made inside member m"/>
			<message kind="warning" line="8"  text="Call to foo made inside member void Bar.booble()"/>
			<message kind="warning" line="15" text="Call to foo made inside member void Boo.m()"/>
		</compile>
	</ajc-test>

	<ajc-test dir="bugs174/pr419279" title="more configurable lint">
		<compile files="Code.java" options="-1.5">
			<message kind="warning" text="advice defined in Code has not been applied [Xlint:adviceDidNotMatch]"/>
		</compile>
		<compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=ignore">
		</compile>
		<compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=error">
			<message kind="error" text="advice defined in Code has not been applied [Xlint:adviceDidNotMatch]"/>
		</compile>
		<compile files="Code.java" options="-1.5 -Xlint:foo=bar">
			<message kind="error" text="invalid Xlint key: foo"/>
		</compile>
		<compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=wibble">
			<message kind="error" text="invalid Xlint message kind (must be one of ignore, warning, error): wibble"/>
		</compile>
		<compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=ignore{adviceDidNotMatch=error">
			<message kind="error" text="advice defined in Code has not been applied [Xlint:adviceDidNotMatch]"/>
		</compile>
		<compile files="Code.java" options="-1.5 -Xlint:adviceDidNotMatch=error{noGuardForLazyTjp=error">
			<message kind="error" text="advice defined in Code has not been applied [Xlint:adviceDidNotMatch]"/>
			<message kind="error" text="can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]"/>
		</compile>
	</ajc-test>

	<ajc-test dir="bugs174/pr418129" title="annotated itd">
		<compile files="Target.java" options="-1.5 -showWeaveInfo">
			<message kind="weave" text="Type 'Behavior' (Target.java) has intertyped method from 'Trait' (Target.java:'java.lang.String Behavior.hello()')"/>
			<message kind="weave" text="Type 'Target' (Target.java) has intertyped method from 'Trait' (Target.java:'java.lang.String Behavior.hello()')"/>
			<message kind="weave" text="'public java.lang.String Target.hello()' (Target.java) is annotated with @Tagged method annotation from 'Target$A' (Target.java:18)"/>
		</compile>
		<run class="Target">
		<stdout>
		<line text="@Tagged()"/>
		</stdout>
		</run>
	</ajc-test>
	
	<!-- declared with throws exception -->
	<ajc-test dir="bugs174/pr418129" title="annotated itd 2">
		<compile files="Target2.java" options="-1.5 -showWeaveInfo">
			<message kind="weave" text="Type 'Behavior' (Target2.java) has intertyped method from 'Trait' (Target2.java:'java.lang.String Behavior.hello()')"/>
			<message kind="weave" text="Type 'Target2' (Target2.java) has intertyped method from 'Trait' (Target2.java:'java.lang.String Behavior.hello()')"/>
			<message kind="weave" text="'public java.lang.String Target2.hello()' (Target2.java) is annotated with @Tagged method annotation from 'Target2$A' (Target2.java:18)"/>
		</compile>
		<run class="Target2">
		<stdout>
		<line text="@Tagged()"/>
		</stdout>
		</run>
	</ajc-test>
	
	<!-- already annotated with another annotation -->
	<ajc-test dir="bugs174/pr418129" title="annotated itd 3">
		<compile files="Target3.java" options="-1.5 -showWeaveInfo">
			<message kind="weave" text="Type 'Behavior' (Target3.java) has intertyped method from 'Trait' (Target3.java:'java.lang.String Behavior.hello()')"/>
			<message kind="weave" text="Type 'Target3' (Target3.java) has intertyped method from 'Trait' (Target3.java:'java.lang.String Behavior.hello()')"/>
			<message kind="weave" text="'public java.lang.String Target3.hello()' (Target3.java) is annotated with @Tagged method annotation from 'Target3$A' (Target3.java:16)"/>
		</compile>
		<run class="Target3">
		<stdout>
		<line text="2"/>
		<line text="@Wibble()"/>
		<line text="@Tagged()"/>
		</stdout>
		</run>
	</ajc-test>
	
	<!-- already annotated with the same annotation -->
	<ajc-test dir="bugs174/pr418129" title="annotated itd 4">
		<compile files="Target4.java" options="-1.5 -showWeaveInfo">
			<message kind="weave" text="Type 'Behavior' (Target4.java) has intertyped method from 'Trait' (Target4.java:'java.lang.String Behavior.hello()')"/>
			<message kind="weave" text="Type 'Target4' (Target4.java) has intertyped method from 'Trait' (Target4.java:'java.lang.String Behavior.hello()')"/>
			<!--  warning turned off as it gets confusing - when the itd on the interface is hit by a deca -->
			<!-- 
			<message kind="warning" text="java.lang.String Target4.hello() - already has an annotation of type Tagged, cannot add a second instance [Xlint:elementAlreadyAnnotated]"/>
			-->
		</compile>
		<run class="Target4">
		<stdout>
		<line text="1"/>
		<line text="@Tagged(value=31)"/>
		</stdout>
		</run>
	</ajc-test>
	
	<ajc-test dir="bugs174/pr413378" title="super itd ctor">
		<compile files="Code.java" options="-1.5 -showWeaveInfo">
			<message kind="weave" text="Type 'Child' (Code.java) has intertyped constructor from 'MyTest' (Code.java:'void Child.&lt;init&gt;(java.lang.String, int)')"/>
		</compile>
		<run class="Code">
		<stdout>
		<line text="Get Age:50"/>
		<line text="Child Name:Andy"/>
		</stdout>
		</run>
	</ajc-test>
	
	<ajc-test dir="bugs174/pr368046" title="classloader exclusion - 1">
	  <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/>
      <compile files="Code.java" classpath="$sandbox/foo.jar"/>
      <run class="Code" classpath="$sandbox/foo.jar" ltw="aop1.xml">
        <stdout>
          <line text="advice"/>
          <line text="running"/>
 	    </stdout>
 	    <stderr>
 	    <line text="AspectJ Weaver"/>
 	    <line text="register classloader"/>
 	    <line text="using configuration"/>
 	    <line text="register aspect"/>
 	    <line text="processing reweavable"/>
 	    </stderr>
      </run>
	</ajc-test>
	
	<ajc-test dir="bugs174/pr368046" title="classloader exclusion - 2">
	  <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/>
      <compile files="Code.java" classpath="$sandbox/foo.jar"/>
      <run class="Code" classpath="$sandbox/foo.jar" ltw="aop1.xml">
        <stdout>
          <line text="advice"/>
          <line text="running"/>
 	    </stdout>
 	    <stderr>
 	    <line text="AspectJ Weaver"/>
 	    <line text="register classloader"/>
 	    <line text="using configuration"/>
 	    <line text="no longer creating weavers for these classloaders: [foo]"/>
 	    <line text="register aspect"/>
 	    <line text="processing reweavable"/>
 	    </stderr>
      </run>
	</ajc-test>
	
	<ajc-test dir="bugs174/pr368046" title="classloader exclusion - 3">
	  <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/>
      <compile files="Code.java" classpath="$sandbox/foo.jar"/>
      <run class="Code" classpath="$sandbox/foo.jar" ltw="aop1.xml">
        <stdout>
          <line text="advice"/>
          <line text="running"/>
 	    </stdout>
 	    <stderr>
 	    <line text="AspectJ Weaver"/>
 	    <line text="register classloader"/>
 	    <line text="using configuration"/>
 	    <line text="register aspect"/>
 	    <line text="processing reweavable"/>
 	    </stderr>
      </run>
	</ajc-test>
	
	<ajc-test dir="bugs174/pr368046" title="classloader exclusion - 4">
	  <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/>
      <compile files="Code.java" classpath="$sandbox/foo.jar"/>
      <run class="Code" classpath="$sandbox/foo.jar" ltw="aop2.xml">
        <stdout>
          <line text="advice"/>
          <line text="running"/>
 	    </stdout>
 	    <stderr>
 	    <line text="AspectJ Weaver"/>
 	    <line text="register classloader"/>
 	    <line text="using configuration"/>
 	    <line text="no longer creating weavers for these classloaders: [com.foo.Bar]"/>
 	    <line text="register aspect"/>
 	    <line text="processing reweavable"/>
 	    </stderr>
      </run>
	</ajc-test>
	
	<ajc-test dir="bugs174/pr368046" title="classloader exclusion - 5">
	  <compile files="Azpect.java" outjar="foo.jar" options="-1.4"/>
      <compile files="Code.java" classpath="$sandbox/foo.jar"/>
      <run class="Code" classpath="$sandbox/foo.jar" ltw="aop3.xml">
        <stdout>
          <line text="advice"/>
          <line text="running"/>
 	    </stdout>
 	    <stderr>
 	    <line text="AspectJ Weaver"/>
 	    <line text="register classloader"/>
 	    <line text="using configuration"/>
 	    <line text="no longer creating weavers for these classloaders: [org.aspectj.weaver.loadtime.WeavingURLClassLoader]"/>
 	    <line text="register aspect"/>
 	    <line text="processing reweavable"/>
 	    </stderr>
      </run>
	</ajc-test>

</suite>