Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

integration_tests.xml 30KB

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