This is an automated email from the ASF dual-hosted git repository. elharo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-doxia.git
The following commit(s) were added to refs/heads/master by this push: new 8128fd3 [DOXIA-618] 8128fd3 is described below commit 8128fd39f6407722f6bf83ef10637401c456dcef Author: Bertrand Martin <bertr...@sentrysoftware.com> AuthorDate: Wed Jan 6 00:43:14 2021 +0100 [DOXIA-618] * doxia-module-markdown: Re-incorporated integration tests from **maven-site-plugin** * doxia-module-markdown: Merged DOXIA-616 integration tests into **general** --- .../src/it/DOXIA-616-fenced-code-block/pom.xml | 69 --------------------- .../it/DOXIA-616-fenced-code-block/verify.groovy | 43 ------------- .../src/it/general/src/site/markdown/DOXIA-473.md | 4 ++ .../general/src/site/markdown/DOXIA-535.markdown | 3 + .../src/site/markdown/DOXIA-571.md} | 28 ++++----- .../src/it/general/src/site/markdown/DOXIA-597.md | 3 + .../site/markdown/DOXIA-616-fenced-code-block.md} | 2 +- .../src/it/general/src/site/site.xml | 11 ++++ .../src/it/general/verify.groovy | 71 +++++++++++++++++----- pom.xml | 1 + 10 files changed, 91 insertions(+), 144 deletions(-) diff --git a/doxia-modules/doxia-module-markdown/src/it/DOXIA-616-fenced-code-block/pom.xml b/doxia-modules/doxia-module-markdown/src/it/DOXIA-616-fenced-code-block/pom.xml deleted file mode 100644 index 12afb4f..0000000 --- a/doxia-modules/doxia-module-markdown/src/it/DOXIA-616-fenced-code-block/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ -<?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. ---> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.doxia</groupId> - <artifactId>it</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>pom</packaging> - - <description>Project Description</description> - - <build> - <plugins> - - <!-- site --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-site-plugin</artifactId> - <version>3.9.1</version> - <configuration> - <generateReports>false</generateReports> - <generateProjectInfo>false</generateProjectInfo> - <inputEncoding>UTF-8</inputEncoding> - <outputEncoding>UTF-8</outputEncoding> - </configuration> - <dependencies> - <dependency> - <groupId>org.apache.maven.doxia</groupId> - <artifactId>doxia-core</artifactId> - <version>@project.version@</version> - </dependency> - <dependency> - <groupId>org.apache.maven.doxia</groupId> - <artifactId>doxia-module-xhtml</artifactId> - <version>@project.version@</version> - </dependency> - <dependency> - <groupId>@project.groupId@</groupId> - <artifactId>@project.artifactId@</artifactId> - <version>@project.version@</version> - </dependency> - </dependencies> - - </plugin> - - </plugins> - </build> - -</project> diff --git a/doxia-modules/doxia-module-markdown/src/it/DOXIA-616-fenced-code-block/verify.groovy b/doxia-modules/doxia-module-markdown/src/it/DOXIA-616-fenced-code-block/verify.groovy deleted file mode 100644 index b52ff05..0000000 --- a/doxia-modules/doxia-module-markdown/src/it/DOXIA-616-fenced-code-block/verify.groovy +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ - - // Verify fenced-code-block.html - -// File was produced -File resultFile = new File(basedir, "target/site/fenced-code-block.html") -assert resultFile.isFile() - -// Check the content -String content = resultFile.text; - -// Our first fenced code block is <div class="source"><pre><code class="language-java">...</code></pre></div> -assert content =~ '<div class="source">.*<pre.*>.*<code.*class=".*language-java.*">.*// Fenced Code Block 1' - -// Our second fenced code block doesn't specify a language -assert content =~ '<div class="source">.*<pre.*>.*<code.*># Fenced Code Block 2' -assert !(content =~ '<div class="source">.*<pre.*>.*<code.*language-.*># Fenced Code Block 2') - -// Our third code block is indented, and it shows the same way -assert content =~ '<div class="source">.*<pre.*>.*<code.*>// Indented Code Block' - -// Then we have inline code, which must be in simple <code> -assert content =~ 'inline code: <code>System.out.println' - -// The last one is inline "fenced" code block which must be in simple <code> -assert content =~ 'And what about <code>System.out.println' diff --git a/doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-473.md b/doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-473.md new file mode 100644 index 0000000..0250279 --- /dev/null +++ b/doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-473.md @@ -0,0 +1,4 @@ +# DOXIA-473 + +But 'quotes' and "double quotes" were stripped from HTML result with DOXIA 1.3: +see [DOXIA-473](https://issues.apache.org/jira/browse/DOXIA-473). diff --git a/doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-535.markdown b/doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-535.markdown new file mode 100644 index 0000000..a712d98 --- /dev/null +++ b/doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-535.markdown @@ -0,0 +1,3 @@ +# DOXIA-535 + +\*.markdown files are processed just like \*.md files. diff --git a/doxia-modules/doxia-module-markdown/src/it/DOXIA-616-fenced-code-block/src/site/site.xml b/doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-571.md similarity index 61% rename from doxia-modules/doxia-module-markdown/src/it/DOXIA-616-fenced-code-block/src/site/site.xml rename to doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-571.md index ebc6ae2..2088115 100644 --- a/doxia-modules/doxia-module-markdown/src/it/DOXIA-616-fenced-code-block/src/site/site.xml +++ b/doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-571.md @@ -1,6 +1,4 @@ -<?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 @@ -19,19 +17,15 @@ specific language governing permissions and limitations under the License. --> -<project name="${project.name} from site.xml"> - - <skin> - <groupId>org.apache.maven.skins</groupId> - <artifactId>maven-fluido-skin</artifactId> - <version>1.9</version> - </skin> - - <body> +# DOXIA-571 - <menu name="Testing"> - <item name="Fenced Code Block" href="fenced-code-block.html" /> - </menu> +Missing code block color [DOXIA-571](https://issues.apache.org/jira/browse/DOXIA-571): - </body> -</project> +``` +code block +Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) +Maven home: D:\apache-maven-3.6.3\apache-maven\bin\.. +Java version: 1.8.0_232, vendor: AdoptOpenJDK, runtime: C:\Program Files\AdoptOpenJDK\jdk-8.0.232.09-hotspot\jre +Default locale: en_US, platform encoding: Cp1250 +OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows" +``` diff --git a/doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-597.md b/doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-597.md new file mode 100644 index 0000000..b9773b7 --- /dev/null +++ b/doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-597.md @@ -0,0 +1,3 @@ +# DOXIA-597 + +Missing `monospaced` support [DOXIA-597](https://issues.apache.org/jira/browse/DOXIA-597) diff --git a/doxia-modules/doxia-module-markdown/src/it/DOXIA-616-fenced-code-block/src/site/markdown/fenced-code-block.md b/doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-616-fenced-code-block.md similarity index 83% rename from doxia-modules/doxia-module-markdown/src/it/DOXIA-616-fenced-code-block/src/site/markdown/fenced-code-block.md rename to doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-616-fenced-code-block.md index 3f4da06..6a837a3 100644 --- a/doxia-modules/doxia-module-markdown/src/it/DOXIA-616-fenced-code-block/src/site/markdown/fenced-code-block.md +++ b/doxia-modules/doxia-module-markdown/src/it/general/src/site/markdown/DOXIA-616-fenced-code-block.md @@ -1,6 +1,6 @@ author: Bertrand Martin -# Fenced Code Block +# DOXIA-616: Fenced Code Block This is Java code and must be tagged so such. diff --git a/doxia-modules/doxia-module-markdown/src/it/general/src/site/site.xml b/doxia-modules/doxia-module-markdown/src/it/general/src/site/site.xml index 7bbac30..3385a39 100644 --- a/doxia-modules/doxia-module-markdown/src/it/general/src/site/site.xml +++ b/doxia-modules/doxia-module-markdown/src/it/general/src/site/site.xml @@ -21,6 +21,12 @@ under the License. <project name="${project.name} from site.xml"> + <skin> + <groupId>org.apache.maven.skins</groupId> + <artifactId>maven-fluido-skin</artifactId> + <version>1.9</version> + </skin> + <body> <menu name="Getting Started"> @@ -30,6 +36,11 @@ under the License. <menu name="Testing"> <item name="Metadata" href="metadata.html" /> <item name="Quotes" href="quotes.html" /> + <item name="DOXIA-473" href="DOXIA-473.html" /> + <item name="DOXIA-535" href="DOXIA-535.html" /> + <item name="DOXIA-571" href="DOXIA-571.html" /> + <item name="DOXIA-597" href="DOXIA-597.html" /> + <item name="DOXIA-616 (fenced code block)" href="DOXIA-616-fenced-code-block.html" /> </menu> </body> diff --git a/doxia-modules/doxia-module-markdown/src/it/general/verify.groovy b/doxia-modules/doxia-module-markdown/src/it/general/verify.groovy index a6199f4..1c917e5 100644 --- a/doxia-modules/doxia-module-markdown/src/it/general/verify.groovy +++ b/doxia-modules/doxia-module-markdown/src/it/general/verify.groovy @@ -21,45 +21,88 @@ // Verify index.html // File was produced -File resultFile = new File(basedir, "target/site/index.html") -assert resultFile.isFile() +File resultFile = new File( basedir, "target/site/index.html" ) +assert resultFile.isFile() : "index.html exists" // Verify metadata.html // File was produced -resultFile = new File(basedir, "target/site/metadata.html") -assert resultFile.isFile() +resultFile = new File( basedir, "target/site/metadata.html" ) +assert resultFile.isFile() : "metadata.html exists" // Check the content String content = resultFile.text; // <title> must contain the specified title in the metadata, not in the first heading -assert content =~ '<title>.*Title from Header.*</title>' +assert content =~ '<title>.*Title from Header.*</title>' : "title set from metadata" // Author is Bertrand, yours truly // Apostrophe must have been interpreted properly -assert content =~ '<meta name="Author" content="Bertrand \'Yours, Truly\' Martin" />' +assert content =~ '<meta name="Author" content="Bertrand \'Yours, Truly\' Martin" />' : "author is set" // Keywords do support utf-8 smileys -assert content =~ '<meta name="Keywords" content="smile,😉,utf-8" />' +assert content =~ '<meta name="Keywords" content="smile,😉,utf-8" />' : "keywords are set" // Meta are properly trimmed -assert content =~ '<meta name="Weird" content="Spacing" />' +assert content =~ '<meta name="Weird" content="Spacing" />' : "header spaces are trimmed" // Empty is empty -assert content =~ '<meta name="Empty" content="" />' +assert content =~ '<meta name="Empty" content="" />' : "empty header can be set" // No description is provided, as it was not part of the metadata at the beginning of the doc -assert !(content =~ '<meta name="description"') +assert !( content =~ '<meta name="description"' ) : "description is not set in the header" // Verify quotes.html -resultFile = new File(basedir, "target/site/quotes.html") -assert resultFile.isFile() +resultFile = new File( basedir, "target/site/quotes.html" ) +assert resultFile.isFile() : "quotes.html exists" content = resultFile.text; -assert content =~ /This ain't a quote, but an apostrophe./ -assert content =~ /This ‘quoted text’ isn't surrounded with apostrophes./ +assert content =~ /This ain't a quote, but an apostrophe./ : "DOXIA-542: apostrophes remain intact" +assert content =~ /This ‘quoted text’ isn't surrounded with apostrophes./ : "surrounding quotes are stylized" + +// Verify DOXIA-473 +content = new File( basedir, "target/site/DOXIA-473.html" ).text +assert !content.contains( ' quotes and double quotes were stripped' ) : "DOXIA-473: quotes are not stripped" + + +// Verify DOXIA-535 +assert new File( basedir, "target/site/DOXIA-535.html" ).exists() : "DOXIA-535: *.markdown source files are processed" + +// Verify DOXIA-571 +content = new File( basedir, "target/site/DOXIA-571.html" ).text +assert content.contains( '<div class="source"><pre class="prettyprint"><code>code block' ) : "DOXIA-571: code block is pretty" + + +// Verify DOXIA-597 +content = new File( basedir, "target/site/DOXIA-597.html" ).text +assert content.contains( '<code>monospaced</code> support' ) : "DOXIA-597: inline code is marked as such" + + +// Verify DOXIA-616-fenced-code-block.html + +// File was produced +resultFile = new File( basedir, "target/site/DOXIA-616-fenced-code-block.html" ) +assert resultFile.isFile() : "DOXIA-616-fenced-code-block.html exists" + +// Check the content +content = resultFile.text; + +// Our first fenced code block is <div class="source"><pre><code class="language-java">...</code></pre></div> +assert content =~ '<div class="source">.*<pre.*>.*<code.*class=".*language-java.*">.*// Fenced Code Block 1' : "DOXIA-616: Fenced Code Block 1 is pretty" + +// Our second fenced code block doesn't specify a language +assert content =~ '<div class="source">.*<pre.*>.*<code.*># Fenced Code Block 2' +assert !( content =~ '<div class="source">.*<pre.*>.*<code.*language-.*># Fenced Code Block 2' ) : "DOXIA-616: Fenced Code Block 2 is pretty" + +// Our third code block is indented, and it shows the same way +assert content =~ '<div class="source">.*<pre.*>.*<code.*>// Indented Code Block' : "DOXIA-616: Indented Code Block is pretty" + +// Then we have inline code, which must be in simple <code> +assert content =~ 'inline code: <code>System.out.println' : "DOXIA-616: Inline code is marked as such" + +// The last one is inline "fenced" code block which must be in simple <code> +assert content =~ 'And what about <code>System.out.println' : "DOXIA-616: Inline 'fenced' code block is marked as code" diff --git a/pom.xml b/pom.xml index d54de47..46d5b25 100644 --- a/pom.xml +++ b/pom.xml @@ -271,6 +271,7 @@ under the License. <exclude>src/test/resources/**/*.twiki</exclude> <exclude>src/test/resources/**/*.md</exclude> <exclude>src/it/**/site/**/*.md</exclude> + <exclude>src/it/**/site/**/*.markdown</exclude> </excludes> </configuration> </plugin>