aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/org/aspectj/systemtest/ajc174/ajc174.xml
blob: 5b47cf4d35c495d9f6ee54ae401812b7945e4e95 (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
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>

<suite>

	<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"/>
      <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"/>
      <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"/>
      <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"/>
      <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"/>
      <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>