You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by up...@apache.org on 2004/04/28 23:29:08 UTC

cvs commit: cocoon-2.1/src/webapp/test-suite/xdocs index.xml

upayavira    2004/04/28 14:29:08

  Modified:    .        build.properties
               tools/targets webapp-build.xml
  Added:       src/webapp/test-suite sitemap.xmap
               src/webapp/test-suite/stylesheets simple-xdoc2html.xslt
               src/webapp/test-suite/xdocs index.xml
  Log:
  Adding a very simple 'test-suite' webapp, for use in automated testing.
  Will be used in an up-coming CocoonBeanTestCase.
  
  Revision  Changes    Path
  1.37      +3 -0      cocoon-2.1/build.properties
  
  Index: build.properties
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/build.properties,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- build.properties	8 Mar 2004 06:07:14 -0000	1.36
  +++ build.properties	28 Apr 2004 21:29:08 -0000	1.37
  @@ -26,6 +26,7 @@
   #exclude.webapp.documentation=true
   #exclude.webapp.javadocs=true
   #exclude.webapp.samples=true
  +#exclude.webapp.test-suite=true
   
   # ---- Build Exclusions --------------------------------------------------------
   
  @@ -92,6 +93,7 @@
   build.webapp.classes=${build.webapp.webinf}/classes
   build.webapp.lib=${build.webapp.webinf}/lib
   build.webapp.samples=${build.webapp}/samples
  +build.webapp.test-suite=${build.webapp}/test-suite
   build.webapp.docs=${build.webapp}/docs
   build.webapp.javadocs=${build.webapp}/api/java
   build.webapp.loglevel=INFO
  @@ -136,6 +138,7 @@
   samples=${src}/samples
   webapp=${src}/webapp
   webapp.samples=${webapp}/samples
  +webapp.test-suite=${webapp}/test-suite
   customconf=${src}/confpatch
   
   # Deprecated Stuff
  
  
  
  1.15      +8 -1      cocoon-2.1/tools/targets/webapp-build.xml
  
  Index: webapp-build.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/tools/targets/webapp-build.xml,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- webapp-build.xml	2 Apr 2004 19:07:49 -0000	1.14
  +++ webapp-build.xml	28 Apr 2004 21:29:08 -0000	1.15
  @@ -92,6 +92,13 @@
   
     <target name="prepare-webapp-samples" depends="prepare-webapp, samples, block-samples" unless="internal.exclude.webapp.samples"/>
   
  +  <target name="prepare-webapp-test-suite" depends="prepare-webapp" unless="internal.exclude.webapp.test-suite">
  +    <!-- copy test suite files -->
  +    <copy todir="${build.webapp.test-suite}">
  +      <fileset dir="${webapp.test-suite}"/>
  +    </copy>
  +  </target>
  +
     <target name="prepare-webapp-deprecated" depends="prepare-webapp" unless="internal.exclude.deprecated">
       <copy file="${build}/${name}-deprecated.jar" tofile="${build.webapp.lib}/${name}-${version}-deprecated.jar"/>
       <xpatch file="${build.webapp}/WEB-INF/cocoon.xconf"
  @@ -152,7 +159,7 @@
               includes="**/*.xwelcome"/>
     </target>
   
  -  <target name="webapp" depends="prepare-webapp,prepare-webapp-samples,prepare-webapp-docs,prepare-webapp-javadocs,prepare-webapp-deprecated,validate-jars,validate-config,custom-conf" description="Builds web application folder">
  +  <target name="webapp" depends="prepare-webapp,prepare-webapp-samples,prepare-webapp-docs,prepare-webapp-javadocs,prepare-webapp-test-suite,prepare-webapp-deprecated,validate-jars,validate-config,custom-conf" description="Builds web application folder">
     </target>
   
     <target name="war" depends="webapp" description="Builds web application archive">
  
  
  
  1.1                  cocoon-2.1/src/webapp/test-suite/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed 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.
  -->
  
  <!-- CVS $Id: sitemap.xmap,v 1.1 2004/04/28 21:29:08 upayavira Exp $ -->
  
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  
  <!-- =========================== Components ================================ -->
  
   <map:components>
    <map:generators default="file"/>
    <map:transformers default="xslt"/>
    <map:readers default="resource"/>
    <map:serializers default="html"/>
    <map:matchers default="wildcard"/>
    <map:selectors default="browser"/>
   </map:components>
  
  <!-- =========================== Views =================================== -->
  
   <map:views>
    <map:view name="content" from-label="content">
     <map:serialize type="xml"/>
    </map:view>
  
    <map:view from-label="content" name="pretty-content">
      <map:transform src="context://stylesheets/system/xml2html.xslt"/>
      <map:serialize type="html"/>
    </map:view>
  
    <map:view name="links" from-position="last">
     <map:serialize type="links"/>
    </map:view>
   </map:views>
  
  <!-- =========================== Pipelines ================================= -->
  
   <map:pipelines>
    <map:pipeline>
  
     <map:match pattern="static-site/**.html">
       <map:generate src="xdocs/{1}.xml"/>
       <map:transform src="stylesheets/xdoc2html.xslt">
        <map:parameter name="contextPath" value="{request:contextPath}"/>
       </map:transform>
       <map:serialize type="html"/>
     </map:match>
     </map:pipeline>
   </map:pipelines>
  </map:sitemap>
  
  
  
  1.1                  cocoon-2.1/src/webapp/test-suite/stylesheets/simple-xdoc2html.xslt
  
  Index: simple-xdoc2html.xslt
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed 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.
  -->
  
  <!--+
      | Converts output of the StatusGenerator into HTML page
      | 
      | CVS $Id: simple-xdoc2html.xslt,v 1.1 2004/04/28 21:29:08 upayavira Exp $
      +-->
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:status="http://apache.org/cocoon/status/2.0">
   
    <xsl:param name="contextPath"/>
  
    <xsl:template match="status:statusinfo">
      <html>
        <head>
          <title>Cocoon Status [<xsl:value-of select="@status:host"/>]</title>
          <link href="{$contextPath}/styles/main.css" type="text/css" rel="stylesheet"/>
          <script src="{$contextPath}/scripts/main.js" type="text/javascript"/>
        </head>
  
        <body>
          <h1><xsl:value-of select="@status:host"/> - <xsl:value-of select="@status:date"/></h1>
          <xsl:apply-templates/>
        </body>
      </html>
    </xsl:template>
  
    <xsl:template match="status:group">
      <h2><xsl:value-of select="@status:name"/></h2>
      <ul><xsl:apply-templates select="status:value"/></ul>
      <xsl:apply-templates select="status:group"/>
    </xsl:template>
  
    <xsl:template match="status:value">
      <li>
        <span class="description"><xsl:value-of select="@status:name"/><xsl:text>: </xsl:text></span>
        <xsl:choose>
          <xsl:when test="contains(@status:name,'free') or contains(@status:name,'total')">
            <xsl:call-template name="suffix">
              <xsl:with-param name="bytes" select="number(.)"/>
            </xsl:call-template>
          </xsl:when>      
          <xsl:when test="count(status:line) &lt;= 1">
            <xsl:value-of select="status:line"/>
          </xsl:when>
          <xsl:otherwise>
            <span class="switch" id="{generate-id(.)}-switch" onclick="toggle('{generate-id(.)}')">[show]</span>
            <ul id="{generate-id(.)}" style="display: none">
               <xsl:apply-templates />
            </ul>
          </xsl:otherwise>
        </xsl:choose>
      </li>
    </xsl:template>
  
    <xsl:template match="status:line">
      <li><xsl:value-of select="."/></li>
    </xsl:template>
  
    <xsl:template name="suffix">
      <xsl:param name="bytes"/>
      <xsl:choose>
        <!-- More than 4 MB (=4194304) -->
        <xsl:when test="$bytes &gt;= 4194304">
          <xsl:value-of select="round($bytes div 10485.76) div 100"/> MB
        </xsl:when>
        <!-- More than 4 KB (=4096) -->
        <xsl:when test="$bytes &gt; 4096">
          <xsl:value-of select="round($bytes div 10.24) div 100"/> KB
        </xsl:when>
        <!-- Less -->
        <xsl:otherwise>
          <xsl:value-of select="$bytes"/> B
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/webapp/test-suite/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed 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.
  -->
  <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "dtd/document-v10.dtd">
  <document>
    <header>
      <title>Cocoon TestSuite</title>
      <authors>
        <person name="Cocoon community" email="dev@cocoon.apache.org"/>
      </authors>
    </header>
    <body>
      <s1 title="General information">
        <p>
            Apache Cocoon is a web development framework built around the concepts 
            of component-based web development and separation of concerns, ensuring 
            that people can interact and collaborate on a project without stepping 
            on each other toes.
        </p>
        <p>
            The purpose of these pages is to provide a webapp to be used in testing
            Cocoon itself. These pages are not intended to be read by humans - rather
            to be read by automated tests that are a part of Cocoon itself.
        </p>
      </s1>    
    </body>
  </document>