forked from restsql/restsql-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·116 lines (96 loc) · 4.19 KB
/
build.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="restsql-test" default="test-all">
<property file="build.properties" />
<property name="api-test.dir" value="obj/test/api" />
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask" classpath="../restsql/lib/jaxb-xjc.jar" />
<target name="test-all" depends="test-api,test-api-report,test-service-http" />
<target name="clean" description="deletes output dir">
<delete dir="obj" failonerror="false" includeEmptyDirs="true" quiet="true" />
</target>
<target name="compile-schema" description="compiles test case definition schema">
<!-- Create output dir -->
<mkdir dir="obj/bin" />
<xjc destdir="src" package="org.restsql.service.testcase" removeOldOutput="yes">
<schema file="src/resources/xml/service/testcase/ServiceTestCaseDefinition.xsd" />
<depends file="src/resources/xml/service/testcase/ServiceTestCaseDefinition.xsd" />
<produces dir="obj/bin" />
</xjc>
</target>
<target name="compile-tests" description="compiles JUnit tests">
<ant antfile="../restsql/build.xml" target="compile" inheritall="no" />
<!-- Create output dir -->
<mkdir dir="obj/bin" />
<!-- Copy supporting files -->
<copy todir="obj/bin">
<fileset dir="src">
<include name="**/*.properties" />
<include name="**/*.xml" />
<include name="**/*.xsd" />
</fileset>
</copy>
<!-- Compile tests -->
<javac srcdir="src" destdir="obj/bin" classpath="${test-compile.classpath}" debug="true" />
</target>
<target name="exec-examples" description="executes sample programs">
<ant antfile="../restsql-sdk/build.xml" target="exec-examples" />
</target>
<target name="test-api" depends="compile-tests" description="exercises junit tests for java api">
<!-- Create output dir -->
<delete dir="${api-test.dir}" />
<mkdir dir="${api-test.dir}" />
<!-- Execute tests -->
<junit fork="true" showoutput="true" printsummary="true" tempdir="${api-test.dir}" dir="${basedir}">
<sysproperty key="org.restsql.properties" value="${org.restsql.properties}" />
<classpath path="${test-exec.classpath}" />
<formatter type="xml" />
<batchtest todir="${api-test.dir}">
<fileset dir="src" includes="**/*Test.*" excludes="**/Base*.*" />
</batchtest>
</junit>
</target>
<!-- Creates report for API test -->
<target name="test-api-report" description="generates junit report for api tests">
<!-- Create output dir -->
<delete dir="${api-test.dir}/report" />
<mkdir dir="${api-test.dir}/report" />
<!-- Create report -->
<junitreport todir="${api-test.dir}">
<fileset dir="${api-test.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${api-test.dir}/report" />
</junitreport>
</target>
<target name="test-service-http" description="executes all test cases for the http interface">
<antcall target="-test-service">
<param name="testStyle" value="http" />
<param name="testList" value="%" />
</antcall>
</target>
<target name="test-service-http-subset" description="executes some of test cases for the http interface">
<antcall target="-test-service">
<param name="testStyle" value="http" />
<param name="testList" value="${test.list}" />
</antcall>
</target>
<target name="test-service-java" description="executes all test cases for the service's java interface">
<antcall target="-test-service">
<param name="testStyle" value="java" />
<param name="testList" value="%" />
</antcall>
</target>
<target name="test-service-java-subset" description="executes some test cases for the service's java interface">
<antcall target="-test-service">
<param name="testStyle" value="java" />
<param name="testList" value="${test.list}" />
</antcall>
</target>
<target name="-test-service" depends="compile-tests">
<java fork="true" classpath="${test-exec.classpath}" classname="org.restsql.service.ServiceTestRunner" dir="${basedir}">
<arg value="${testStyle}" />
<arg value="${testList}" />
<jvmarg value="-Dorg.restsql.baseUri=${org.restsql.baseUri}" />
<jvmarg value="-Dorg.restsql.properties=${org.restsql.properties}" />
</java>
</target>
</project>