aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/ataspectj/ajc-ant.xml
blob: 695e8ac0762f4b365fdbc38847b3017040b35482 (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
<!-- ajc-ant script, not to be used from Ant commant line - see AntSpec -->
<project name="ltw" default="javac.ltw">

    <!-- 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="compile:javac">
        <!-- compile only javac compilable stuff, exclude the one that needs other dependencies -->
        <javac 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 line="${jdwp}"/>-->
        </java>
    </target>

    <target name="ltw.PerClauseTest">
        <java fork="yes" classname="ataspectj.PerClauseTest" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="-Daj5.def=ataspectj/aop-perclausetest.xml"/>
<!--            <jvmarg line="${jdwp}"/>            -->
        </java>
    </target>

    <target name="ltw.AroundInlineMungerTest">
        <java fork="yes" classname="ataspectj.AroundInlineMungerTest" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="-Daj5.def=ataspectj/aop-aroundinlinemungertest.xml"/>
            <!--<jvmarg line="${jdwp}"/>--><!-- uncomment to debug with JDWP -->
        </java>
    </target>

    <target name="ltw.AroundInlineMungerTest2">
        <java fork="yes" classname="ataspectj.AroundInlineMungerTest2" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="-Daj5.def=ataspectj/aop-aroundinlinemungertest2.xml"/>
        </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="-Daj5.def=ataspectj/aop-dump.xml"/>
        </java>
    </target>

    <target name="ltw.DumpProxyTest">
        <java fork="yes" classname="ataspectj.TestProxyGenerator" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="-Daj5.def=ataspectj/aop-dumpproxy.xml"/>
        </java>
    </target>

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

    <target name="ltw.Aspect2MainTest">
        <!-- javac Aspect2 -->
        <javac 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"/>
        <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="-Daj5.def=ataspectj/ltwreweavable/aop-ltwreweavable.xml"/>
        </java>
    </target>

    <target name="ltwlog.LTWLog">
        <javac destdir="${aj.sandbox}" classpathref="aj.path"
            srcdir="${basedir}"
            includes="ataspectj/ltwlog/*"
            debug="true">
        </javac>
        <java fork="yes" classname="ataspectj.ltwlog.MainSilent" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="-Daj5.def=ataspectj/ltwlog/aop-silent.xml"/>
        </java>
        <java fork="yes" classname="ataspectj.ltwlog.MainVerbose" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="-Daj5.def=ataspectj/ltwlog/aop-verbose.xml"/>
        </java>
        <java fork="yes" classname="ataspectj.ltwlog.MainVerboseAndShow" failonerror="yes">
            <classpath refid="aj.path"/>
            <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
            <jvmarg value="-Daj5.def=ataspectj/ltwlog/aop-verboseandshow.xml"/>
        </java>
    </target>

    <target name="ltw.Unweavable">
        <javac 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>
        <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="-Daj5.def=ataspectj/aop-unweavabletest.xml"/>
        </java>
    </target>

    <target name="ltw.Decp">
        <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="-Daj5.def=ataspectj/aop-decptest.xml"/>
        </java>
        <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="-Daj5.def=ataspectj/aop-decptest.xml"/>
        </java>
    </target>

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

        <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="-Daj5.def=ataspectj/aop-decptest2.xml"/>
        </java>
    </target>

    <target name="ltw.oldAspectsDeclared">
        <!--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-->
        <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="-Daj5.def=ataspectj/ltwreweavable/aop-ltwreweavable-declared.xml"/>
            <jvmarg value="-DaspectDeclared=true"/>
        </java>
        <!--Now ensure that the error is not produced when the declaration is made.-->
        <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="-Daj5.def=ataspectj/ltwreweavable/aop-ltwreweavable-omitted.xml"/>
            <jvmarg value="-DaspectDeclared=false"/>
        </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"/>
        </java>
    </target>

</project>