aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/ataspectj/ajc-ant.xml
blob: f69cfd4dd59f472c0870af75bee86dd3691f6fbd (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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
<!-- ajc-ant script, not to be used from Ant commant line - see AntSpec -->
<project name="ltw" default="RunThemAllWithJavacCompiledAndLTW">

    <!-- using this we can debug the forked VM -->
    <property
        name="jdwp"
        value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"/>

    <target name="RunThemAllWithJavacCompiledAndLTW" depends="compile:javac, ltw"/>

    <target name="compile:javac">
        <!-- compile only javac compilable stuff, exclude the one that needs other dependencies -->
        <javac source="1.7" target="1.7" destdir="${aj.sandbox}" classpathref="aj.path"
            srcdir="${basedir}"
            includes="ataspectj/*"
            excludes="ataspectj/UnweavableTest.java"
            debug="true">
        </javac>
    </target>

    <target name="ltw">
        <java fork="yes" classname="ataspectj.AllLTWTests" failonerror="yes">
            <classpath refid="aj.path"/>
            <!-- use META-INF/aop.xml style -->
            <classpath path="ataspectj/pathentry"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
<!--            <jvmarg line="${jdwp}"/>-->
        </java>
    </target>

    <target name="ltw.PerClauseTest">
        <copy file="ataspectj/aop-perclausetest.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"/>
        <java fork="yes" classname="ataspectj.PerClauseTest" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
<!--            <jvmarg line="${jdwp}"/>            -->
        </java>
    </target>

    <target name="ltw.AroundInlineMungerTest">
        <copy file="${aj.root}/tests/java5/ataspectj/ataspectj/aop-aroundinlinemungertest.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"/>
        <java fork="yes" classname="ataspectj.AroundInlineMungerTest" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
            <!--<jvmarg line="${jdwp}"/>--><!-- uncomment to debug with JDWP -->
        </java>
    </target>

    <target name="ltw.AroundInlineMungerTest2">
        <copy file="${aj.root}/tests/java5/ataspectj/ataspectj/aop-aroundinlinemungertest2.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"/>
        <java fork="yes" classname="ataspectj.AroundInlineMungerTest2" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
        </java>
    </target>

    <target name="ltw.DumpTest">
        <java fork="yes" classname="ataspectj.DumpTest" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
        </java>
    </target>

    <target name="ltw.DumpProxyTest">
        <copy file="ataspectj/aop-dumpproxy.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"/>
        <java fork="yes" classname="ataspectj.TestProxyGenerator" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
        </java>
    </target>

    <target name="ltw.Aspect2MainTest">
        <!-- javac Aspect2 -->
        <javac source="1.7" target="1.7" destdir="${aj.sandbox}" classpathref="aj.path"
            srcdir="${basedir}"
            includes="ataspectj/ltwreweavable/Aspect2.java"
            debug="true">
        </javac>
        <delete dir="${aj.sandbox}" includes="**/Aspect1.class, **/Main.class"/>
        <copy file="ataspectj/ltwreweavable/aop-ltwreweavable.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"/>
        <java fork="yes" classname="ataspectj.ltwreweavable.Main" failonerror="yes">
            <classpath refid="aj.path"/>
            <classpath>
                <pathelement path="${aj.sandbox}/main1.jar"/>
            </classpath>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
        </java>
    </target>

    <target name="ltwlog.LTWLog">
        <javac target="1.5" destdir="${aj.sandbox}" classpathref="aj.path"
            srcdir="${basedir}"
            includes="ataspectj/ltwlog/*"
            debug="true">
        </javac>
        <copy file="ataspectj/ltwlog/aop-silent.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"
        	  overwrite="yes"
        />
        <java fork="yes" classname="ataspectj.ltwlog.MainSilent" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
        </java>
        <copy file="ataspectj/ltwlog/aop-verbsoe.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"
        	  overwrite="yes"
        />
        <java fork="yes" classname="ataspectj.ltwlog.MainVerbose" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
        </java>
        <copy file="ataspectj/ltwlog/aop-verboseandshow.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"
		  	  overwrite="yes"
		/>
        <java fork="yes" classname="ataspectj.ltwlog.MainVerboseAndShow" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
        </java>
    </target>

    <target name="ltw.Unweavable">
        <javac source="1.7" target="1.7"  destdir="${aj.sandbox}"
            srcdir="${basedir}"
            includes="ataspectj/UnweavableTest.java, ataspectj/TestHelper.java"
            debug="true">
            <classpath>
                <path refid="aj.path"/>
                <pathelement path="${aj.root}/lib/asm/asm-2.0.jar"/>
            </classpath>
        </javac>
        <copy file="ataspectj/aop-unweavabletest.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"/>
        <java fork="yes" classname="ataspectj.UnweavableTest" failonerror="yes">
            <classpath>
                <path refid="aj.path"/>
                <pathelement path="${aj.root}/lib/asm/asm-2.0.jar"/>
            </classpath>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
        </java>
    </target>

    <target name="ltw.Decp">
        <copy file="ataspectj/aop-decptest.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"
        	  overwrite="yes"
        />
        <java fork="yes" classname="ataspectj.DeclareParentsInterfaceTest" failonerror="yes">
            <classpath>
                <path refid="aj.path"/>
            </classpath>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
        </java>

        <copy file="ataspectj/aop-decptest.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"
        	  overwrite="yes"
        />
    	<java fork="yes" classname="ataspectj.DeclareParentsImplementsTest" failonerror="yes">
            <classpath>
                <path refid="aj.path"/>
            </classpath>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
          <jvmarg value="${aj.addOpensKey}"/>
          <jvmarg value="${aj.addOpensValue}"/>
        </java>
    </target>

    <target name="ltw.Decp2">
        <!-- javac compile the 2nd aspect -->
        <javac source="1.7" target="1.7"  destdir="${aj.sandbox}"
            srcdir="${basedir}"
            includes="ataspectj/DeclareParentsImplementsReweavableTestAspect.java"
            debug="true">
            <classpath>
                <path refid="aj.path"/>
            </classpath>
        </javac>

        <copy file="ataspectj/aop-decptest2.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"/>
        <java fork="yes" classname="ataspectj.DeclareParentsImplementsReweavableTest" failonerror="yes">
            <classpath>
                <path refid="aj.path"/>
            </classpath>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
        </java>
    </target>

    <target name="Compile time aspects declared to ltw weaver">
        <!--Aspects woven at compile time must be declared in an aop.xml file.
        If they are not declared, then they will be lost during reweaving-->

        <!--First test that the error is produced if the declaration is not made-->
        <copy file="ataspectj/ltwreweavable/aop-ltwreweavable-declared.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"/>
        <java fork="yes" classname="ataspectj.ltwreweavable.MainReweavableLogging" failonerror="yes">
            <classpath refid="aj.path"/>
            <classpath>
                <pathelement path="${aj.sandbox}/main1.jar"/>
            </classpath>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="-DaspectDeclared=true"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
        </java>
        <!--Now ensure that the error is not produced when the declaration is made.-->
        <copy file="ataspectj/ltwreweavable/aop-ltwreweavable-omitted.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"
        	  overwrite="yes"/>
        <java fork="yes" classname="ataspectj.ltwreweavable.MainReweavableLogging" failonerror="yes">
            <classpath refid="aj.path"/>
            <classpath>
                <pathelement path="${aj.sandbox}/main1.jar"/>
            </classpath>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="-DaspectDeclared=false"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
        </java>
    </target>

    <target name="ltw.AppContainer">
        <!-- mkdir the 2 sub app root folder -->
        <mkdir dir="${aj.sandbox}/META-INF"/>
        <mkdir dir="${aj.sandbox}/app_1"/>
        <mkdir dir="${aj.sandbox}/app_1/META-INF"/>
        <!-- install sub app -->
        <copy todir="${aj.sandbox}/app_1">
            <fileset dir="${aj.sandbox}" includes="ataspectj/hierarchy/app/*"/>
        </copy>
        <copy todir="${aj.sandbox}/app_2">
            <fileset dir="${aj.sandbox}" includes="ataspectj/hierarchy/app/*"/>
        </copy>
        <delete dir="${aj.sandbox}/ataspectj/hierarchy/app"/>
        <!-- install the aop.xml DD -->
        <copy file="${aj.root}/tests/java5/ataspectj/ataspectj/hierarchy/aop-global.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"/>
        <!-- only app1 gets local aspect -->
        <copy file="${aj.root}/tests/java5/ataspectj/ataspectj/hierarchy/aop-local.xml"
              tofile="${aj.sandbox}/app_1/META-INF/aop.xml"/>
        <!-- run -->
        <java fork="yes" classname="ataspectj.hierarchy.AppContainerTest" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="-Daj.weaving.verbose=true"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
        </java>
    </target>

    <target name="Duplicate JVMTI agents">
        <copy file="${aj.root}/tests/java5/ataspectj/aop-messagehandler.xml"
              tofile="${aj.sandbox}/META-INF/aop.xml"/>
        <java fork="yes" classname="HelloWorld" failonerror="yes">
            <classpath refid="aj.path"/>
            <!-- use META-INF/aop.xml style -->
            <classpath>
                <pathelement path="${aj.sandbox}/aspects.jar"/>
            </classpath>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="-Daj.weaving.verbose=true"/>
            <jvmarg value="-Djava.util.logging.config.file=${aj.root}/weaver5/testdata/logging.properties"/>
            <jvmarg value="${aj.addOpensKey}"/>
            <jvmarg value="${aj.addOpensValue}"/>
<!--            <jvmarg line="${jdwp}"/>-->
        </java>
    </target>

</project>