Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. <?xml version="1.0"?>
  2. <project xmlns:antcontrib="antlib:net.sf.antcontrib" xmlns:ivy="antlib:org.apache.ivy.ant" name="Vaadin Integration Tests" basedir="." default="integration-test-all">
  3. <!-- Import common targets -->
  4. <import file="../common.xml" />
  5. <dirname file="${ant.file.Vaadin Integration Tests}" property="integration_test.dir" />
  6. <!-- Target deploying demo.war -->
  7. <fail unless="test.integration.server" message="test.integration.server must be set for integration tests to run" />
  8. <fail unless="test.integration.user" message="test.integration.user must be set for integration tests to run" />
  9. <fail unless="test.integration.antfile" message="test.integration.antfile must be set for integration tests to run" />
  10. <!-- Test with these browsers -->
  11. <property name="test_browsers" value="winxp-firefox17-esr" />
  12. <!-- Path to key file. Default value -->
  13. <property name="sshkey.file" value="id_dsa" />
  14. <!-- path and name for demo.war to be deployed -->
  15. <property name="demo.war" value="demo.war" />
  16. <!-- Host running Testbench RC or Testbench Hub. Default value -->
  17. <property name="com.vaadin.testbench.tester.host" value="127.0.0.1" />
  18. <!-- Base url where the testable application is deployed -->
  19. <property name="deployment.url" value="http://${test.integration.server}:8080" />
  20. <!-- TestBench license parameter -->
  21. <property name="vaadin.testbench.developer.license" value="" />
  22. <property name="report.dir" location="${integration_test.dir}/result/reports-integration" />
  23. <!-- ssh host values -->
  24. <property name="ant.hub" value="${test.integration.antfile}" />
  25. <property name="user" value="${test.integration.user}" />
  26. <property name="passphrase" value="" />
  27. <ivy:resolve file="ivy.xml" conf="build, build-provided" />
  28. <ivy:cachepath pathid="classpath.tb3.lib" conf="build, build-provided" />
  29. <path id="classpath.tb3">
  30. <path refid="classpath.tb3.lib" />
  31. <path location="result/classes" />
  32. </path>
  33. <!-- Upload war to deploy to ssh host -->
  34. <target name="integration-test-upload-demo">
  35. <scp file="${demo.war}" todir="${user}@${test.integration.server}:integration-tests/servers/demo.war" keyfile="${sshkey.file}" passphrase="${passphrase}" />
  36. </target>
  37. <!-- Run basic integration test test -->
  38. <target name="legacy-integration-test">
  39. <fail unless="testfiles" message="You need to specify the files to run using the 'testfiles' property" />
  40. <subant target="run-tb2-tests" failonerror="false" antfile="test.xml">
  41. <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}" />
  42. <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}" />
  43. <property name="com.vaadin.testbench.deployment.url" value="${deployment.url}" />
  44. <property name="server.start.succeeded" value="1" />
  45. <property name="browsers" value="${test_browsers}" />
  46. <property name="testfiles" value="${testfiles}" />
  47. <property name="test-output-dir" value="${integration_test.dir}/result/integration-test-output/${server-name}" />
  48. <property name="retries" value="0" />
  49. <property name="report.qualifier" value="integration-tb2/${server-name}" />
  50. <fileset dir="." includes="test.xml" />
  51. </subant>
  52. </target>
  53. <target name="integration-test-theme">
  54. <subant target="run-tb2-tests" failonerror="false" antfile="test.xml">
  55. <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}" />
  56. <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}" />
  57. <property name="com.vaadin.testbench.deployment.url" value="${deployment.url}" />
  58. <property name="server.start.succeeded" value="1" />
  59. <property name="testfiles" value="${testfiles-theme}" />
  60. <property name="test-output-dir" value="${integration_test.dir}/result/integration-test-output/${server-name}" />
  61. <property name="report.qualifier" value="integration-theme-tb2/${server-name}" />
  62. <fileset dir="." includes="test.xml" />
  63. </subant>
  64. </target>
  65. <!-- Run integration test on GAE -->
  66. <target name="integration-test-test-GAE">
  67. <fileset dir="integration-testscripts" id="html-test-files" includes="GoogleAppEngine/integration-test-GAE.html" />
  68. <pathconvert pathsep=" " property="test-GAE" refid="html-test-files" />
  69. <subant target="run-tb2-tests" failonerror="false" antfile="test.xml">
  70. <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}" />
  71. <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}" />
  72. <property name="com.vaadin.testbench.deployment.url" value="http://vaadin-integration-test-hrd.appspot.com/" />
  73. <property name="server.start.succeeded" value="1" />
  74. <property name="browsers" value="${test_browsers}" />
  75. <property name="testfiles" value="${test-GAE}" />
  76. <property name="test-output-dir" value="../build/integration-test-gae-output" />
  77. <property name="report.qualifier" value="integration-gae-tb2/${server-name}" />
  78. <fileset dir="." includes="test.xml" />
  79. </subant>
  80. </target>
  81. <target name="integration-test-deploy-to-GAE">
  82. <sshexec host="${test.integration.server}" username="${user}" keyfile="${sshkey.file}" command="ant -f ${ant.hub} deploy-to-GAE" />
  83. </target>
  84. <target name="run-tb3-servlet-test">
  85. <antcall target="run-tb3-test" inheritall="true">
  86. <param name="junit.test.suite" value="com.vaadin.tests.tb3.ServletIntegrationTests" />
  87. </antcall>
  88. </target>
  89. <target name="run-tb3-test">
  90. <fail unless="server-name" message="Server name must be defined in server-name" />
  91. <fail unless="deployment.url" message="Deplyoment url must be defined in deployment.url" />
  92. <fail unless="com.vaadin.testbench.screenshot.directory" message="Screenshot directory must be defined in com.vaadin.testbench.screenshot.directory" />
  93. <property name="server.report.dir" location="${report.dir}/integration-test-tb3/${server-name}" />
  94. <!-- The junit task does not create the report dir... -->
  95. <mkdir dir="${server.report.dir}" />
  96. <junit showoutput="no" printsummary="no" fork="yes">
  97. <formatter type="xml" />
  98. <classpath refid="classpath.tb3" />
  99. <jvmarg value="-Dcom.vaadin.testbench.screenshot.directory=${com.vaadin.testbench.screenshot.directory}" />
  100. <jvmarg value="-Ddeployment.url=${deployment.url}" />
  101. <jvmarg value="-Dserver-name=${server-name}" />
  102. <jvmarg value="-Djava.awt.headless=true" />
  103. <jvmarg value="-Ddemo.war=${demo.war}" />
  104. <jvmarg value="-Dvaadin.testbench.developer.license=${vaadin.testbench.developer.license}" />
  105. <test name="${junit.test.suite}" todir="${server.report.dir}" />
  106. </junit>
  107. </target>
  108. <target name="integration-test-tomcat7">
  109. <antcall target="run-generic-integration-test">
  110. <param name="startDelay" value="10" />
  111. <param name="target-server" value="tomcat7" />
  112. </antcall>
  113. </target>
  114. <target name="integration-test-tomcat7apacheproxy">
  115. <antcall target="run-generic-integration-test">
  116. <param name="startDelay" value="10" />
  117. <param name="target-server" value="tomcat7apacheproxy" />
  118. </antcall>
  119. </target>
  120. <target name="integration-test-tomcat8">
  121. <antcall target="run-generic-integration-test">
  122. <param name="startDelay" value="10" />
  123. <param name="target-server" value="tomcat8" />
  124. </antcall>
  125. </target>
  126. <target name="integration-test-osgi">
  127. <antcall target="run-generic-integration-test">
  128. <param name="startDelay" value="10" />
  129. <param name="target-server" value="osgi" />
  130. </antcall>
  131. </target>
  132. <target name="integration-test-tomcat6">
  133. <antcall target="run-generic-integration-test">
  134. <param name="startDelay" value="10" />
  135. <param name="target-server" value="tomcat6" />
  136. </antcall>
  137. </target>
  138. <target name="integration-test-jetty7">
  139. <antcall target="run-generic-integration-test">
  140. <param name="target-server" value="jetty7" />
  141. </antcall>
  142. </target>
  143. <target name="integration-test-jetty8">
  144. <antcall target="run-generic-integration-test">
  145. <param name="startDelay" value="300" />
  146. <param name="target-server" value="jetty8" />
  147. </antcall>
  148. </target>
  149. <target name="integration-test-jetty9">
  150. <antcall target="run-generic-integration-test">
  151. <param name="startDelay" value="300" />
  152. <param name="target-server" value="jetty9" />
  153. </antcall>
  154. </target>
  155. <target name="integration-test-jboss4">
  156. <antcall target="run-generic-integration-test">
  157. <param name="startDelay" value="10" />
  158. <param name="target-server" value="jboss4" />
  159. </antcall>
  160. </target>
  161. <target name="integration-test-jboss5">
  162. <antcall target="run-generic-integration-test">
  163. <param name="startDelay" value="10" />
  164. <param name="target-server" value="jboss5" />
  165. </antcall>
  166. </target>
  167. <target name="integration-test-jboss6">
  168. <antcall target="run-generic-integration-test">
  169. <param name="startDelay" value="10" />
  170. <param name="target-server" value="jboss6" />
  171. </antcall>
  172. </target>
  173. <target name="integration-test-jboss7">
  174. <antcall target="run-generic-integration-test">
  175. <param name="startDelay" value="10" />
  176. <param name="target-server" value="jboss7" />
  177. </antcall>
  178. </target>
  179. <target name="integration-test-jboss-eap6">
  180. <antcall target="run-generic-integration-test">
  181. <param name="startDelay" value="10" />
  182. <param name="target-server" value="jbosseap6" />
  183. </antcall>
  184. </target>
  185. <target name="integration-test-wildfly8">
  186. <antcall target="run-generic-integration-test">
  187. <param name="startDelay" value="10" />
  188. <param name="target-server" value="wildfly8" />
  189. </antcall>
  190. </target>
  191. <target name="integration-test-wildfly9">
  192. <antcall target="run-generic-integration-test">
  193. <param name="startDelay" value="10" />
  194. <param name="target-server" value="wildfly9" />
  195. </antcall>
  196. </target>
  197. <target name="integration-test-wildfly9-nginx">
  198. <antcall target="run-generic-integration-test">
  199. <param name="startDelay" value="10" />
  200. <param name="target-server" value="wildfly9-nginx" />
  201. <param name="target-port" value="80" />
  202. </antcall>
  203. </target>
  204. <target name="integration-test-glassfish3">
  205. <antcall target="run-generic-integration-test">
  206. <param name="startDelay" value="10" />
  207. <param name="target-server" value="glassfish3" />
  208. </antcall>
  209. </target>
  210. <target name="integration-test-glassfish4">
  211. <antcall target="run-generic-integration-test">
  212. <param name="startDelay" value="10" />
  213. <param name="target-server" value="glassfish4" />
  214. </antcall>
  215. </target>
  216. <target name="integration-test-liferay6">
  217. <fileset dir="integration-testscripts" id="html-test-files" includes="Liferay-6/integration-test-liferay-6.0.5.html" />
  218. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  219. <antcall target="run-generic-integration-test">
  220. <param name="startDelay" value="600" />
  221. <param name="test_browsers" value="winxp-firefox17-esr" />
  222. <param name="target-server" value="liferay6" />
  223. </antcall>
  224. </target>
  225. <target name="integration-test-liferay6-theme">
  226. <fileset dir="integration-testscripts" id="html-test-files" includes="Liferay-6/Liferay6-and-6EE-theme-deploy.html" />
  227. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  228. <fileset dir="integration-testscripts" id="html-theme-files" includes="Liferay-6/Liferay6-theme.html" />
  229. <pathconvert pathsep=" " property="testfiles-theme" refid="html-theme-files" />
  230. <antcall target="run-generic-integration-test">
  231. <param name="startDelay" value="600" />
  232. <param name="test_browsers" value="winxp-firefox17-esr" />
  233. <param name="target-server" value="liferay6" />
  234. </antcall>
  235. </target>
  236. <target name="integration-test-liferay5">
  237. <fileset dir="integration-testscripts" id="html-test-files" includes="Liferay-5/integration-test-liferay-5.2.3-portlet2.html" />
  238. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  239. <antcall target="run-generic-integration-test">
  240. <param name="startDelay" value="600" />
  241. <param name="test_browsers" value="winxp-firefox17-esr" />
  242. <param name="target-server" value="liferay5" />
  243. </antcall>
  244. </target>
  245. <target name="integration-test-gatein3">
  246. <fileset dir="integration-testscripts" id="html-test-files" includes="GateIn-3/integration-test-GateIn-3.1.0-portlet2.html" />
  247. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  248. <antcall target="run-generic-integration-test">
  249. <param name="startDelay" value="600" />
  250. <param name="test_browsers" value="winxp-googlechrome21" />
  251. <param name="target-server" value="gatein3" />
  252. </antcall>
  253. </target>
  254. <target name="integration-test-websphere8">
  255. <antcall target="run-generic-integration-test">
  256. <param name="startDelay" value="600" />
  257. <param name="target-port" value="9080" />
  258. <param name="target-server" value="websphere8" />
  259. </antcall>
  260. </target>
  261. <target name="integration-test-websphereportal8">
  262. <concat>##teamcity[testStarted name='websphereportal8' flowId='websphereportal8']</concat>
  263. <antcall target="run-tb3-test" inheritall="true">
  264. <param name="junit.test.suite" value="com.vaadin.tests.integration.WebSpherePortalIntegrationTest" />
  265. <param name="server-name" value="websphereportal8" />
  266. <!-- Fill out dummy values for params required by run-tb3-test target -->
  267. <param name="test.integration.server" value="" />
  268. <param name="test.integration.user" value="" />
  269. <param name="test.integration.antfile" value="" />
  270. </antcall>
  271. <concat>##teamcity[testFinished name='websphereportal8' flowId='websphereportal8']"</concat>
  272. </target>
  273. <target name="integration-test-weblogic10">
  274. <antcall target="run-generic-integration-test">
  275. <param name="startDelay" value="600" />
  276. <param name="target-port" value="7001" />
  277. <param name="target-server" value="weblogic10" />
  278. </antcall>
  279. </target>
  280. <target name="integration-test-weblogic12">
  281. <antcall target="run-generic-integration-test">
  282. <param name="startDelay" value="600" />
  283. <param name="target-port" value="7001" />
  284. <param name="target-server" value="weblogic12" />
  285. </antcall>
  286. </target>
  287. <target name="integration-test-weblogicPortal">
  288. <fileset dir="integration-testscripts" id="html-test-files" includes="weblogic-portal/integration-test-WebLogic-Portal-10.3.2-portlet2.html" />
  289. <pathconvert pathsep=" " property="testfiles" refid="html-test-files" />
  290. <antcall target="run-generic-integration-test">
  291. <param name="startDelay" value="600" />
  292. <param name="target-port" value="7001" />
  293. <param name="target-server" value="weblogicportal" />
  294. </antcall>
  295. </target>
  296. <target name="integration-test-GAE">
  297. <antcall target="integration-test-deploy-to-GAE" />
  298. <antcall target="integration-test-test-GAE" />
  299. </target>
  300. <!-- Upload demo, clean error screenshots and test deployment on all
  301. servers -->
  302. <target name="integration-test-all" unless="tests.integration.skip">
  303. <property name="passphrase" value="${passphrase}" />
  304. <fail unless="sshkey.file" message="You must define an ssh.keyfile parameter" />
  305. <fail unless="com.vaadin.testbench.screenshot.directory" message="You must define a com.vaadin.testbench.screenshot.directory parameter" />
  306. <delete dir="${report.dir}" />
  307. <mkdir dir="${report.dir}" />
  308. <parallel>
  309. <antcontrib:trycatch property="tried">
  310. <try>
  311. <!-- Still running GAE test from the old server which
  312. requires its own lock -->
  313. <echo message="Getting lock" />
  314. <antcall target="integration-test-get-lock" />
  315. <echo message="Got lock" />
  316. <antcall target="integration-test-upload-demo" />
  317. <antcall target="run-integration-test">
  318. <param name="target-server" value="GAE" />
  319. </antcall>
  320. <antcall target="integration-test-clean" />
  321. <echo message="Getting lock" />
  322. <antcall target="integration-test-release-lock" />
  323. <echo message="Lock released" />
  324. </try>
  325. <catch>
  326. <echo message="Uploading of demo.war failed. ${tried}" />
  327. </catch>
  328. </antcontrib:trycatch>
  329. <antcall target="integration-test-liferay6" />
  330. <antcall target="integration-test-liferay6-theme" />
  331. <antcall target="integration-test-weblogicPortal" />
  332. <antcall target="integration-test-liferay5" />
  333. <antcall target="integration-test-weblogic10" />
  334. <antcall target="integration-test-weblogic12" />
  335. <antcall target="integration-test-gatein3" />
  336. <antcall target="integration-test-glassfish3" />
  337. <antcall target="integration-test-glassfish4" />
  338. <antcall target="integration-test-jboss4" />
  339. <antcall target="integration-test-jboss5" />
  340. <antcall target="integration-test-jboss6" />
  341. <antcall target="integration-test-jboss7" />
  342. <antcall target="integration-test-jboss-eap6" />
  343. <antcall target="integration-test-wildfly8" />
  344. <antcall target="integration-test-wildfly9" />
  345. <antcall target="integration-test-jetty7" />
  346. <antcall target="integration-test-jetty8" />
  347. <antcall target="integration-test-jetty9" />
  348. <antcall target="integration-test-tomcat6" />
  349. <antcall target="integration-test-tomcat7" />
  350. <antcall target="integration-test-tomcat8" />
  351. <antcall target="integration-test-osgi" />
  352. <antcall target="integration-test-tomcat7apacheproxy" />
  353. <antcall target="integration-test-websphere8" />
  354. <!-- Currently the test system does not have a server for automatic testing of WebSphere Portal 8 -->
  355. <!-- <antcall target="integration-test-websphereportal8" /> -->
  356. </parallel>
  357. </target>
  358. <target name="do-run-generic-test">
  359. <property name="target-host" value="${target-server}.devnet.vaadin.com" />
  360. <property name="target-port" value="8080" />
  361. <antcontrib:if>
  362. <isset property="startDelay" />
  363. <then>
  364. <antcontrib:math result="sleepTime" datatype="int">
  365. <op op="rint">
  366. <op op="*">
  367. <num value="${startDelay}" />
  368. <op op="random" />
  369. </op>
  370. </op>
  371. </antcontrib:math>
  372. <echo>Delaying startup of ${target-server} with ${sleepTime} seconds</echo>
  373. <sleep seconds="${sleepTime}" />
  374. </then>
  375. </antcontrib:if>
  376. <scp todir="${user}@${target-host}:." keyfile="${sshkey.file}" trust="yes" passphrase="${passphrase}">
  377. <fileset dir="integration_base_files">
  378. <include name="*" />
  379. </fileset>
  380. </scp>
  381. <!-- trycatch probably not needed any more as it just fails with
  382. the original message and doesn't do anything in the finally block -->
  383. <antcontrib:trycatch property="error_message">
  384. <try>
  385. <!-- timeout in one hour (remote end should timeout in 55
  386. minutes) -->
  387. <sshexec host="${target-host}" outputproperty="lock-output" timeout="3600000" username="${user}" keyfile="${sshkey.file}" trust="yes" command="chmod +x *.sh; ant -f deploy.xml get-lock" />
  388. <antcall target="echo-prefix">
  389. <param name="prefix" value="${target-server}: " />
  390. <param name="message" value="${lock-output}" />
  391. </antcall>
  392. <scp file="${demo.war}" todir="${user}@${target-host}:demo.war" keyfile="${sshkey.file}" trust="yes" passphrase="${passphrase}" />
  393. <!-- timeout in 15 minutes -->
  394. <sshexec host="${target-host}" outputproperty="start-output" timeout="900000" username="${user}" keyfile="${sshkey.file}" trust="yes" command="ant -f deploy.xml startup-and-deploy" failonerror="false" />
  395. <antcall target="echo-prefix">
  396. <param name="prefix" value="${target-server}: " />
  397. <param name="message" value="${start-output}" />
  398. </antcall>
  399. <fail message="${start-output}">
  400. <condition>
  401. <not>
  402. <contains string="${start-output}" substring="Demo deployed successfully" />
  403. </not>
  404. </condition>
  405. </fail>
  406. <antcontrib:if>
  407. <isset property="testfiles" />
  408. <antcontrib:then>
  409. <echo>Starting legacy (TB2) test for ${target-server}</echo>
  410. <antcall target="legacy-integration-test">
  411. <param name="server-name" value="${target-server}" />
  412. <param name="deployment.url" value="http://${target-host}:${target-port}" />
  413. </antcall>
  414. </antcontrib:then>
  415. <antcontrib:else>
  416. <echo>Starting TB3 test for ${target-server}</echo>
  417. <antcall target="run-tb3-servlet-test">
  418. <param name="server-name" value="${target-server}" />
  419. <param name="deployment.url" value="http://${target-host}:${target-port}" />
  420. </antcall>
  421. </antcontrib:else>
  422. </antcontrib:if>
  423. <!-- Run theme tests in all browsers if there's a property
  424. with the test files -->
  425. <antcontrib:if>
  426. <isset property="testfiles-theme" />
  427. <antcontrib:then>
  428. <antcall target="integration-test-theme">
  429. <param name="server-name" value="${target-server}" />
  430. <param name="deployment.url" value="http://${target-host}:${target-port}" />
  431. </antcall>
  432. </antcontrib:then>
  433. </antcontrib:if>
  434. <!-- timeout in five minutes -->
  435. <sshexec host="${target-host}" outputproperty="stop-output" timeout="600000" username="${user}" keyfile="${sshkey.file}" trust="yes" command="ant -f deploy.xml shutdown-and-cleanup" failonerror="false" />
  436. <antcall target="echo-prefix">
  437. <param name="prefix" value="${target-server}: " />
  438. <param name="message" value="${stop-output}" />
  439. </antcall>
  440. </try>
  441. <catch>
  442. <fail message="${error_message}" />
  443. </catch>
  444. </antcontrib:trycatch>
  445. </target>
  446. <target name="echo-prefix">
  447. <antcontrib:propertyregex property="message-prefixed" input="${prefix}${message}" regexp="\n" replace="\0${prefix}" global="true" defaultValue="${prefix}${message}" />
  448. <echo message="${message-prefixed}" />
  449. </target>
  450. <target name="run-generic-integration-test">
  451. <concat>##teamcity[testStarted name='${target-server}' flowId='${target-server}']</concat>
  452. <antcontrib:trycatch property="tried">
  453. <try>
  454. <antcall target="do-run-generic-test" />
  455. </try>
  456. <catch>
  457. <antcontrib:antcallback target="teamcity-escape" return="tried-escaped">
  458. <param name="returnTo" value="tried-escaped" />
  459. <param name="message" value="${tried}" />
  460. </antcontrib:antcallback>
  461. <concat>##teamcity[testFailed name='${target-server}' flowId='${target-server}' message='Integration test for ${target-server} failed.' details='${tried-escaped}']</concat>
  462. </catch>
  463. </antcontrib:trycatch>
  464. <concat>##teamcity[testFinished name='${target-server}' flowId='${target-server}']"</concat>
  465. </target>
  466. <target name="teamcity-escape">
  467. <property name="returnTo" value="return" />
  468. <!-- Should also perform other escaping (\u0085, \u2028 and \u2029)
  469. - see http://confluence.jetbrains.net/display/TCD65/Build+Script+Interaction+with+TeamCity -->
  470. <!-- Immutable properties -> needs to create a new one every time -->
  471. <antcontrib:propertyregex property="details-escaped1" input="${message}" regexp="['|\[\]]" replace="|\0" global="true" defaultValue="${message}" />
  472. <antcontrib:propertyregex property="details-escaped2" input="${details-escaped1}" regexp="\n" replace="|n" global="true" defaultValue="${details-escaped1}" />
  473. <antcontrib:propertyregex property="details-escaped3" input="${details-escaped2}" regexp="\r" replace="|r" global="true" defaultValue="${details-escaped2}" />
  474. <property name="${returnTo}" value="${details-escaped3}" />
  475. </target>
  476. <target name="run-integration-test">
  477. <concat>##teamcity[testStarted name='${target-server}' flowId='${target-server}']</concat>
  478. <antcontrib:trycatch property="tried">
  479. <try>
  480. <antcall target="integration-test-${target-server}" />
  481. </try>
  482. <catch>
  483. <antcallback target="teamcity-escape" return="tried-escaped">
  484. <param name="returnTo" value="tried-escaped" />
  485. <param name="message" value="${tried}" />
  486. </antcallback>
  487. <concat>##teamcity[testFailed name='${target-server}' flowId='${target-server}' message='Integration test for ${target-server} failed.' details='${tried-escaped}']"</concat>
  488. </catch>
  489. </antcontrib:trycatch>
  490. <concat>##teamcity[testFinished name='${target-server}' flowId='${target-server}']"</concat>
  491. </target>
  492. <target name="integration-test-get-lock">
  493. <sshexec host="${test.integration.server}" username="${user}" keyfile="${sshkey.file}" command="ant -f ${ant.hub} get-lock" />
  494. </target>
  495. <target name="integration-test-release-lock">
  496. <sshexec host="${test.integration.server}" username="${user}" keyfile="${sshkey.file}" command="ant -f ${ant.hub} release-lock" />
  497. </target>
  498. <!-- Remove demo.war -->
  499. <target name="integration-test-clean">
  500. <sshexec host="${test.integration.server}" username="${user}" keyfile="${sshkey.file}" command="ant -f ${ant.hub} clean" />
  501. </target>
  502. </project>