This is an automated email from the ASF dual-hosted git repository. jlmonteiro pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomee-tck.git
The following commit(s) were added to refs/heads/master by this push: new 7638802 Make sure we hot replace the war files so that we can swap the servlet adaptor to the CXF servlet 7638802 is described below commit 7638802115e656f4793d12577c54fc5a05e14c38 Author: Jean-Louis Monteiro <jeano...@gmail.com> AuthorDate: Wed Aug 7 16:21:14 2019 +0200 Make sure we hot replace the war files so that we can swap the servlet adaptor to the CXF servlet --- src/test/resources/jaxrs/cxf.xml | 194 +++++++++++++++++++++------------------ 1 file changed, 104 insertions(+), 90 deletions(-) diff --git a/src/test/resources/jaxrs/cxf.xml b/src/test/resources/jaxrs/cxf.xml index 9668bc5..9be8eae 100644 --- a/src/test/resources/jaxrs/cxf.xml +++ b/src/test/resources/jaxrs/cxf.xml @@ -1,97 +1,111 @@ - <project name="CXF package and deploy" default="deploy"> + <!-- + JAX-RS TCK package target: package JAX-RS TCK test application into web archive + + resource.classes: specified in individual test's build.xml, + contains all resource class used in the test + app.name: specified in individual test's build.xml, + is used for web archive name: ${app.name}_web.war + is also used in web application's context root: + ${app.name}_web + web.xml: located in individual test's directory. + Is web application's deployment descriptor. + class.dir: TCK's class directory. Located at $TS_HOME/classes + servlet_adaptor: specified in $TS_HOME/bin/ts.jte. + Required by JAX-RS specification to run in servlet container, + it is imeplementation specific. + appconfig.class: specified in individual test's build.xml. + Required by JAX-RS spec to list all resources in the test application. + --> + + <!-- + JAX-RS TCK deploy target: Deploy JAX-RS web archive + + webapp.dir: autodeploy directory for web application + --> + <import file="../../ts.top.import.xml"/> + + <target name="pre.deploy"> + <fileset id="all.jaxrs.src.dirs" dir="${ts.home}/src" includes="**/web.xml.template"/> + <property name="prop.all.jaxrs.src.dirs" refid="all.jaxrs.src.dirs"/> + <propertyregex property="all.jaxrs.tests.dir" + input="${prop.all.jaxrs.src.dirs}" + regexp="[\/|\\]web.xml.template" + replace="" + casesensitive="false"/> + <!-- It seems the separator can be != path.separator --> + <propertyregex property="all.jaxrs.tests.dir.correct.separator" + input="${all.jaxrs.tests.dir}" + regexp=";" + replace="${path.separator}" + casesensitive="false"/> + <foreach list="${all.jaxrs.tests.dir.correct.separator}" + delimiter="${path.separator}" + target="all_action" + param="pkg.dir"/> + </target> + + <target name="check.web.xml"> + <available file="${ts.home}/src/${pkg.dir}/web.xml.template" property="exist.web.xml"/> + </target> + + <target name="all_action" depends="update_servlet_adaptor,copywar"/> + + <target name="update_servlet_adaptor" depends="check.web.xml" if="exist.web.xml"> + + <echo message=">>> Servlet adaptor class ${servlet_adaptor}"/> + <!-- - JAX-RS TCK package target: package JAX-RS TCK test application into web archive - - resource.classes: specified in individual test's build.xml, - contains all resource class used in the test - app.name: specified in individual test's build.xml, - is used for web archive name: ${app.name}_web.war - is also used in web application's context root: - ${app.name}_web - web.xml: located in individual test's directory. - Is web application's deployment descriptor. - class.dir: TCK's class directory. Located at $TS_HOME/classes - servlet_adaptor: specified in $TS_HOME/bin/ts.jte. - Required by JAX-RS specification to run in servlet container, - it is imeplementation specific. - appconfig.class: specified in individual test's build.xml. - Required by JAX-RS spec to list all resources in the test application. + Create implementation specific web with servlet information --> + <copy file="${ts.home}/src/${pkg.dir}/web.xml.template" verbose="true" + tofile="${ts.home}/dist/${pkg.dir}/web.xml.${jaxrs_impl_name}"/> - <!-- - JAX-RS TCK deploy target: Deploy JAX-RS web archive + <replace file="${ts.home}/dist/${pkg.dir}/web.xml.${jaxrs_impl_name}" value="${servlet_adaptor}" summary="yes"> + <replacetoken>servlet_adaptor</replacetoken> + </replace> - webapp.dir: autodeploy directory for web application + <!-- + Create implementation specfic war files with + updated web.xml; + servlet class; --> - <import file="../../ts.top.import.xml"/> - <property name="all.jaxrs.tests.dir" - value="com/sun/ts/tests/jaxrs/spec/template,com/sun/ts/tests/jaxrs/spec/exposureTest,com/sun/ts/tests/jaxrs/spec/inheritanceTest,com/sun/ts/tests/jaxrs/spec/returnType,com/sun/ts/tests/jaxrs/ee/rs/deleteTest,com/sun/ts/tests/jaxrs/ee/rs/headTest,com/sun/ts/tests/jaxrs/ee/rs/matrixParamTest,com/sun/ts/tests/jaxrs/ee/rs/queryParamTest,com/sun/ts/tests/jaxrs/ee/rs/cookieParamTest,com/sun/ts/tests/jaxrs/ee/rs/getTest,com/sun/ts/tests/jaxrs/ee/rs/headerParamTest,com/sun/ts/tests [...] - - <target name="pre.deploy"> - <foreach list="${all.jaxrs.tests.dir}" - delimiter="," - target="all_action" - param="pkg.dir"/> - </target> - - <target name="all_action"> - - <!-- - Create implementation specific web with servlet information - --> - <copy file="${ts.home}/src/${pkg.dir}/web.xml.template" tofile="${ts.home}/src/${pkg.dir}/web.xml.${jaxrs_impl_name}" overwrite="true" /> - - <echo message="${servlet_adaptor}"/> - <replace file="${ts.home}/src/${pkg.dir}/web.xml.${jaxrs_impl_name}" value="${servlet_adaptor}"> - <replacetoken>servlet_adaptor</replacetoken> - </replace> - - <!-- - Create implementation specfic war files with - updated web.xml; - servlet class; - --> - <fileset id="dist.contents" dir="${ts.home}/dist/${pkg.dir}" includes="jaxrs*.war.template"/> - <property name="prop.dist.contents" refid="dist.contents"/> - <echo>${prop.dist.contents}</echo> - <propertyregex property="app.name.1" - input="${prop.dist.contents}" - regexp=" " - replace=""/> - <propertyregex property="app.name" - input="${prop.dist.contents}" - regexp="_web.war.template$" - replace=""/> - <echo>${app.name}</echo> - - <echo message="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}"/> - <copy file="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.template" - tofile="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}"/> - - <jar destfile="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}" update="true"> - <zipfileset dir="${ts.home}/src/${pkg.dir}" - includes="web.xml.${jaxrs_impl_name}" - fullpath="WEB-INF/web.xml"/> - </jar> - - <!--unjar src="${jaxrs_impl_lib}" dest="${ts.home}/tmp"> - <patternset> - <include name="${servlet_adaptor}"/> - </patternset> - </unjar> - - <jar destfile="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}" update="true"> - <zipfileset dir="${ts.home}/tmp/" - includes="${servlet_adaptor}" - prefix="WEB-INF/classes" /> - </jar--> - - <copy failonerror="false" - file="${dist.dir}/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}" - tofile="${dist.dir}/${pkg.dir}/${app.name}_web.war" /> - <echo message="${jaxrs_impl_name}"/> - </target> - - </project> + + <antcall target="updatewar"/> + </target> + + <target name="get.app.name"> + <fileset id="dist.contents" dir="${ts.home}/dist/${pkg.dir}" includes="jaxrs*.war.template"/> + <property name="prop.dist.contents" refid="dist.contents"/> + <propertyregex property="app.name" + input="${prop.dist.contents}" + regexp="_web.war.template$" + replace=""/> + </target> + + <target name="updatewar" depends="get.app.name" if="app.name"> + <!-- Copy web.war.template to web.war.cxf --> + <jar destfile="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}" update="true"> + <zipfileset src="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.template" + excludes="WEB-INF/web.xml"/> + </jar> + <!-- Copy web.xml to web.war.cxf --> + <jar destfile="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}" update="true"> + <zipfileset dir="${ts.home}/dist/${pkg.dir}" + includes="web.xml.${jaxrs_impl_name}" + fullpath="WEB-INF/web.xml"/> + </jar> + <copy failonerror="false" verbose="true" + file="${dist.dir}/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}" + tofile="${dist.dir}/${pkg.dir}/${app.name}_web.war"/> + </target> + + <!-- for 3.0 servlet wars without web.xml --> + <target name="copywar" depends="check.web.xml,get.app.name" if="app.name" unless="exist.web.xml"> + <copy failonerror="false" verbose="true" + file="${dist.dir}/${pkg.dir}/${app.name}_web.war.template" + tofile="${dist.dir}/${pkg.dir}/${app.name}_web.war"/> + </target> + +</project>