forked from michaelhashimoto/test-cucumber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
142 lines (118 loc) · 3.11 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
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
<?xml version="1.0"?>
<project name="cucumber" default="build">
<property environment="env" />
<property file="build.${user.name}.properties" />
<property file="build.${env.COMPUTERNAME}.properties" />
<property file="build.${env.HOST}.properties" />
<property file="build.${env.HOSTNAME}.properties" />
<property file="build.properties" />
<path id="project.classpath">
<pathelement path="project/classes" />
<fileset dir="lib" includes="*.jar" />
</path>
<taskdef classpathref="project.classpath" resource="net/sf/antcontrib/antlib.xml" />
<macrodef name="clean">
<sequential>
<delete dir="project/classes/" />
</sequential>
</macrodef>
<macrodef name="compile">
<sequential>
<mkdir dir="project/classes/" />
<javac
classpathref="project.classpath"
debug="true"
destdir="project/classes/"
includeantruntime="false"
srcdir="project/src/"
/>
<prepare-selenium-ext-properties />
<copy todir="project/classes/">
<fileset dir="project/src/" includes="*.properties" />
</copy>
</sequential>
</macrodef>
<macrodef name="prepare-selenium-ext-properties">
<sequential>
<if>
<isset property="browser.firefox.bin.file" />
<then>
<echo append="true" file="project/src/selenium-ext.properties">
browser.firefox.bin.file=${browser.firefox.bin.file}
</echo>
</then>
</if>
</sequential>
</macrodef>
<macrodef name="run-cmd">
<attribute name="test.file" />
<attribute name="test.name" />
<sequential>
<local name="Feature" />
<property file="@{test.file}" />
<if>
<equals arg1="${Feature}" arg2="" />
<then>
<fail message="Please set a value to the Feature" />
</then>
</if>
<local name="test.feature" />
<local name="test.name" />
<property name="test.feature" value="${Feature}" />
<propertyregex
global="true"
input="${Feature}"
override="true"
property="test.feature"
regexp="\s+"
replace="_"
/>
<property name="test.name" value="@{test.name}" />
<propertyregex
global="true"
input="@{test.name}"
override="true"
property="test.name"
regexp="\s+"
replace="_"
/>
<java
classname="com.liferay.cucumber.CucumberTest"
classpathref="project.classpath"
fork="true"
newenvironment="true"
>
<arg value="--glue" />
<arg value="com.liferay.cucumber" />
<arg value="--name" />
<arg value="@{test.name}" />
<arg value="--plugin" />
<arg value="pretty" />
<arg value="--plugin" />
<arg value="html:results/html/" />
<arg value="--plugin" />
<arg value="json:results/json/test.json" />
<arg value="--plugin" />
<arg value="junit:results/junit/TEST-${test.feature}-${test.name}.xml" />
<arg value="--snippets" />
<arg value="camelcase" />
<arg value="--strict" />
<arg value="@{test.file}" />
</java>
</sequential>
</macrodef>
<target name="build">
<clean />
<compile />
<run-cmd
test.file="${test.feature}"
test.name="${test.name}"
/>
</target>
<target name="run">
<run-cmd
test.file="${test.feature}"
test.name="${test.name}"
/>
</target>
</project>