File: build.xml

package info (click to toggle)
libgroboutils-java 5-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 8,496 kB
  • sloc: java: 59,880; xml: 12,762; sh: 377; perl: 104; makefile: 20
file content (219 lines) | stat: -rw-r--r-- 7,016 bytes parent folder | download | duplicates (2)
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
<?xml version="1.0"?>

<!DOCTYPE project [

<!-- default sources -->
<!ENTITY % ent._shared SYSTEM "../_shared/_shared.ant-ent.xml">
%ent._shared;
]>



<project name="TestingJUnit" default="main" basedir=".">

    <!-- Property Defines -->
    <property name="product" value="groboutils-testingjunit" />
    <property name="version" value="1.2.1" />
    <property name="basepackage" value="net/sourceforge/groboutils/junit/v1" />
    
    
    &inc._shared;
    
    <!-- replace default properties and tasks -->
    &inc._shared.common-ant-replace;
    
    &inc._shared.common-ant-tasks-init;
    &inc._shared.common-ant-tasks-clean;
    &inc._shared.common-ant-tasks-javac;
    &inc._shared.common-ant-tasks-jar;
    &inc._shared.common-ant-tasks-doc;
    &inc._shared.common-ant-tasks-jdkdepend;
    &inc._shared.common-ant-tasks-test;
    &inc._shared.common-ant-tasks-deploy;

    
    <!-- inter-project dependencies -->
        <!-- This is the base-level package.  It has NO dependencies! -->
    
    
    <!-- Used versions of libraries -->
    <property name="libs.junit" value="${libs.junit.current}" />
    <property name="libs.log4j" value="${libs.log4j.current}" />
    <property name="libs.log4j.props" value="${basedir}" />
    <property name="libs.easymock" value="${libs.easymock.current}" />
    <property name="libs.mockobjects" value="${libs.mockobjects.current.core}" />
    <property name="libs.xerces.impl" value="${libs.xerces.current.impl}" />
    <property name="libs.xerces.api" value="${libs.xalan.current.xmlapi}" />
    <property name="libs.xalan" value="${libs.xalan.current}" />
    <property name="libs.ant.core" value="${libs.ant.current.core}" />
    <property name="libs.ant.optional" value="${libs.ant.current.optional}" />
    
    
    <!-- Data objects -->
    <path id="classpath.base">
        <pathelement location="${libs.log4j}" />
        <pathelement location="${libs.junit}" />
    </path>
    
    <path id="classpath.tests">
        <path refid="classpath.base" />
        <pathelement location="${libs.easymock}" />
        <pathelement location="${libs.mockobjects}" />
        <pathelement location="${libs.log4j.props}" />
        
        <!-- EUTs require xalan + xerces + ant -->
        <pathelement location="${libs.xerces.api}" />
        <pathelement location="${libs.xerces.impl}" />
        <pathelement location="${libs.xalan}" />
        <pathelement location="${libs.ant.core}" />
        <pathelement location="${libs.ant.optional}" />
        
        <!-- Include Autodoc bootstrapped elements. -->
        <path refid="classpath.bootstrap" />
    </path>
    
    
    
    
    <!-- ****************************************************************** -->
    
    <!-- Targets -->

    <target name="all" depends="init,clean,javac,jar,doc,java-doc" />
    <target name="main" depends="init,javac,jar" />

    <target name="deploy" depends="init,_shared.common.deploy" />
    <target name="init" depends="_shared.common.init" />
    <target name="jar" depends="_shared.common.deploy-setup,
        _shared.common.jar" />
    <target name="clean" depends="_shared.common.clean" />
    
    <!-- ****************************************************************** -->
    
    <!--
        Compiling requires a test of what we're compiling against.
        This allows for both JDK 1.4 and JDK 1.3 compatibility.
     -->
    <target name="javac"
        depends="init, javac-checkDependencies,
            _shared.common.javac-dev,
            _shared.common.javac-eut,
            _shared.common.javac-ut,
            _shared.common.javac-iut,
            _shared.common.javac-ait" />
    
    
    
    <!-- Compilation Dependency Check: can we compile with the current
         environment? -->
    <target name="javac-checkDependencies"
        depends="_shared.common.depend.jdk.1_1" >
    </target>
    
    
    
    
    <!-- ****************************************************************** -->
    
    <!-- Documentation -->
    <target name="doc" depends="init">
        <!-- create the base document part -->
        <antcall target="_shared.common.subdocs">
            <param name="arg-subdir" value="" />
        </antcall>
        
        <!-- create each sub-part
        <antcall target="_shared.common.subdocs">
            <param name="arg-subdir" value="junit" />
        </antcall>
        -->
    </target>
    
    
    <!-- JavaDoc -->
    <target name="java-doc" depends="init,doc,_shared.common.java-doc.latest" />

    
    
    <!-- ****************************************************************** -->
    
    
    
    <!-- ****************************************************************** -->
    
    <!-- testing
        AIT tests need to be run separately, since they generally take
        a long time to run.
    -->
    <target name="test-all"
        depends="test-checkDependencies, _shared.common.test-all" />

    <target name="test-checkDependencies"
        depends="javac-checkDependencies" >
    </target>
    
    
    <target name="test-ait-1">
        <delete dir="${dirs.work}/ait-1" failonerror="false" />
        <mkdir dir="${dirs.work}/ait-1" />
        <echo file="${dirs.work}/ait-1/A1.java">
import net.sourceforge.groboutils.junit.v1.*;
import junit.framework.*;
import java.util.*;
public class A1 {

    public static class ItcTest extends IntegrationTestCase {
    
        /**
         * @param name
         */
        public ItcTest(String name) {
            super(name);
        }
    
        public void testSimple() {
            softAssertEquals("testSimple", "1001", "1001");
            softAssertEquals("Where is my message?", "1002", "9999");
            softAssertEquals("testSimple", "1003", "1003");
        }
    }


    public static void main( String args[] ) {
        Test t;
    /* this seems to work
        AssertTestFactory atf = new AssertTestFactory();
        t = atf.createAssertEquals(
            "Where's my message?", "9999", "1002" );
    */
        t = new ItcTest("testSimple");
        TestResult tr = new TestResult();
        t.run( tr );
        Enumeration enum = tr.failures();
        while (enum.hasMoreElements()) {
            TestFailure tf = (TestFailure)enum.nextElement();
            tf.thrownException().printStackTrace();
        }

    }
}
        </echo>
        <javac srcdir="${dirs.work}/ait-1" destdir="${dirs.work}/ait-1"
            debug="on">
            <classpath>
                <pathelement location="${dirs.work}/ait-1" />
                <pathelement location="${output.jar-name.dev.root}" />
                <path refid="classpath.tests" />
            </classpath>
        </javac>
        <java classname="A1" fork="true">
            <classpath>
                <pathelement location="${dirs.work}/ait-1" />
                <pathelement location="${output.jar-name.dev.root}" />
                <path refid="classpath.tests" />
            </classpath>
        </java>
    </target>
    
    
</project>