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 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?xml version="1.0"?>
  2. <project name="vaadin-uitest" basedir="." default="compile"
  3. xmlns:ivy="antlib:org.apache.ivy.ant">
  4. <description>
  5. Provides a uitest WAR containing Vaadin UI tests
  6. </description>
  7. <include file="../common.xml" as="common" />
  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="theme.result.dir" value="${result.dir}/VAADIN/themes" />
  13. <property name="result.war"
  14. location="${result.dir}/lib/${module.name}-${vaadin.version}.war" />
  15. <!-- Need to give a default value to keep Ivy happy -->
  16. <property name="vaadin.build.repository" value="http://maven.vaadin.com/vaadin-prerelease"/>
  17. <path id="classpath.compile.custom">
  18. </path>
  19. <target name="dependencies">
  20. <!-- This is copied from common.xml to be able to add server.test.source
  21. to the source path -->
  22. <ivy:resolve log="download-only" resolveid="common"
  23. conf="build, build-provided" />
  24. <ivy:cachepath pathid="classpath.compile.dependencies"
  25. conf="build, build-provided" />
  26. </target>
  27. <target name="compile" description="Compiles the module"
  28. depends="dependencies">
  29. <fail unless="module.name" message="No module name given" />
  30. <property name="result.dir" location="result" />
  31. <property name="src" location="${result.dir}/../src/main/java" />
  32. <property name="test.src" location="${result.dir}/../src/test/java" />
  33. <property name="classes" location="${result.dir}/classes" />
  34. <property name="server.test.sources" location="${result.dir}/../../server/src/test/java" />
  35. <mkdir dir="${classes}" />
  36. <javac destdir="${classes}" source="${vaadin.java.version}"
  37. target="${vaadin.java.version}" debug="true" encoding="UTF-8"
  38. includeantruntime="false">
  39. <src path="${src}" />
  40. <classpath location="${classes}" />
  41. <classpath refid="classpath.compile.dependencies" />
  42. <classpath refid="classpath.compile.custom" />
  43. </javac>
  44. <javac destdir="${classes}" source="${vaadin.java.version}"
  45. target="${vaadin.java.version}" debug="true" encoding="UTF-8"
  46. includeantruntime="false">
  47. <src path="${test.src}" />
  48. <classpath location="${classes}" />
  49. <classpath refid="classpath.compile.dependencies" />
  50. <classpath refid="classpath.compile.custom" />
  51. </javac>
  52. </target>
  53. <target name="clean">
  54. <fail unless="result.dir" message="No result.dir parameter given" />
  55. <delete dir="${result.dir}" />
  56. </target>
  57. <target name="test">
  58. </target>
  59. <target name="test-testbench" depends="clean-testbench-errors"
  60. description="Run all TestBench based tests, including server tests">
  61. <parallel>
  62. <daemons>
  63. <!-- Start server -->
  64. <ant antfile="${uitest.dir}/vaadin-server.xml"
  65. inheritall="true" inheritrefs="true" target="deploy-and-start" />
  66. </daemons>
  67. <sequential>
  68. <!-- Server tests -->
  69. <!-- Sleep before running integration tests so testbench
  70. 2 tests have time to compile and start -->
  71. <sleep minutes="4" />
  72. <ant antfile="${uitest.dir}/integration_tests.xml"
  73. target="integration-test-all" inheritall="false"
  74. inheritrefs="false">
  75. <property name="demo.war" value="${war.file}" />
  76. </ant>
  77. </sequential>
  78. <sequential>
  79. <!-- Wait for server to start -->
  80. <ant antfile="${uitest.dir}/vaadin-server.xml"
  81. target="wait-for-startup" />
  82. <!-- TestBench 3 tests -->
  83. <ant antfile="${uitest.dir}/tb3test.xml"
  84. target="run-all-tb3-tests" inheritall="true" />
  85. <echo message="TestBench 3 tests complete" />
  86. </sequential>
  87. </parallel>
  88. </target>
  89. <target name="fetch-war">
  90. <mkdir dir="${vaadin.basedir}/uitest/target"/>
  91. <get src="${vaadin.build.repository}/com/vaadin/vaadin-uitest/${vaadin.version}/vaadin-uitest-${vaadin.version}.war" dest="${vaadin.basedir}/uitest/target/vaadin-uitest-${vaadin.version}.war"/>
  92. </target>
  93. <target name="test-server" depends="clean-testbench-errors">
  94. <property name="war.file"
  95. location="${vaadin.basedir}/uitest/target/vaadin-uitest-${vaadin.version}.war" />
  96. <parallel>
  97. <daemons>
  98. <ant antfile="${uitest.dir}/vaadin-server.xml"
  99. inheritall="true" inheritrefs="true" target="deploy-and-start" />
  100. </daemons>
  101. <sequential>
  102. <ant antfile="${uitest.dir}/integration_tests.xml"
  103. target="integration-test-all" inheritall="false"
  104. inheritrefs="false">
  105. <property name="demo.war" value="${war.file}" />
  106. </ant>
  107. </sequential>
  108. </parallel>
  109. </target>
  110. <target name="test-tb3" depends="clean-testbench-errors,compile">
  111. <property name="war.file"
  112. location="${vaadin.basedir}/uitest/target/vaadin-uitest-${vaadin.version}.war" />
  113. <mkdir dir="${vaadin.basedir}/result" />
  114. <parallel>
  115. <daemons>
  116. <ant antfile="${uitest.dir}/vaadin-server.xml"
  117. inheritall="true" inheritrefs="true" target="deploy-and-start" />
  118. </daemons>
  119. <sequential>
  120. <ant antfile="${uitest.dir}/vaadin-server.xml"
  121. target="wait-for-startup" />
  122. <ant antfile="${uitest.dir}/tb3test.xml" target="run-all-tb3-tests"
  123. inheritall="true" />
  124. </sequential>
  125. </parallel>
  126. </target>
  127. <target name="clean-testbench-errors">
  128. <fail unless="com.vaadin.testbench.screenshot.directory"
  129. message="Define screenshot directory using -Dcom.vaadin.testbench.screenshot.directory" />
  130. <mkdir dir="${com.vaadin.testbench.screenshot.directory}/errors" />
  131. <delete>
  132. <fileset
  133. dir="${com.vaadin.testbench.screenshot.directory}/errors">
  134. <include name="*" />
  135. </fileset>
  136. </delete>
  137. </target>
  138. </project>