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/01/30 23:44:24 UTC
svn commit: r616932 - in
/cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it:
AggregationTest.java ParameterPassing.java XSLTTest.java
Author: reinhard
Date: Wed Jan 30 14:44:24 2008
New Revision: 616932
URL: http://svn.apache.org/viewvc?rev=616932&view=rev
Log:
add tests for aggregation, parameter passing and xslt transformations
Added:
cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/AggregationTest.java (with props)
cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/ParameterPassing.java (with props)
cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/XSLTTest.java (with props)
Added: cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/AggregationTest.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/AggregationTest.java?rev=616932&view=auto
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/AggregationTest.java (added)
+++ cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/AggregationTest.java Wed Jan 30 14:44:24 2008
@@ -0,0 +1,38 @@
+package org.apache.cocoon.micro.it;
+
+/*
+ * 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.
+ */
+
+import org.apache.cocoon.tools.it.HtmlUnitTestCase;
+
+/**
+ * Test aggregation.
+ */
+public class AggregationTest extends HtmlUnitTestCase {
+
+ /**
+ * 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());
+ assertXPath("/sample/sub/text()", "sub");
+ }
+
+
+}
Propchange: cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/AggregationTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/AggregationTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/AggregationTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/ParameterPassing.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/ParameterPassing.java?rev=616932&view=auto
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/ParameterPassing.java (added)
+++ cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/ParameterPassing.java Wed Jan 30 14:44:24 2008
@@ -0,0 +1,46 @@
+package org.apache.cocoon.micro.it;
+
+/*
+ * 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.
+ */
+
+import org.apache.cocoon.tools.it.HtmlUnitTestCase;
+
+/**
+ * Test passing parameters.
+ */
+public class ParameterPassing extends HtmlUnitTestCase {
+
+ /**
+ * 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());
+ 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/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/ParameterPassing.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/ParameterPassing.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/ParameterPassing.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/XSLTTest.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/XSLTTest.java?rev=616932&view=auto
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/XSLTTest.java (added)
+++ cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/XSLTTest.java Wed Jan 30 14:44:24 2008
@@ -0,0 +1,39 @@
+package org.apache.cocoon.micro.it;
+
+/*
+ * 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.
+ */
+
+import org.apache.cocoon.tools.it.HtmlUnitTestCase;
+
+/**
+ * Test XSLT transformation.
+ */
+public class XSLTTest extends HtmlUnitTestCase {
+
+ /**
+ * 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());
+ assertXPath("/xslt/servlet", "servlet");
+ assertXPath("/xslt/file", "file");
+ }
+
+}
Propchange: cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/XSLTTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/XSLTTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/whiteboard/micro/misc/cocoon-webapp/src/test/java/org/apache/cocoon/micro/it/XSLTTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain