You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.xml 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <?xml version="1.0"?>
  2. <project name="vaadin-uitest" basedir="." default="publish-local" xmlns:ivy="antlib:org.apache.ivy.ant">
  3. <description>
  4. Provides a uitest WAR containing Vaadin UI tests
  5. </description>
  6. <include file="../common.xml" as="common" />
  7. <include file="../build.xml" as="vaadin" />
  8. <!-- global properties -->
  9. <property name="module.name" value="vaadin-uitest" />
  10. <property name="uitest.dir" location="${vaadin.basedir}/uitest" />
  11. <property name="result.dir" value="result" />
  12. <property name="result.war" location="${result.dir}/lib/${module.name}-${vaadin.version}.war" />
  13. <path id="classpath.compile.custom">
  14. </path>
  15. <target name="dependencies">
  16. <!-- This is copied from common.xml to be able to add server.test.source
  17. to the source path -->
  18. <ivy:resolve log="download-only" resolveid="common" conf="build, build-provided" />
  19. <ivy:cachepath pathid="classpath.compile.dependencies" conf="build, build-provided" />
  20. </target>
  21. <target name="compile" description="Compiles the module" depends="dependencies">
  22. <fail unless="module.name" message="No module name given" />
  23. <property name="result.dir" location="result" />
  24. <property name="src" location="${result.dir}/../src" />
  25. <property name="classes" location="${result.dir}/classes" />
  26. <property name="server.test.sources" location="${result.dir}/../../server/tests/src" />
  27. <mkdir dir="${classes}" />
  28. <!-- TODO: Get rid of this -->
  29. <javac destdir="${classes}" source="${vaadin.java.version}" target="${vaadin.java.version}" debug="true" encoding="UTF-8" includeantruntime="false">
  30. <src path="${server.test.sources}" />
  31. <include name="com/vaadin/tests/data/bean/**" />
  32. <include name="com/vaadin/tests/VaadinClasses.java" />
  33. <include name="com/vaadin/data/util/sqlcontainer/SQLTestsConstants.java" />
  34. <classpath refid="classpath.compile.dependencies" />
  35. <classpath refid="classpath.compile.custom" />
  36. </javac>
  37. <javac destdir="${classes}" source="${vaadin.java.version}" target="${vaadin.java.version}" debug="true" encoding="UTF-8" includeantruntime="false">
  38. <src path="${src}" />
  39. <classpath location="${classes}" />
  40. <classpath refid="classpath.compile.dependencies" />
  41. <classpath refid="classpath.compile.custom" />
  42. </javac>
  43. </target>
  44. <target name="testing-widgetset" depends="dependencies,compile">
  45. <property name="module" value="com.vaadin.tests.widgetset.TestingWidgetSet" />
  46. <property name="style" value="OBF" />
  47. <property name="localWorkers" value="6" />
  48. <property name="extraParams" value="" />
  49. <property name="module.output.dir" location="${result.dir}/VAADIN/widgetsets" />
  50. <property name="work.dir" location="${result.dir}/work" />
  51. <mkdir dir="${module.output.dir}" />
  52. <echo>Compiling ${module} to ${module.output.dir}</echo>
  53. <!-- compile the module -->
  54. <java classname="com.google.gwt.dev.Compiler" classpathref="classpath.compile.dependencies" failonerror="yes" fork="yes" maxmemory="512m">
  55. <classpath location="src" />
  56. <classpath location="${classes}" />
  57. <arg value="-workDir" />
  58. <arg value="${work.dir}" />
  59. <arg value="-logLevel" />
  60. <arg value="TRACE" />
  61. <arg value="-war" />
  62. <arg value="${module.output.dir}" />
  63. <arg value="-style" />
  64. <arg value="${style}" />
  65. <arg value="-localWorkers" />
  66. <arg value="${localWorkers}" />
  67. <arg value="-strict" />
  68. <arg line="${extraParams}" />
  69. <arg value="${module}" />
  70. <sysproperty key="vFailIfNotSerializable" value="true" />
  71. <jvmarg value="-Xss8M" />
  72. <jvmarg value="-XX:MaxPermSize=256M" />
  73. <jvmarg value="-Djava.awt.headless=true" />
  74. </java>
  75. </target>
  76. <target name="war" depends="dependencies, compile, testing-widgetset">
  77. <property name="result.dir" location="result" />
  78. <property name="classes" location="${result.dir}/classes" />
  79. <property name="WebContent.dir" location="${vaadin.basedir}/WebContent" />
  80. <property name="deps.dir" location="${result.dir}/deps" />
  81. <property name="src" location="${result.dir}/../src" />
  82. <ivy:resolve log="download-only" resolveid="common" conf="build" />
  83. <ivy:cachepath pathid="classpath.runtime.dependencies" conf="build" />
  84. <delete dir="${deps.dir}" />
  85. <mkdir dir="${deps.dir}" />
  86. <copy todir="${deps.dir}" flatten="true">
  87. <path refid="classpath.runtime.dependencies" />
  88. </copy>
  89. <delete>
  90. <!-- Avoid including some potentially conflicting jars in the war -->
  91. <fileset dir="${deps.dir}" includes="jetty-*.jar" />
  92. <fileset dir="${deps.dir}" includes="servlet-api-*.jar" />
  93. </delete>
  94. <!-- Ensure filtered webcontent files are available -->
  95. <antcall target="common.filter.webcontent" />
  96. <war destfile="${result.war}" duplicate="fail" index="true">
  97. <fileset refid="common.files.for.all.jars" />
  98. <fileset dir="${result.dir}">
  99. <include name="VAADIN/widgetsets/**/*" />
  100. </fileset>
  101. <fileset dir="${WebContent.dir}">
  102. <include name="statictestfiles/**" />
  103. <include name="VAADIN/themes/tests-*/**" />
  104. <include name="VAADIN/themes/reindeer-tests/**" />
  105. <include name="VAADIN/jquery.atmosphere.js" />
  106. <include name="WEB-INF/*.xml" />
  107. <include name="WEB-INF/web.xml.2.4" />
  108. </fileset>
  109. <classes dir="${classes}" />
  110. <classes dir="${src}" />
  111. <lib dir="${deps.dir}" />
  112. </war>
  113. </target>
  114. <target name="publish-local" depends="war">
  115. <antcall target="common.publish-local">
  116. <param name="conf" value="build" />
  117. </antcall>
  118. </target>
  119. <target name="clean">
  120. <antcall target="common.clean" />
  121. </target>
  122. <target name="checkstyle">
  123. <echo>Checkstyle is disabled for uitest for now</echo>
  124. </target>
  125. <target name="test" depends="checkstyle">
  126. </target>
  127. <target name="test-testbench" depends="clean-testbench-errors" description="Run all TestBench based tests, including server tests">
  128. <parallel>
  129. <daemons>
  130. <!-- Start server -->
  131. <ant antfile="${uitest.dir}/vaadin-server.xml" inheritall="true" inheritrefs="true" target="deploy-and-start" />
  132. </daemons>
  133. <sequential>
  134. <!-- Server tests -->
  135. <!-- Sleep before running integration tests so testbench 2
  136. tests have time to compile and start -->
  137. <sleep minutes="4" />
  138. <ant antfile="${uitest.dir}/integration_tests.xml" target="integration-test-all" inheritall="false" inheritrefs="false">
  139. <property name="demo.war" value="${war.file}" />
  140. </ant>
  141. </sequential>
  142. <sequential>
  143. <!-- Wait for server to start -->
  144. <ant antfile="${uitest.dir}/vaadin-server.xml" target="wait-for-startup" />
  145. <!-- Run all different kinds of TestBench tests in parallel -->
  146. <parallel>
  147. <!-- Legacy TestBench 2 tests -->
  148. <sequential>
  149. <ant antfile="${uitest.dir}/test.xml" target="tb2-tests" />
  150. <echo message="TestBench 2 tests complete" />
  151. </sequential>
  152. <!-- TestBench 3 tests -->
  153. <sequential>
  154. <ant antfile="${uitest.dir}/tb3test.xml" target="run-all-tb3-tests" inheritall="true" />
  155. <echo message="TestBench 3 tests complete" />
  156. </sequential>
  157. </parallel>
  158. </sequential>
  159. </parallel>
  160. </target>
  161. <target name="test-server" depends="clean-testbench-errors">
  162. <property name="war.file" location="${vaadin.basedir}/result/artifacts/${vaadin.version}/vaadin-uitest/vaadin-uitest-${vaadin.version}.war" />
  163. <parallel>
  164. <daemons>
  165. <ant antfile="${uitest.dir}/vaadin-server.xml" inheritall="true" inheritrefs="true" target="deploy-and-start" />
  166. </daemons>
  167. <sequential>
  168. <ant antfile="${uitest.dir}/integration_tests.xml" target="integration-test-all" inheritall="false" inheritrefs="false">
  169. <property name="demo.war" value="${war.file}" />
  170. </ant>
  171. </sequential>
  172. </parallel>
  173. </target>
  174. <target name="test-tb2" depends="clean-testbench-errors">
  175. <property name="war.file" location="${vaadin.basedir}/result/artifacts/${vaadin.version}/vaadin-uitest/vaadin-uitest-${vaadin.version}.war" />
  176. <parallel>
  177. <daemons>
  178. <ant antfile="${uitest.dir}/vaadin-server.xml" inheritall="true" inheritrefs="true" target="deploy-and-start" />
  179. </daemons>
  180. <sequential>
  181. <ant antfile="${uitest.dir}/vaadin-server.xml" target="wait-for-startup" />
  182. <ant antfile="${uitest.dir}/test.xml" target="tb2-tests" />
  183. </sequential>
  184. </parallel>
  185. </target>
  186. <target name="test-tb3" depends="clean-testbench-errors">
  187. <property name="war.file" location="${vaadin.basedir}/result/artifacts/${vaadin.version}/vaadin-uitest/vaadin-uitest-${vaadin.version}.war" />
  188. <parallel>
  189. <daemons>
  190. <ant antfile="${uitest.dir}/vaadin-server.xml" inheritall="true" inheritrefs="true" target="deploy-and-start" />
  191. </daemons>
  192. <sequential>
  193. <ant antfile="${uitest.dir}/vaadin-server.xml" target="wait-for-startup" />
  194. <ant antfile="${uitest.dir}/tb3test.xml" target="run-all-tb3-tests" inheritall="true" />
  195. </sequential>
  196. </parallel>
  197. </target>
  198. <target name="clean-testbench-errors">
  199. <fail unless="com.vaadin.testbench.screenshot.directory" message="Define screenshot directory using -Dcom.vaadin.testbench.screenshot.directory" />
  200. <mkdir dir="${com.vaadin.testbench.screenshot.directory}/errors" />
  201. <delete>
  202. <fileset dir="${com.vaadin.testbench.screenshot.directory}/errors">
  203. <include name="*" />
  204. </fileset>
  205. </delete>
  206. </target>
  207. </project>