Author: hboutemy Date: Fri Sep 30 16:23:13 2016 New Revision: 1762932 URL: http://svn.apache.org/viewvc?rev=1762932&view=rev Log: [MSITE-782] added custom Velocity tool test (failing...)
Added: maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/invoker.properties (with props) maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/java/ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/java/org/ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/java/org/apache/ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/java/org/apache/maven/ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/java/org/apache/maven/plugins/ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/java/org/apache/maven/plugins/site/ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/java/org/apache/maven/plugins/site/it/ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/java/org/apache/maven/plugins/site/it/CustomVelocityTool.java (with props) maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/resources/ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/resources/tools.xml (with props) maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/verify.groovy.edited Modified: maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/pom.xml maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/site/apt/velocity-context.apt.vm maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/verify.groovy Added: maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/invoker.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/invoker.properties?rev=1762932&view=auto ============================================================================== --- maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/invoker.properties (added) +++ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/invoker.properties Fri Sep 30 16:23:13 2016 @@ -0,0 +1,18 @@ +# 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. + +invoker.goals = package site Propchange: maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/invoker.properties ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/pom.xml?rev=1762932&r1=1762931&r2=1762932&view=diff ============================================================================== --- maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/pom.xml (original) +++ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/pom.xml Fri Sep 30 16:23:13 2016 @@ -26,13 +26,21 @@ under the License. <groupId>org.apache.maven.plugins.site.its</groupId> <artifactId>doxia-formats</artifactId> <version>1.0-SNAPSHOT</version> - <packaging>pom</packaging> + <packaging>jar</packaging> <name>Doxia formats tests</name> <properties> <property-project-version>@project.version@</property-project-version> </properties> + <dependencies> + <dependency> + <groupId>org.apache.velocity</groupId> + <artifactId>velocity-tools</artifactId> + <version>2.0</version> + </dependency> + </dependencies> + <build> <pluginManagement> <plugins> @@ -53,6 +61,11 @@ under the License. <artifactId>velocity</artifactId> <version>1.5</version> </dependency> + <dependency><!-- MSITE-782 --> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </dependency> </dependencies> </plugin> </plugins> Added: maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/java/org/apache/maven/plugins/site/it/CustomVelocityTool.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/java/org/apache/maven/plugins/site/it/CustomVelocityTool.java?rev=1762932&view=auto ============================================================================== --- maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/java/org/apache/maven/plugins/site/it/CustomVelocityTool.java (added) +++ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/java/org/apache/maven/plugins/site/it/CustomVelocityTool.java Fri Sep 30 16:23:13 2016 @@ -0,0 +1,31 @@ +package org.apache.maven.plugins.site.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.velocity.tools.config.DefaultKey; + +@DefaultKey("custom") +public class CustomVelocityTool +{ + public static String test() + { + return "ok"; + } +} \ No newline at end of file Propchange: maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/java/org/apache/maven/plugins/site/it/CustomVelocityTool.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/resources/tools.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/resources/tools.xml?rev=1762932&view=auto ============================================================================== --- maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/resources/tools.xml (added) +++ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/resources/tools.xml Fri Sep 30 16:23:13 2016 @@ -0,0 +1,26 @@ +<?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. +--> + +<tools> + <toolbox scope="application"> + <tool key="custom" class="org.apache.maven.plugins.site.it.CustomVelocityTool" /> + </toolbox> +</tools> Propchange: maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/main/resources/tools.xml ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/site/apt/velocity-context.apt.vm URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/site/apt/velocity-context.apt.vm?rev=1762932&r1=1762931&r2=1762932&view=diff ============================================================================== --- maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/site/apt/velocity-context.apt.vm (original) +++ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/src/site/apt/velocity-context.apt.vm Fri Sep 30 16:23:13 2016 @@ -144,3 +144,7 @@ Doxia Site Renderer Velocity Context *-----------------------+-------------------------------------------------------+ | <<<xml>>> | = <<<$xml>>> *-----------------------+-------------------------------------------------------+ + + <<< $custom>>> TODO: remove space once MSITE-782 is fixed + + <<< $custom.test()>>> Modified: maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/verify.groovy URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/verify.groovy?rev=1762932&r1=1762931&r2=1762932&view=diff ============================================================================== --- maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/verify.groovy (original) +++ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/verify.groovy Fri Sep 30 16:23:13 2016 @@ -40,4 +40,4 @@ assert !content.replace('<<<$value', '') assert new File( basedir, 'target/site/markdown2.html' ).exists(); // DOXIA-535 -return true; \ No newline at end of file +return true; Added: maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/verify.groovy.edited URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/verify.groovy.edited?rev=1762932&view=auto ============================================================================== --- maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/verify.groovy.edited (added) +++ maven/plugins/trunk/maven-site-plugin/src/it/doxia-formats/verify.groovy.edited Fri Sep 30 16:23:13 2016 @@ -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. + */ + +content = new File( basedir, 'target/site/markdown.html' ).text; + +assert content.contains( 'Markdown Format works' ); + +assert !content.contains( ' quotes and double quotes were stripped' ); + +assert !content.contains( 'MACRO' ); +assert content.contains( 'href="#Subsection"' ); + +ignore = new File( basedir, 'target/site/ignore.txt' ); +assert !ignore.exists(); + +velocity = new File( basedir, 'target/generated-site/processed/velocity-context.apt' ); +assert velocity.exists(); +content = velocity.text; + +assert content.contains( '= <<<val1>>>' ); // MSITE-550 + +assert !content.replace('<<<$value', '').contains( '<<<$' ); + +assert new File( basedir, 'target/site/markdown2.html' ).exists(); // DOXIA-535 + +return true;