You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by re...@apache.org on 2008/06/24 17:36:07 UTC
svn commit: r671213 - in
/cocoon/whiteboard/corona/trunk/corona-sample-webapp: ./ src/test/
src/test/java/ src/test/java/org/ src/test/java/org/apache/
src/test/java/org/apache/cocoon/ src/test/java/org/apache/cocoon/corona/
src/test/java/org/apache/co...
Author: reinhard
Date: Tue Jun 24 08:36:06 2008
New Revision: 671213
URL: http://svn.apache.org/viewvc?rev=671213&view=rev
Log:
. initial integration test suite for Corona
Added:
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/AggregationTest.java (with props)
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CachingOfPipelinesTest.java (with props)
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CoronaHtmlUnitTestCase.java (with props)
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ErrorHandlingTest.java (with props)
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ExpressionLanguageTest.java (with props)
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/MatcherTest.java (with props)
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ObjectModelTest.java (with props)
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ParameterPassing.java (with props)
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ReaderTest.java (with props)
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/RedirectTest.java (with props)
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/SaxPipelineTest.java (with props)
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ServletServiceTest.java (with props)
cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/XSLTTest.java (with props)
Modified:
cocoon/whiteboard/corona/trunk/corona-sample-webapp/pom.xml
Modified: cocoon/whiteboard/corona/trunk/corona-sample-webapp/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sample-webapp/pom.xml?rev=671213&r1=671212&r2=671213&view=diff
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sample-webapp/pom.xml (original)
+++ cocoon/whiteboard/corona/trunk/corona-sample-webapp/pom.xml Tue Jun 24 08:36:06 2008
@@ -41,7 +41,7 @@
<configuration>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>8888</port>
+ <port>8890</port>
<maxIdleTime>30000</maxIdleTime>
</connector>
</connectors>
@@ -49,6 +49,14 @@
<contextPath>/</contextPath>
</configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/cocoon/corona/it/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
</plugins>
</build>
@@ -56,7 +64,11 @@
<dependency>
<groupId>org.apache.cocoon.corona</groupId>
<artifactId>corona-sample</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-it-fw</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
@@ -64,4 +76,122 @@
</dependency>
</dependencies>
+ <profiles>
+ <profile>
+ <id>it</id>
+ <build>
+ <plugins>
+ <!-- Integration tests -->
+ <plugin>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-it-fw</artifactId>
+ <configuration>
+ <webAppDirectory>./target/corona-sample-webapp-${project.version}</webAppDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <id>jetty-start</id>
+ <goals>
+ <goal>jetty-start</goal>
+ </goals>
+ <phase>pre-integration-test</phase>
+ </execution>
+ <execution>
+ <id>jetty-stop</id>
+ <goals>
+ <goal>jetty-stop</goal>
+ </goals>
+ <phase>post-integration-test</phase>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>net.sourceforge.cobertura</groupId>
+ <artifactId>cobertura</artifactId>
+ <version>1.9</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/cocoon/corona/it/**</exclude>
+ </excludes>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <phase>integration-test</phase>
+ <configuration>
+ <excludes>
+ <exclude>none</exclude>
+ </excludes>
+ <includes>
+ <include>**/cocoon/corona/it/**</include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>cobertura-it</id>
+ <build>
+ <plugins>
+ <!-- Cobertura -->
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>cobertura-instrumentation</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <property name="plugin_classpath" refid="maven.plugin.classpath"/>
+ <property name="datafile" value="${basedir}/target/cobertura.ser"/>
+ <ant antfile="${basedir}/cobertura-ant.xml">
+ <target name="instrument"/>
+ </ant>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>cobertura-report</id>
+ <phase>post-integration-test</phase>
+ <configuration>
+ <tasks>
+ <property name="plugin_classpath" refid="maven.plugin.classpath"/>
+ <property name="datafile" value="${basedir}/target/cobertura.ser"/>
+ <ant antfile="${basedir}/cobertura-ant.xml">
+ <target name="report"/>
+ </ant>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>net.sourceforge.cobertura</groupId>
+ <artifactId>cobertura</artifactId>
+ <version>1.9</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
</project>
Added: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/AggregationTest.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/AggregationTest.java?rev=671213&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/AggregationTest.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/AggregationTest.java Tue Jun 24 08:36:06 2008
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.corona.it;
+
+/**
+ * Test aggregation.
+ */
+public class AggregationTest extends CoronaHtmlUnitTestCase {
+
+ /**
+ * A pipeline that uses the IncludeTransformer.
+ */
+ public void testIncludeTransformer() throws Exception {
+ this.loadXmlPage("aggregation/include-transformer");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/sample/sub1/sub/text()", "sub");
+ this.assertXPath("/sample/sub2/sub/text()", "sub");
+ }
+
+}
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/AggregationTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/AggregationTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/AggregationTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CachingOfPipelinesTest.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CachingOfPipelinesTest.java?rev=671213&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CachingOfPipelinesTest.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CachingOfPipelinesTest.java Tue Jun 24 08:36:06 2008
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.corona.it;
+
+/**
+ * Test pipeline caching
+ */
+public class CachingOfPipelinesTest extends CoronaHtmlUnitTestCase {
+
+ // /**
+ // * A non-caching pipeline mustn't produce the same result twice.
+ // */
+ // public void testNonCachingPipeline() throws Exception {
+ // this.loadResponse("caching-pipeline/off");
+ // String content1 = this.response.getContentAsString();
+ // assertNotNull(content1);
+ // this.loadResponse("caching-pipeline/off");
+ // String content2 = this.response.getContentAsString();
+ // assertNotNull(content2);
+ // assertFalse("The response has to change with every request.", content1.equals(content2));
+ // }
+
+ /**
+ * This caching pipeline always returns the same.
+ */
+ public void testCachingPipeline() throws Exception {
+ this.loadResponse("caching-pipeline/on");
+ String content1 = this.response.getContentAsString();
+ assertNotNull(content1);
+ this.loadResponse("caching-pipeline/on");
+ String content2 = this.response.getContentAsString();
+ assertNotNull(content2);
+ assertTrue("The response has to be always the same.", content1.equals(content2));
+ }
+
+}
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CachingOfPipelinesTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CachingOfPipelinesTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CachingOfPipelinesTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CoronaHtmlUnitTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CoronaHtmlUnitTestCase.java?rev=671213&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CoronaHtmlUnitTestCase.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CoronaHtmlUnitTestCase.java Tue Jun 24 08:36:06 2008
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.corona.it;
+
+import java.net.URL;
+
+import org.apache.cocoon.tools.it.HtmlUnitTestCase;
+
+public abstract class CoronaHtmlUnitTestCase extends HtmlUnitTestCase {
+
+ private static final String BASEURL = "http://localhost:8890";
+
+ @Override
+ protected URL setupBaseUrl() throws Exception {
+ String baseUrl = System.getProperty("htmlunit.base-url");
+ if (baseUrl == null) {
+ baseUrl = BASEURL;
+ }
+ return new URL(baseUrl);
+ }
+
+}
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CoronaHtmlUnitTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CoronaHtmlUnitTestCase.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/CoronaHtmlUnitTestCase.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ErrorHandlingTest.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ErrorHandlingTest.java?rev=671213&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ErrorHandlingTest.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ErrorHandlingTest.java Tue Jun 24 08:36:06 2008
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.corona.it;
+
+/**
+ * Test error handling of sitemaps.
+ */
+public class ErrorHandlingTest extends CoronaHtmlUnitTestCase {
+
+ public void testPerSitemap404() throws Exception {
+ this.loadResponse("12345678901234567890");
+ int statusCode = this.response.getStatusCode();
+ assertTrue(statusCode == 404);
+ assertTrue(this.response.getContentAsString().indexOf("404 Resource Not Available (Corona Integration Tests)") > 0);
+ }
+
+ public void testPerSitemapCustomError() throws Exception {
+ this.loadResponse("error-handling/custom-error");
+ int statusCode = this.response.getStatusCode();
+ assertTrue(statusCode == 500);
+ assertTrue(this.response.getContentAsString().indexOf("Error 500 (Corona Integration Tests)") > 0);
+ }
+
+ public void testPerPipelineCustomError() throws Exception {
+ this.loadResponse("error-handling/custom-error-per-pipeline-error-handling");
+ int statusCode = this.response.getStatusCode();
+ assertTrue(statusCode == 501);
+ assertTrue(this.response.getContentAsString().indexOf("Error 501 (Corona Integration Tests)") > 0);
+ }
+}
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ErrorHandlingTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ErrorHandlingTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ErrorHandlingTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ExpressionLanguageTest.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ExpressionLanguageTest.java?rev=671213&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ExpressionLanguageTest.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ExpressionLanguageTest.java Tue Jun 24 08:36:06 2008
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.corona.it;
+
+/**
+ * Test expression language usage
+ */
+public class ExpressionLanguageTest extends CoronaHtmlUnitTestCase {
+
+ /**
+ * JEXL test
+ */
+ public void testJexl() throws Exception {
+ this.loadXmlPage("expression-language/jexl?fileName=simple");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/simple", "simple-text");
+ }
+
+ /**
+ * Map language test
+ */
+ public void testMap() throws Exception {
+ this.loadXmlPage("expression-language/map/simple");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/simple", "simple-text");
+ }
+
+ /**
+ * Nested matchers/maps
+ */
+ public void testNextedMap() throws Exception {
+ this.loadXmlPage("expression-language/nested/simple");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/simple", "simple-text");
+ }
+
+}
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ExpressionLanguageTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ExpressionLanguageTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ExpressionLanguageTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/MatcherTest.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/MatcherTest.java?rev=671213&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/MatcherTest.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/MatcherTest.java Tue Jun 24 08:36:06 2008
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.corona.it;
+
+/**
+ * Testing advanced matching scenarios.
+ */
+public class MatcherTest extends CoronaHtmlUnitTestCase {
+
+ public void testStartsWithWhen() throws Exception {
+ this.loadXmlPage("advanced-matching?myparam=55");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/html/body/p", "5");
+ }
+
+ public void testEqualsWhen() throws Exception {
+ this.loadXmlPage("advanced-matching?myparam=11");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/html/body/p", "11");
+ }
+
+ public void testRegexpWhen() throws Exception {
+ this.loadXmlPage("advanced-matching?myparam=22");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/html/body/p", "2");
+ }
+
+ public void testOtherwise() throws Exception {
+ this.loadXmlPage("advanced-matching?myparam=32");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/html/body/p", "otherwise");
+
+ this.loadXmlPage("advanced-matching");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/html/body/p", "otherwise");
+ }
+
+}
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/MatcherTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/MatcherTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/MatcherTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ObjectModelTest.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ObjectModelTest.java?rev=671213&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ObjectModelTest.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ObjectModelTest.java Tue Jun 24 08:36:06 2008
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.corona.it;
+
+import org.custommonkey.xmlunit.Diff;
+
+/**
+ * Test accessing the object model.
+ */
+public class ObjectModelTest extends CoronaHtmlUnitTestCase {
+
+ /**
+ * Accessing all request parameters from within a generator.
+ */
+ public void testTemporaryRedirect() throws Exception {
+ this.loadResponse("object-model/request-parameters?a=1&b=2&c=3");
+ assertEquals(200, this.response.getStatusCode());
+ String content = this.response.getContentAsString();
+ String expectedContent = "<?xml version=\"1.0\"?><request-paramters><a>1</a><c>3</c><b>2</b></request-paramters>";
+ assertTrue(new Diff(expectedContent, content).similar());
+ }
+
+}
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ObjectModelTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ObjectModelTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ObjectModelTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ParameterPassing.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ParameterPassing.java?rev=671213&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ParameterPassing.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ParameterPassing.java Tue Jun 24 08:36:06 2008
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.corona.it;
+
+/**
+ * Test passing parameters.
+ */
+public class ParameterPassing extends CoronaHtmlUnitTestCase {
+
+ /**
+ * Passing parameters from a matcher to the sitemap.
+ */
+ public void testPassingParamatersFromMatcherToSitemap() throws Exception {
+ this.loadXmlPage("parameter-passing/working");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/simple", "simple-text");
+ }
+
+ // /**
+ // * Passing null from a matcher to the sitemap (-> doesn't match)
+ // */
+ // public void testPassingNullMatcherToSitemap() throws Exception {
+ // this.webClient.setThrowExceptionOnFailingStatusCode(false);
+ // this.loadResponse("parameter-passing/failing");
+ // assertTrue(this.response.getStatusCode() == 404);
+ // }
+
+}
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ParameterPassing.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ParameterPassing.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ParameterPassing.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ReaderTest.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ReaderTest.java?rev=671213&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ReaderTest.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ReaderTest.java Tue Jun 24 08:36:06 2008
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.corona.it;
+
+/**
+ * Test readers
+ */
+public class ReaderTest extends CoronaHtmlUnitTestCase {
+
+ /**
+ * Call a pipeline that explicitly sets the mime-type of the resource.
+ */
+ public void testReadingResourceWithExplicitMimeType() throws Exception {
+ this.loadResponse("read/javascript-resource-explicit");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/javascript", this.response.getContentType());
+ }
+
+ /**
+ * Call a pipeline that automatically sets the mime-type of the resource.
+ */
+ public void testReadingResourceWithImplicitMimeType() throws Exception {
+ this.loadResponse("read/javascript-resource-implicit.js");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("application/x-javascript", this.response.getContentType());
+ }
+
+ /**
+ * Call a pipeline that uses an unkown file extentions.
+ */
+ public void testReadingResourceWithUnknownMimeType() throws Exception {
+ this.loadResponse("read/javascript-resource-implicit.abc");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("", this.response.getContentType());
+ }
+
+ /**
+ * A resource reader supports conditional gets.
+ */
+ public void testConditionalGet() throws Exception {
+ this.loadResponse("read/javascript-resource-implicit.js");
+ String lastModified = this.response.getResponseHeaderValue("Last-Modified");
+ System.out.println("lm=" + lastModified);
+ assertNotNull("Last-Modified has to be set at this point!", lastModified);
+ assertFalse("Last-Modified hast to be set at this point!", "".equals(lastModified));
+ this.webClient.addRequestHeader("If-Modified-Since", lastModified);
+ this.loadResponse("read/javascript-resource-implicit.js");
+ assertEquals(304, this.response.getStatusCode());
+ }
+}
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ReaderTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ReaderTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ReaderTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/RedirectTest.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/RedirectTest.java?rev=671213&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/RedirectTest.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/RedirectTest.java Tue Jun 24 08:36:06 2008
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.corona.it;
+
+/**
+ * Test redirecting
+ */
+public class RedirectTest extends CoronaHtmlUnitTestCase {
+
+ /**
+ * A temporary redirect
+ */
+ public void testTemporaryRedirect() throws Exception {
+ this.loadResponse("redirect/www.orf.at");
+ assertEquals(302, this.response.getStatusCode());
+ assertEquals("http://www.orf.at", this.response.getResponseHeaderValue("Location"));
+ }
+
+ /**
+ * A redirect to a servlet: URL
+ */
+ public void testServletRedirect() throws Exception {
+ this.loadXmlPage("redirect/sax-pipeline/simple-xml");
+ assertEquals(200, this.response.getStatusCode());
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/html/body/p", "3");
+ }
+
+}
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/RedirectTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/RedirectTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/RedirectTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/SaxPipelineTest.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/SaxPipelineTest.java?rev=671213&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/SaxPipelineTest.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/SaxPipelineTest.java Tue Jun 24 08:36:06 2008
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.corona.it;
+
+/**
+ * Test SAX Pipelines
+ */
+public class SaxPipelineTest extends CoronaHtmlUnitTestCase {
+
+ /**
+ * A simple pipeline that produces an HTML document.
+ */
+ public void testSimplePipeline() throws Exception {
+ this.loadResponse("/sax-pipeline/simple");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ assertTrue(this.response.getContentAsString().indexOf("-//W3C//DTD XHTML 1.0 Strict//EN") == -1);
+ }
+
+ /**
+ * A simple pipeline that produces an XHTML 1.0 document. This implicitly tests if the configuration of serializers
+ * works properly.
+ */
+ public void testSimplePipelineXhtml() throws Exception {
+ this.loadResponse("/sax-pipeline/simple-xhtml");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/html", this.response.getContentType());
+ assertTrue(this.response.getContentAsString().indexOf("-//W3C//DTD XHTML 1.0 Strict//EN") > 0);
+ }
+
+ /**
+ * A parameter is passed to an XSLT transformer.
+ */
+ public void testSimplePipelineParameterPassingToTransformer() throws Exception {
+ this.loadXmlPage("/sax-pipeline/simple-xml");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/html/body/p", "3");
+ }
+
+ /**
+ * A status code is set explicitly at a serializer.
+ */
+ public void testSettingStatusCode() throws Exception {
+ this.loadResponse("/sax-pipeline/unauthorized");
+ int statusCode = this.response.getStatusCode();
+ assertTrue(statusCode == 401);
+ String lastModified = this.response.getResponseHeaderValue("Last-Modified");
+ assertNotNull(lastModified);
+ assertFalse(lastModified.equals(""));
+ }
+
+}
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/SaxPipelineTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/SaxPipelineTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/SaxPipelineTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ServletServiceTest.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ServletServiceTest.java?rev=671213&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ServletServiceTest.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ServletServiceTest.java Tue Jun 24 08:36:06 2008
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.corona.it;
+
+/**
+ * Test the usage of servlet services in Cocoon sitemaps.
+ */
+public class ServletServiceTest extends CoronaHtmlUnitTestCase {
+
+ public void testSimpleServletServiceCallingAPipeline() throws Exception {
+ this.loadXmlPage("ssf/local");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/html/body/p", "3");
+ }
+
+ public void testSimpleServletServiceCallingAResource() throws Exception {
+ this.loadResponse("ssf/read-resource");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/javascript", this.response.getContentType());
+ }
+
+ public void testServiceConsumer() throws Exception {
+ this.loadPostResponse("ssf/service-consumer", "<a>1</a>");
+ assertTrue(this.response.getStatusCode() == 200);
+ String contentAsString = this.response.getContentAsString();
+ assertNotNull(contentAsString);
+ assertTrue("The service has to return the passed request body as content.", contentAsString
+ .contains("<a>1</a>"));
+ }
+
+ public void testCallingATransformerServletService() throws Exception {
+ this.loadXmlPage("ssf/calling-a-transformer-servlet-service");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/html/body/p", "transformer-pipeline");
+ }
+
+ public void testCallingASerializerServletService() throws Exception {
+ this.loadXmlPage("ssf/calling-a-serializer-servlet-service");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/html/body/p", "serializer-pipeline");
+ }
+}
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ServletServiceTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ServletServiceTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/ServletServiceTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/XSLTTest.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/XSLTTest.java?rev=671213&view=auto
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/XSLTTest.java (added)
+++ cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/XSLTTest.java Tue Jun 24 08:36:06 2008
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.corona.it;
+
+/**
+ * Test XSLT transformation.
+ */
+public class XSLTTest extends CoronaHtmlUnitTestCase {
+
+ /**
+ * Use an XSLT that includes sub stylesheets using the file and the servlet protocol.
+ */
+ public void testXSLTTransformation() throws Exception {
+ this.loadXmlPage("xslt/main");
+ assertTrue(this.response.getStatusCode() == 200);
+ assertEquals("text/xml", this.response.getContentType());
+ this.assertXPath("/xslt/servlet", "servlet");
+ this.assertXPath("/xslt/file", "file");
+ }
+
+}
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/XSLTTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/XSLTTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/corona/trunk/corona-sample-webapp/src/test/java/org/apache/cocoon/corona/it/XSLTTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain