You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2024/03/07 13:56:05 UTC
(logging-log4j-tools) branch main updated: Fix RAT failures and do some minor test improvements
This is an automated email from the ASF dual-hosted git repository.
vy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j-tools.git
The following commit(s) were added to refs/heads/main by this push:
new 38b726b Fix RAT failures and do some minor test improvements
38b726b is described below
commit 38b726bdb2c1f6268f462b183758bae2f835d2b4
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Thu Mar 7 14:56:21 2024 +0100
Fix RAT failures and do some minor test improvements
---
.../log4j/docgen/processor/AsciiDocConverterTest.java | 4 ++++
.../resources/AsciiDocConverterTest/JavadocExample.adoc | 16 ++++++++++++++++
.../license.adoc} | 0
.../DocumentationGeneratorTest/templates/index.adoc.ftl | 2 +-
.../templates/{license.adoc.ftl => license.adoc} | 0
.../DocumentationGeneratorTest/templates/type.adoc.ftl | 2 +-
6 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/log4j-docgen/src/test/java/org/apache/logging/log4j/docgen/processor/AsciiDocConverterTest.java b/log4j-docgen/src/test/java/org/apache/logging/log4j/docgen/processor/AsciiDocConverterTest.java
index a5c8d60..d90ca49 100644
--- a/log4j-docgen/src/test/java/org/apache/logging/log4j/docgen/processor/AsciiDocConverterTest.java
+++ b/log4j-docgen/src/test/java/org/apache/logging/log4j/docgen/processor/AsciiDocConverterTest.java
@@ -23,6 +23,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.io.UncheckedIOException;
import java.nio.charset.Charset;
+import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
@@ -53,6 +54,8 @@ class AsciiDocConverterTest {
private static final String TEST_CLASS_RESOURCE_PATH =
"src/test/resources/" + AsciiDocConverterTest.class.getSimpleName();
+ private static final Path LICENSE_PATH = Paths.get(TEST_CLASS_RESOURCE_PATH + "/license.adoc");
+
private static final String TEST_CLASS_NAME = "JavadocExample";
private static final Charset CHARSET = UTF_8;
@@ -123,6 +126,7 @@ class AsciiDocConverterTest {
final String asciiDoc = converter.toAsciiDoc(element);
assertThat(asciiDoc).isNotNull();
try (final OutputStream os = output.openOutputStream()) {
+ Files.copy(LICENSE_PATH, os);
os.write(asciiDoc.getBytes(CHARSET));
}
}
diff --git a/log4j-docgen/src/test/resources/AsciiDocConverterTest/JavadocExample.adoc b/log4j-docgen/src/test/resources/AsciiDocConverterTest/JavadocExample.adoc
index c50f3d4..7eafa53 100644
--- a/log4j-docgen/src/test/resources/AsciiDocConverterTest/JavadocExample.adoc
+++ b/log4j-docgen/src/test/resources/AsciiDocConverterTest/JavadocExample.adoc
@@ -1,3 +1,19 @@
+////
+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
+
+ https://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.
+////
Example of JavaDoc to AsciiDoc conversion
We run the `javadoc` tool on this class to test conversion of JavaDoc comments to AsciiDoc.
diff --git a/log4j-docgen/src/test/resources/DocumentationGeneratorTest/templates/license.adoc.ftl b/log4j-docgen/src/test/resources/AsciiDocConverterTest/license.adoc
similarity index 100%
copy from log4j-docgen/src/test/resources/DocumentationGeneratorTest/templates/license.adoc.ftl
copy to log4j-docgen/src/test/resources/AsciiDocConverterTest/license.adoc
diff --git a/log4j-docgen/src/test/resources/DocumentationGeneratorTest/templates/index.adoc.ftl b/log4j-docgen/src/test/resources/DocumentationGeneratorTest/templates/index.adoc.ftl
index a22df1a..1e5f1d3 100644
--- a/log4j-docgen/src/test/resources/DocumentationGeneratorTest/templates/index.adoc.ftl
+++ b/log4j-docgen/src/test/resources/DocumentationGeneratorTest/templates/index.adoc.ftl
@@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<#-- @ftlvariable name="lookup" type="org.apache.logging.log4j.docgen.generator.TypeLookup" -->
-<#include "license.adoc.ftl">
+<#include "license.adoc">
[#index]
= Index
diff --git a/log4j-docgen/src/test/resources/DocumentationGeneratorTest/templates/license.adoc.ftl b/log4j-docgen/src/test/resources/DocumentationGeneratorTest/templates/license.adoc
similarity index 100%
rename from log4j-docgen/src/test/resources/DocumentationGeneratorTest/templates/license.adoc.ftl
rename to log4j-docgen/src/test/resources/DocumentationGeneratorTest/templates/license.adoc
diff --git a/log4j-docgen/src/test/resources/DocumentationGeneratorTest/templates/type.adoc.ftl b/log4j-docgen/src/test/resources/DocumentationGeneratorTest/templates/type.adoc.ftl
index 2f2fdbe..4e18c22 100644
--- a/log4j-docgen/src/test/resources/DocumentationGeneratorTest/templates/type.adoc.ftl
+++ b/log4j-docgen/src/test/resources/DocumentationGeneratorTest/templates/type.adoc.ftl
@@ -19,7 +19,7 @@
<#assign type = sourcedType.type/>
<#-- @ftlvariable name="type" type="org.apache.logging.log4j.docgen.Type" -->
<#-- @ftlvariable name="lookup" type="org.apache.logging.log4j.docgen.generator.TypeLookup" -->
-<#include "license.adoc.ftl">
+<#include "license.adoc">
[#${type.className?replace('.', '_')}]
= ${type.name!('`' + type.className + '`')}