ignoredFieldNames = Arrays.asList("$jacocodata", "log");
for (Field field : getClass().getDeclaredFields()) {
try {
String fieldName = field.getName();
Object fieldValue = getFieldValue(this, fieldName);
- if (fieldValue != null) {
+ if (fieldValue != null && !ignoredFieldNames.contains(fieldName.toLowerCase())) {
Constants.Attributes.Name asciidocAttrName =
Constants.Attributes.Name.valueOf(fieldName.toUpperCase());
attributesMap.put(asciidocAttrName.getName(), fieldValue.toString());
}
} catch (Exception e) {
- Logger.getLogger(getClass().getName())
- .log(Level.WARNING, "Could not get field value of attribute: " + field.getName(), e);
+ log.warn("Could not get field value of attribute: {}", field.getName(), e);
}
}
return attributesMap;
diff --git a/cukedoctor-converter/src/main/java/com/github/cukedoctor/api/model/Step.java b/cukedoctor-converter/src/main/java/com/github/cukedoctor/api/model/Step.java
index 988f3706..e7eb43ae 100755
--- a/cukedoctor-converter/src/main/java/com/github/cukedoctor/api/model/Step.java
+++ b/cukedoctor-converter/src/main/java/com/github/cukedoctor/api/model/Step.java
@@ -6,11 +6,14 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRawValue;
import java.util.List;
-import java.util.logging.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
@JsonIgnoreProperties(ignoreUnknown = true)
public class Step {
+ private static final Logger log = LoggerFactory.getLogger(Step.class);
+
private String name;
private String keyword;
private String line;
@@ -116,8 +119,7 @@ public Long getDuration() {
public Status getStatus() {
if (result == null || result.getStatus() == null) {
- Logger.getLogger(getClass().getName())
- .warning("Line " + line + " : " + "Step is missing Result: " + keyword + " : " + name);
+ log.warn("Line {}: Step is missing Result: {}:{}", line, keyword, name);
return Status.missing;
} else {
return result.getStatus();
diff --git a/cukedoctor-converter/src/main/java/com/github/cukedoctor/config/CukedoctorConfig.java b/cukedoctor-converter/src/main/java/com/github/cukedoctor/config/CukedoctorConfig.java
index 5daa7d64..bdb818e3 100644
--- a/cukedoctor-converter/src/main/java/com/github/cukedoctor/config/CukedoctorConfig.java
+++ b/cukedoctor-converter/src/main/java/com/github/cukedoctor/config/CukedoctorConfig.java
@@ -118,10 +118,10 @@ public Boolean isDisableMinMaxExtension() {
/**
* Path to be used as relative when looking for introChapterAdoc see {@link
- * CukedoctorConverterImpl#renderIntro()}.
- *
- * used by com.github.cukedoctor.util.{@link
+ * CukedoctorConverterImpl#renderIntro()}. used by com.github.cukedoctor.util.{@link
* com.github.cukedoctor.util.FileUtil#findFiles(String, String, boolean, String)}
+ *
+ * @return the relative path to the intro chapter
*/
public String getIntroChapterRelativePath() {
return introChapterRelativePath;
diff --git a/cukedoctor-converter/src/main/java/com/github/cukedoctor/i18n/I18nLoader.java b/cukedoctor-converter/src/main/java/com/github/cukedoctor/i18n/I18nLoader.java
index e6556f35..5e57dbbb 100644
--- a/cukedoctor-converter/src/main/java/com/github/cukedoctor/i18n/I18nLoader.java
+++ b/cukedoctor-converter/src/main/java/com/github/cukedoctor/i18n/I18nLoader.java
@@ -8,8 +8,8 @@
import java.io.*;
import java.text.MessageFormat;
import java.util.*;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* This class is responsible for internationalization.
@@ -20,7 +20,7 @@
public class I18nLoader extends ResourceBundle.Control {
private static I18nLoader instance;
- private static Logger log = Logger.getLogger(I18nLoader.class.getName());
+ private static final Logger log = LoggerFactory.getLogger(I18nLoader.class);
private ResourceBundle bundle;
@@ -66,10 +66,9 @@ private void init(List features) {
try {
bundle = new PropertyResourceBundle(new InputStreamReader(stream, "UTF-8"));
} catch (Exception e) {
- log.warning(
- String.format(
- "No resource bundle found for language %s. Using 'cukedoctor_en.properties' as default bundle.",
- lang));
+ log.warn(
+ "No resource bundle found for language {}. Using 'cukedoctor_en.properties' as default bundle.",
+ lang);
try {
bundle =
new PropertyResourceBundle(
@@ -99,12 +98,12 @@ private InputStream findCukedoctorProperties(String baseDir) {
List files = FileUtil.findFiles(baseDir, "cukedoctor.properties", true);
if (files != null && !files.isEmpty()) {
String path = files.get(0);
- log.fine("Loading cukedoctor resource bundle from: " + path);
+ log.trace("Loading cukedoctor resource bundle from: {}", path);
File file = new File(path);
try {
return new FileInputStream(file);
} catch (Exception e) {
- log.log(Level.WARNING, "Could not load resource bundle from target folder", e);
+ log.warn("Could not load resource bundle from target folder", e);
}
}
return null;
diff --git a/cukedoctor-converter/src/main/java/com/github/cukedoctor/parser/FeatureParser.java b/cukedoctor-converter/src/main/java/com/github/cukedoctor/parser/FeatureParser.java
index 0b5c91e4..c3690ce3 100644
--- a/cukedoctor-converter/src/main/java/com/github/cukedoctor/parser/FeatureParser.java
+++ b/cukedoctor-converter/src/main/java/com/github/cukedoctor/parser/FeatureParser.java
@@ -8,12 +8,12 @@
import com.github.cukedoctor.util.FileUtil;
import java.io.*;
import java.util.*;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/** Created by pestano on 04/06/15. */
public class FeatureParser {
- static final Logger log = Logger.getLogger(FeatureParser.class.getName());
+ private static final Logger log = LoggerFactory.getLogger(FeatureParser.class);
/**
* @param json absolute path to cucumber json output file
@@ -27,8 +27,7 @@ public static List parse(String json) {
while (it.hasNext()) {
Feature feature = it.next();
if (!feature.isCucumberFeature()) {
- log.warning(
- "json:" + json + " is NOT a Cucumber feature result file and will be ignored");
+ log.warn("json: {} is NOT a Cucumber feature result file and will be ignored", json);
it.remove();
} else {
feature.initScenarios();
@@ -37,13 +36,13 @@ public static List parse(String json) {
}
} catch (FileNotFoundException e) {
- log.log(Level.WARNING, "Could not find json file:" + json);
+ log.warn("Could not find json file: {}", json);
} catch (JsonMappingException e) {
- log.log(Level.WARNING, "Could not map json file:" + json);
+ log.warn("Could not map json file: {}", json);
} catch (JsonParseException e) {
- log.log(Level.WARNING, "Could not parse json file:" + json);
+ log.warn("Could not parse json file: {}", json);
} catch (IOException e) {
- log.log(Level.WARNING, "Could not read json file:" + json);
+ log.warn("Could not read json file: {}", json);
}
return features;
diff --git a/cukedoctor-converter/src/main/java/com/github/cukedoctor/renderer/BaseRenderer.java b/cukedoctor-converter/src/main/java/com/github/cukedoctor/renderer/BaseRenderer.java
index e28a202f..8bd803c6 100644
--- a/cukedoctor-converter/src/main/java/com/github/cukedoctor/renderer/BaseRenderer.java
+++ b/cukedoctor-converter/src/main/java/com/github/cukedoctor/renderer/BaseRenderer.java
@@ -10,7 +10,10 @@ public interface BaseRenderer {
void setI18n(I18nLoader i18nProvider);
- /** @deprecated Use renderX calls that pass the documentBuilder as a parameter instead */
+ /**
+ * @param documentBuilder the instance to use
+ * @deprecated Use renderX calls that pass the documentBuilder as a parameter instead
+ */
@Deprecated
void setDocumentBuilder(CukedoctorDocumentBuilder documentBuilder);
diff --git a/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/ExamplesRenderer.java b/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/ExamplesRenderer.java
index 0940fd7d..ae66cb23 100644
--- a/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/ExamplesRenderer.java
+++ b/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/ExamplesRenderer.java
@@ -7,7 +7,11 @@
/** Created by pestano on 28/02/16. */
public interface ExamplesRenderer extends BaseRenderer {
- /** @deprecated Use renderScenarioExamples(Scenario, CukedoctorDocumentBuilder) instead */
+ /**
+ * @param scenario the scenario containing the examples
+ * @return the renderer {@link String}
+ * @deprecated Use renderScenarioExamples(Scenario, CukedoctorDocumentBuilder) instead
+ */
@Deprecated
String renderScenarioExamples(Scenario scenario);
diff --git a/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/FeatureRenderer.java b/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/FeatureRenderer.java
index 874df575..392da8cd 100644
--- a/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/FeatureRenderer.java
+++ b/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/FeatureRenderer.java
@@ -8,7 +8,11 @@
/** Created by pestano on 24/02/16. */
public interface FeatureRenderer extends BaseRenderer {
- /** @deprecated Use renderFeature(Feature, CukedoctorDocumentBuilder) instead */
+ /**
+ * @param feature the feature to render
+ * @return the rendered {@link String}
+ * @deprecated Use renderFeature(Feature, CukedoctorDocumentBuilder) instead
+ */
@Deprecated
String renderFeature(Feature feature);
@@ -17,7 +21,11 @@ default String renderFeature(Feature feature, CukedoctorDocumentBuilder document
return renderFeature(feature);
}
- /** @deprecated Use renderFeatures(List<Feature>, CukedoctorDocumentBuilder) instead */
+ /**
+ * @param features the features to render
+ * @return the rendered {@link String}
+ * @deprecated Use renderFeatures(List<Feature>, CukedoctorDocumentBuilder) instead
+ */
@Deprecated
String renderFeatures(List features);
diff --git a/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/HeaderRenderer.java b/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/HeaderRenderer.java
index feff575d..8ea51626 100644
--- a/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/HeaderRenderer.java
+++ b/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/HeaderRenderer.java
@@ -14,7 +14,7 @@ public interface HeaderRenderer extends BaseRenderer {
/**
* @deprecated Use renderDocumentHeader(DocumentAttributes, CukedoctorDocumentBuilder) instead
* @param cukedoctorAttributes cukedoctor attributes
- * @return
+ * @return the rendered {@link String}
*/
@Deprecated
String renderDocumentHeader(DocumentAttributes cukedoctorAttributes);
diff --git a/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/ScenarioRenderer.java b/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/ScenarioRenderer.java
index c55b0ec0..bbb1d702 100644
--- a/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/ScenarioRenderer.java
+++ b/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/ScenarioRenderer.java
@@ -8,7 +8,12 @@
/** Created by pestano on 24/02/16. */
public interface ScenarioRenderer extends BaseRenderer {
- /** @deprecated Use renderScenario(Scenario, Feature, CukedoctorDocumentBuilder) instead */
+ /**
+ * @param scenario scenario to render
+ * @param feature the feature containing the scenario
+ * @return the renderer scenario
+ * @deprecated Use renderScenario(Scenario, Feature, CukedoctorDocumentBuilder) instead
+ */
@Deprecated
String renderScenario(Scenario scenario, Feature feature);
diff --git a/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/StepsRenderer.java b/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/StepsRenderer.java
index a2dcb7c3..19e58f85 100644
--- a/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/StepsRenderer.java
+++ b/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/StepsRenderer.java
@@ -11,6 +11,10 @@
public interface StepsRenderer extends BaseRenderer {
/**
+ * @param steps the steps to render
+ * @param scenario scenario containing the steps
+ * @param feature the feature containing the scenario
+ * @return the renderer {@link String}
* @deprecated Use renderSteps(List<Step>, Scenario, Feature, CukedoctorDocumentBuilder)
* instead
*/
diff --git a/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/SummaryRenderer.java b/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/SummaryRenderer.java
index a8c177a4..d35438a3 100644
--- a/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/SummaryRenderer.java
+++ b/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/SummaryRenderer.java
@@ -8,7 +8,11 @@
/** Created by pestano on 24/02/16. */
public interface SummaryRenderer extends BaseRenderer {
- /** @deprecated Use renderSummary(List<Feature>, CukedoctorDocumentBuilder) instead */
+ /**
+ * @param features the features to render
+ * @return the rendered {@link String}
+ * @deprecated Use renderSummary(List<Feature>, CukedoctorDocumentBuilder) instead
+ */
@Deprecated
String renderSummary(List features);
diff --git a/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/TagsRenderer.java b/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/TagsRenderer.java
index 80385a65..8a3cb9b4 100644
--- a/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/TagsRenderer.java
+++ b/cukedoctor-converter/src/main/java/com/github/cukedoctor/spi/TagsRenderer.java
@@ -8,7 +8,12 @@
/** Created by pestano on 28/02/16. */
public interface TagsRenderer extends BaseRenderer {
- /** @deprecated Use renderScenarioTags(Scenario, CukedoctorDocumentBuilder) instead */
+ /**
+ * @param feature the feature containing the tags
+ * @param scenario the scenario containing the tags
+ * @return the rendered {@link String}
+ * @deprecated Use renderScenarioTags(Scenario, CukedoctorDocumentBuilder) instead
+ */
@Deprecated
String renderScenarioTags(Feature feature, Scenario scenario);
diff --git a/cukedoctor-converter/src/main/java/com/github/cukedoctor/util/Assert.java b/cukedoctor-converter/src/main/java/com/github/cukedoctor/util/Assert.java
index f4a885b6..2b0b4816 100644
--- a/cukedoctor-converter/src/main/java/com/github/cukedoctor/util/Assert.java
+++ b/cukedoctor-converter/src/main/java/com/github/cukedoctor/util/Assert.java
@@ -144,8 +144,8 @@ public static boolean notEmpty(Map, ?> map) {
*
*
* @param array the array
+ * @return TRUE when given array has no null elements; FALSE otherwise
*/
- /** @return TRUE when given array has no null elements; FALSE otherwise */
public static boolean notNull(Object[] array) {
if (array != null) {
for (Object element : array) {
diff --git a/cukedoctor-converter/src/main/java/com/github/cukedoctor/util/FileUtil.java b/cukedoctor-converter/src/main/java/com/github/cukedoctor/util/FileUtil.java
index 178ed677..8f0e2c87 100644
--- a/cukedoctor-converter/src/main/java/com/github/cukedoctor/util/FileUtil.java
+++ b/cukedoctor-converter/src/main/java/com/github/cukedoctor/util/FileUtil.java
@@ -10,16 +10,16 @@
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import java.util.regex.Pattern;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/** Created by pestano on 02/06/15. */
public class FileUtil {
- private static final Logger log = Logger.getLogger(FileUtil.class.getName());
+ private static final Logger log = LoggerFactory.getLogger(FileUtil.class);
public static final Pattern ADOC_FILE_EXTENSION =
Pattern.compile("([^\\s]+(\\.(?i)(ad|adoc|asciidoc|asc))$)");
@@ -119,10 +119,7 @@ public FileVisitResult visitFile(final Path file, final BasicFileAttributes attr
}
});
} catch (IOException e) {
- log.log(
- Level.WARNING,
- "Problems scanning " + suffix + " files in path:" + startDir,
- e.getMessage());
+ log.warn("Problems scanning {} files in path: {}", suffix, startDir, e);
}
return foundPaths;
}
@@ -157,7 +154,7 @@ public static File saveFile(String name, String data) {
log.info("Wrote: " + file.getAbsolutePath());
return file;
} catch (IOException e) {
- log.log(Level.SEVERE, "Could not create file " + name, e);
+ log.error("Could not create file {}", name, e);
return null;
}
}
@@ -186,6 +183,11 @@ public static boolean removeFile(String path) {
return fileToRemove.delete();
}
+ public static void removeDir(String path) throws IOException {
+ File directoryToRemove = loadFile(path);
+ FileUtils.deleteDirectory(directoryToRemove);
+ }
+
/**
* @param source resource from classpath
* @param dest dest path
@@ -197,8 +199,7 @@ public static File copyFileFromClassPath(String source, String dest) {
InputStream in = FileUtil.class.getResourceAsStream(source);
return saveFile(dest, IOUtils.toString(in));
} catch (IOException e) {
- log.log(
- Level.SEVERE, "Could not copy source file: " + source + " to dest file: " + dest, e);
+ log.error("Could not copy source file: {} to dest file: {}", source, dest, e);
}
}
return null;
@@ -214,15 +215,14 @@ public static File copyFile(String source, String dest) {
if (source != null && dest != null) {
File sourcefile = new File(source);
if (!sourcefile.exists()) {
- log.warning(String.format("File %s not found.", sourcefile.getAbsolutePath()));
+ log.warn("File {} not found.", sourcefile.getAbsolutePath());
return null;
}
try {
InputStream in = new FileInputStream(source);
return saveFile(dest, IOUtils.toString(in));
} catch (IOException e) {
- log.log(
- Level.SEVERE, "Could not copy source file: " + source + " to dest file: " + dest, e);
+ log.error("Could not copy source file: {} to dest file: {}", source, dest, e);
}
}
return null;
diff --git a/cukedoctor-converter/src/perf/java/com/github/cukedoctor/CukedoctorBenchmark.java b/cukedoctor-converter/src/perf/java/com/github/cukedoctor/CukedoctorBenchmark.java
index 80f460e2..4f248051 100644
--- a/cukedoctor-converter/src/perf/java/com/github/cukedoctor/CukedoctorBenchmark.java
+++ b/cukedoctor-converter/src/perf/java/com/github/cukedoctor/CukedoctorBenchmark.java
@@ -14,8 +14,8 @@
import java.io.File;
import java.util.List;
import java.util.UUID;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Created by pestano on 22/02/16.
@@ -24,6 +24,8 @@
@BenchmarkMode(Mode.Throughput)
public class CukedoctorBenchmark {
+ private static final Logger log = LoggerFactory.getLogger(CukedoctorBenchmark.class);
+
private static CukedoctorConverter cukedoctorConverter;
private static List asciidoctorFeatures;
private static Asciidoctor asciidoctor;
@@ -34,7 +36,7 @@ public static class BenchmarkContext {
@Setup
public void init() throws RunnerException {
- Logger.getLogger(FileUtil.class.getName()).setLevel(Level.SEVERE);
+ System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "error");
String asciidoctorFeaturesPath = FileUtil.findJsonFile(CukedoctorBenchmark.class.getResource("/asciidoctor-features.json").getPath());
asciidoctorFeatures = FeatureParser.parse(asciidoctorFeaturesPath);
cukedoctorConverter = Cukedoctor.instance(asciidoctorFeatures);
@@ -65,7 +67,7 @@ public static void main(String[] args) throws RunnerException, InterruptedExcept
).run();
}finally {
List files = FileUtil.findFiles("target/benchmark", ".adoc");
- Logger.getLogger(CukedoctorBenchmark.class.getName()).info("Number of files converted: " + files.size());
+ log.info("Number of files converted: {}", files.size());
CukedoctorBenchmark.removeAdocFIles();
}
diff --git a/cukedoctor-converter/src/test/resources/cucumber.properties b/cukedoctor-converter/src/test/resources/cucumber.properties
new file mode 100644
index 00000000..e843e395
--- /dev/null
+++ b/cukedoctor-converter/src/test/resources/cucumber.properties
@@ -0,0 +1,2 @@
+# suppress inspection "UnusedProperty" for whole file
+cucumber.publish.quiet=true
diff --git a/cukedoctor-converter/src/test/resources/logging.properties b/cukedoctor-converter/src/test/resources/logging.properties
deleted file mode 100644
index 5ad47a5b..00000000
--- a/cukedoctor-converter/src/test/resources/logging.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-handlers = java.util.logging.ConsoleHandler
-
-
-java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
-
-com.github.cukedoctor.converter.level=INFO
-
-com.github.cukedoctor.parser.level=OFF
-
diff --git a/cukedoctor-extension/pom.xml b/cukedoctor-extension/pom.xml
index 51b08101..1e10c5c7 100644
--- a/cukedoctor-extension/pom.xml
+++ b/cukedoctor-extension/pom.xml
@@ -18,14 +18,11 @@
org.jsoup
jsoup
- 1.8.3
commons-io
commons-io
- 2.11.0
-
diff --git a/cukedoctor-extension/src/main/java/com/github/cukedoctor/extension/CukedoctorFooterExtension.java b/cukedoctor-extension/src/main/java/com/github/cukedoctor/extension/CukedoctorFooterExtension.java
index 6c6ff511..a9765281 100644
--- a/cukedoctor-extension/src/main/java/com/github/cukedoctor/extension/CukedoctorFooterExtension.java
+++ b/cukedoctor-extension/src/main/java/com/github/cukedoctor/extension/CukedoctorFooterExtension.java
@@ -2,15 +2,18 @@
import java.text.DateFormat;
import java.util.*;
-import java.util.logging.Logger;
import org.asciidoctor.ast.Document;
import org.asciidoctor.extension.Postprocessor;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Element;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/** Created by pestano on 20/07/15. adds search box to rendered html documentation */
public class CukedoctorFooterExtension extends Postprocessor {
+ private static final Logger log = LoggerFactory.getLogger(CukedoctorFooterExtension.class);
+
private static final DateFormat dateFormat =
DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT);
@@ -28,8 +31,7 @@ public String process(Document document, String output) {
"/cukedoctor-extension.properties"));
cukedoctorVersion = bundle.getString("cukedoctor.version");
} catch (Exception e) {
- Logger.getLogger(getClass().getName())
- .warning("Could not find bundle cukedoctor-extension");
+ log.warn("Could not find bundle cukedoctor-extension");
}
if (stopWatch != null && !"".equals(stopWatch)) {
diff --git a/cukedoctor-extension/src/main/java/com/github/cukedoctor/extension/CukedoctorStyleExtension.java b/cukedoctor-extension/src/main/java/com/github/cukedoctor/extension/CukedoctorStyleExtension.java
index 785d068c..b651da43 100644
--- a/cukedoctor-extension/src/main/java/com/github/cukedoctor/extension/CukedoctorStyleExtension.java
+++ b/cukedoctor-extension/src/main/java/com/github/cukedoctor/extension/CukedoctorStyleExtension.java
@@ -8,19 +8,19 @@
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import org.apache.commons.io.IOUtils;
import org.asciidoctor.ast.Document;
import org.asciidoctor.extension.Postprocessor;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/** Created by pestano on 20/07/15. extends html document styles */
public class CukedoctorStyleExtension extends Postprocessor {
- private static final Logger LOG = Logger.getLogger(CukedoctorStyleExtension.class.getName());
+ private static final Logger log = LoggerFactory.getLogger(CukedoctorStyleExtension.class);
public static final String BASE_DIR =
Files.exists(Paths.get("target"))
@@ -68,7 +68,7 @@ private void addCukedoctorCss(org.jsoup.nodes.Document document) {
Elements head = document.getElementsByTag("head");
head.append(" ");
} catch (IOException e) {
- LOG.log(Level.SEVERE, "Could not copy cukedoctor css from: " + themePath, e);
+ log.error("Could not copy cukedoctor css from: {}", themePath, e);
}
}
}
diff --git a/cukedoctor-extension/src/main/java/com/github/cukedoctor/extension/util/FileUtil.java b/cukedoctor-extension/src/main/java/com/github/cukedoctor/extension/util/FileUtil.java
index edbe2ed6..310738b7 100644
--- a/cukedoctor-extension/src/main/java/com/github/cukedoctor/extension/util/FileUtil.java
+++ b/cukedoctor-extension/src/main/java/com/github/cukedoctor/extension/util/FileUtil.java
@@ -5,16 +5,16 @@
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import java.util.regex.Pattern;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/** Created by pestano on 02/06/15. */
public class FileUtil {
- private static final Logger LOG = Logger.getLogger(FileUtil.class.getName());
+ private static final Logger log = LoggerFactory.getLogger(FileUtil.class);
public static final Pattern ADOC_FILE_EXTENSION =
Pattern.compile("([^\\s]+(\\.(?i)(ad|adoc|asciidoc|asc))$)");
@@ -45,10 +45,10 @@ public static File saveFile(String name, String data) {
File file = new File(fullyQualifiedName);
file.createNewFile();
FileUtils.write(file, data, "UTF-8");
- LOG.info("Wrote: " + file.getAbsolutePath());
+ log.info("Wrote: " + file.getAbsolutePath());
return file;
} catch (IOException e) {
- LOG.log(Level.SEVERE, "Could not create file " + name, e);
+ log.error("Could not create file {}", name, e);
return null;
}
}
@@ -80,8 +80,7 @@ public static File copyFile(String source, String dest) {
try (InputStream in = FileUtil.class.getResourceAsStream(source)) {
return saveFile(dest, IOUtils.toString(in));
} catch (IOException e) {
- LOG.log(
- Level.SEVERE, "Could not copy source file: " + source + " to dest file: " + dest, e);
+ log.error("Could not copy source file: {} to dest file: {}", dest, e);
}
}
return null;
@@ -133,10 +132,7 @@ public FileVisitResult visitFile(final Path file, final BasicFileAttributes attr
}
});
} catch (IOException e) {
- LOG.log(
- Level.WARNING,
- "Problems scanning " + sulfix + " files in path:" + startDir,
- e.getMessage());
+ log.warn("Problems scanning {} files in path: {}", sulfix, startDir, e);
}
return absolutePaths;
}
@@ -152,8 +148,7 @@ public static File copyFileFromClassPath(String source, String dest) {
InputStream in = FileUtil.class.getResourceAsStream(source);
return saveFile(dest, IOUtils.toString(in));
} catch (IOException e) {
- LOG.log(
- Level.SEVERE, "Could not copy source file: " + source + " to dest file: " + dest, e);
+ log.error("Could not copy source file: {} to dest file: {}", source, dest, e);
}
}
return null;
@@ -170,11 +165,11 @@ public static String readFileContent(File target) {
bufferedReader.close();
} catch (Exception e) {
- LOG.log(Level.WARNING, "Could not read file content: " + target);
+ log.warn("Could not read file content: {}", target);
}
} catch (Exception e) {
- LOG.log(Level.WARNING, "Could not read file content: " + target);
+ log.warn("Could not read file content: {}", target);
}
return content.toString();
diff --git a/cukedoctor-main/pom.xml b/cukedoctor-main/pom.xml
index b1a6cd98..de0f7372 100644
--- a/cukedoctor-main/pom.xml
+++ b/cukedoctor-main/pom.xml
@@ -14,7 +14,6 @@
com.github.cukedoctor
cukedoctor-converter
- ${project.parent.version}
org.asciidoctor
@@ -32,13 +31,6 @@
com.beust
jcommander
- 1.48
-
-
- junit
- junit
- 4.13.1
- test
@@ -47,15 +39,6 @@
com.github.cukedoctor
cukedoctor-maven-plugin
- ${project.parent.version}
-
-
-
- execute
-
- install
-
-
@@ -68,7 +51,6 @@
org.apache.maven.plugins
maven-assembly-plugin
- 2.4.1
false
@@ -95,18 +77,9 @@
com.ning.maven.plugins
maven-duplicate-finder-plugin
- 1.0.9
false
-
-
-
- check
-
- verify
-
-