Author: ryman
Date: Mon Dec 24 07:57:38 2007
New Revision: 606706
URL: http://svn.apache.org/viewvc?rev=606706&view=rev
Log:
[WODEN-188] Committed Tomi's patch.
Added:
incubator/woden/trunk/java/wsdl-viewer-test/prepare-test.xsl
Modified:
incubator/woden/trunk/java/wsdl-viewer-test/ (props changed)
incubator/woden/trunk/java/wsdl-viewer-test/build.xml
Propchange: incubator/woden/trunk/java/wsdl-viewer-test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Dec 24 07:57:38 2007
@@ -0,0 +1 @@
+html
Modified: incubator/woden/trunk/java/wsdl-viewer-test/build.xml
URL:
http://svn.apache.org/viewvc/incubator/woden/trunk/java/wsdl-viewer-test/build.xml?rev=606706&r1=606705&r2=606706&view=diff
==============================================================================
--- incubator/woden/trunk/java/wsdl-viewer-test/build.xml (original)
+++ incubator/woden/trunk/java/wsdl-viewer-test/build.xml Mon Dec 24 07:57:38
2007
@@ -23,6 +23,8 @@
2007-12-09 Arthur Ryman ([EMAIL PROTECTED], [EMAIL PROTECTED])
- created
+ 2007-12-17 tomi vanek ([EMAIL PROTECTED])
+ - agent solution for Ant xslt tag base-dir handling (see
prepare-test.xsl for more details)
-->
<project default="main" basedir=".">
@@ -31,17 +33,47 @@
<property name="test-suite.dir" location="${woden.dir}/downloads/w3c" />
<property name="wsdl-viewer.dir" location="${woden.dir}/wsdl-viewer" />
<property name="wsdl-viewer.xsl"
location="${wsdl-viewer.dir}/wsdl-viewer.xsl" />
+ <property name="result.dir"
location="${woden.dir}/wsdl-viewer-test-result" />
+ <property name="prepare.xsl" location="prepare-test.xsl" />
+
+ <tstamp>
+ <format property="NOW" pattern="d-MMMM-yyyy, HH:mm:ss"
locale="en,US"/>
+ </tstamp>
<!-- =================================
target: main
================================= -->
- <target name="main" description="---> Tests WSDL Viewer"
depends="w3c-html">
+ <target name="main" description="#### Tests WSDL Viewer"
depends="w3c-html">
+ </target>
+
+ <!-- =================================
+ target: init
+ ================================= -->
+ <target name="init" description="## WSDL Viewer Test Initialization">
+ <delete dir="${result.dir}" />
+ <mkdir dir="${result.dir}" />
</target>
- <target name="w3c-html" description="---> Tests the WSDL Viewer against
the W3C Test Suite">
- <delete dir="html" />
- <mkdir dir="html" />
- <xslt force="yes" style="${wsdl-viewer.xsl}"
basedir="${test-suite.dir}/documents" includes="**/*.wsdl" destdir="html"
extension=".html" />
+ <!-- =================================
+ target: w3c-html
+ ================================= -->
+ <target name="w3c-html" description="#### Tests the WSDL Viewer against
the W3C Test Suite">
+ <xslt force="yes" style="${prepare.xsl}"
basedir="${test-suite.dir}" destdir="${test-suite.dir}"
useImplicitFileset="false">
+ <fileset dir="${test-suite.dir}"
includes="**/TestMetadata.xml" />
+ <globmapper from="*TestMetadata.xml"
to="*test.build.xml"/>
+ <param name="timestamp" expression="${NOW}"/>
+ <param name="woden.dir" expression="${woden.dir}"/>
+ <param name="result.dir" expression="${result.dir}"/>
+ </xslt>
+
+ <subant target="test">
+ <fileset dir="${test-suite.dir}"
includes="**/test.build.xml"/>
+ </subant>
+
+ <delete quiet="true">
+ <fileset dir="${test-suite.dir}"
includes="**/test.build.xml"/>
+ </delete>
</target>
-</project>
\ No newline at end of file
+</project>
+
Added: incubator/woden/trunk/java/wsdl-viewer-test/prepare-test.xsl
URL:
http://svn.apache.org/viewvc/incubator/woden/trunk/java/wsdl-viewer-test/prepare-test.xsl?rev=606706&view=auto
==============================================================================
--- incubator/woden/trunk/java/wsdl-viewer-test/prepare-test.xsl (added)
+++ incubator/woden/trunk/java/wsdl-viewer-test/prepare-test.xsl Mon Dec 24
07:57:38 2007
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ! Licensed to the Apache Software Foundation (ASF) under one or more
+ ! contributor license agreements. See the NOTICE file distributed with
+ ! this work for additional information regarding copyright ownership.
+ ! The ASF licenses this file to You under the Apache License, Version 2.0
+ ! (the "License"); you may not use this file except in compliance with
+ ! the License. You may obtain a copy of the License at
+ !
+ ! http://www.apache.org/licenses/LICENSE-2.0
+ !
+ ! Unless required by applicable law or agreed to in writing, software
+ ! distributed under the License is distributed on an "AS IS" BASIS,
+ ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ! See the License for the specific language governing permissions and
+ ! limitations under the License.
+ !-->
+
+<!--
+ This XSLT script prepares an aget (Ant-script) in each test of the w3c
test suite.
+ The agent copies the tested wsdl-viewer.xsl into the tested directory
+ and executes the transformation.
+ The agent solution eliminates base-dir problems in Ant:
+ Ant xslt tag works with base-dir for XSLT includes, but does
not set the base-dir
+ for processed XML's includes. This seems to be a bug in the Ant
tag implementation.
+
+ ChangeLog:
+
+ 2007-12-17 tomi vanek ([EMAIL PROTECTED])
+ - created
+
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+xmlns:tm="http://www.w3.org/2006/02/wsdl/TestMetadata"
exclude-result-prefixes="tm">
+
+<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"
omit-xml-declaration="no" />
+
+<xsl:strip-space elements="*"/>
+
+<xsl:param name="timestamp"/>
+<xsl:param name="woden.dir"/>
+<xsl:param name="result.dir"/>
+
+<xsl:variable name="test.name"
select="substring-after(normalize-space(/*/tm:Identifier),
'test-suite/documents/')"/>
+
+
+<!--
+==================================================================
+ Starting point
+==================================================================
+-->
+
+<xsl:template match="/">
+ <xsl:call-template name="header-comment.render"/>
+
+ <project default="test" basedir=".">
+ <property name="woden.dir" value="{$woden.dir}" />
+ <property name="wsdl-viewer.xsl" value="wsdl-viewer.xsl"/>
+ <property name="wsdl-viewer.dir"
value="${{woden.dir}}/wsdl-viewer" />
+ <property name="result.dir" location="{concat($result.dir, '/',
$test.name)}" />
+
+ <target name="test" description="{concat('## WSDL-viewer Test:
', normalize-space(/*/tm:Title), ' [', normalize-space(/*/tm:Identifier),
']')}">
+ <copy todir="."
file="${{wsdl-viewer.dir}}/${{wsdl-viewer.xsl}}"/>
+ <xslt force="yes" style="${{wsdl-viewer.xsl}}"
basedir="." includes="*.wsdl" destdir="${{result.dir}}" extension=".html" />
+ <delete file="${{wsdl-viewer.xsl}}" quiet="true"/>
+ </target>
+ </project>
+</xsl:template>
+
+
+<!--
+==================================================================
+ Header comment
+==================================================================
+-->
+<xsl:template name="header-comment.render">
+ <xsl:comment><xsl:text>
+</xsl:text>
+<xsl:value-of select="concat('This file was generated for w3c test "',
$test.name, '" ')"/>
+<xsl:if test="$timestamp"><xsl:value-of select="concat(' [', $timestamp,
']')"/></xsl:if>
+<xsl:text>.
+</xsl:text>
+</xsl:comment>
+</xsl:template>
+
+</xsl:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]