Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*
* @author charlie (Dmitry Baev).
*/
@FunctionalInterface
public interface AttachmentData {

String getName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* @param <T> the type of attachment data.
* @author charlie (Dmitry Baev).
*/
@FunctionalInterface
public interface AttachmentProcessor<T extends AttachmentData> {

void addAttachment(T attachmentData, AttachmentRenderer<T> renderer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* @author charlie (Dmitry Baev).
*/
@SuppressWarnings("PMD.AvoidUncheckedExceptionsInSignatures")
@FunctionalInterface
public interface AttachmentRenderer<T extends AttachmentData> {

AttachmentContent render(T attachmentData) throws AttachmentRenderException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ public String toString() {
/**
* Builder for HttpRequestAttachment.
*/
@SuppressWarnings("PMD.AvoidFieldNameMatchingMethodName")
public static final class Builder {

private final String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public String toString() {
/**
* Builder for HttpRequestAttachment.
*/
@SuppressWarnings("PMD.AvoidFieldNameMatchingMethodName")
public static final class Builder {

private final String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
"ClassDataAbstractionCoupling",
"ClassFanOutComplexity",
"MultipleStringLiterals",
"PMD.ExcessiveImports",
})
public class AllureCucumber4Jvm implements ConcurrentEventListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
/**
* Scenario labels and links builder.
*/
@SuppressWarnings({"CyclomaticComplexity", "PMD.CyclomaticComplexity", "PMD.NcssCount", "MultipleStringLiterals"})
class LabelBuilder {
@SuppressWarnings({"CyclomaticComplexity", "MultipleStringLiterals"})
final class LabelBuilder {
private static final Logger LOGGER = LoggerFactory.getLogger(LabelBuilder.class);
private static final String COMPOSITE_TAG_DELIMITER = "=";

Expand Down Expand Up @@ -89,34 +89,34 @@ class LabelBuilder {

switch (tagKey) {
case SEVERITY:
getScenarioLabels().add(ResultsUtils.createSeverityLabel(tagValue.toLowerCase()));
scenarioLabels.add(ResultsUtils.createSeverityLabel(tagValue.toLowerCase()));
break;
case TMS_LINK:
getScenarioLinks().add(ResultsUtils.createTmsLink(tagValue));
scenarioLinks.add(ResultsUtils.createTmsLink(tagValue));
break;
case ISSUE_LINK:
getScenarioLinks().add(ResultsUtils.createIssueLink(tagValue));
scenarioLinks.add(ResultsUtils.createIssueLink(tagValue));
break;
case PLAIN_LINK:
getScenarioLinks().add(ResultsUtils.createLink(null, tagValue, tagValue, null));
scenarioLinks.add(ResultsUtils.createLink(null, tagValue, tagValue, null));
break;
default:
LOGGER.warn("Composite tag {} is not supported. adding it as RAW", tagKey);
getScenarioLabels().add(getTagLabel(tag));
scenarioLabels.add(getTagLabel(tag));
break;
}
} else if (tagParser.isPureSeverityTag(tag)) {
getScenarioLabels().add(ResultsUtils.createSeverityLabel(tagString.substring(1)));
scenarioLabels.add(ResultsUtils.createSeverityLabel(tagString.substring(1)));
} else if (!tagParser.isResultTag(tag)) {
getScenarioLabels().add(getTagLabel(tag));
scenarioLabels.add(getTagLabel(tag));
}
}

final String featureName = feature.getName();
final String uri = scenario.getUri();

getScenarioLabels().addAll(ResultsUtils.getProvidedLabels());
getScenarioLabels().addAll(Arrays.asList(
scenarioLabels.addAll(ResultsUtils.getProvidedLabels());
scenarioLabels.addAll(Arrays.asList(
createHostLabel(),
createThreadLabel(),
createFeatureLabel(featureName),
Expand All @@ -130,7 +130,7 @@ class LabelBuilder {

featurePackage(uri, featureName)
.map(ResultsUtils::createPackageLabel)
.ifPresent(getScenarioLabels()::add);
.ifPresent(scenarioLabels::add);
}

public List<Label> getScenarioLabels() {
Expand All @@ -151,13 +151,13 @@ private Label getTagLabel(final PickleTag tag) {
* @param tagString Full tag name and value
*/
private void tryHandleNamedLink(final String tagString) {
final String namedLinkPatternString = PLAIN_LINK + "\\.(\\w+-?)+=(\\w+(-|_)?)+";
final String namedLinkPatternString = PLAIN_LINK + "\\.(\\w+-?)+=(\\w+([-_])?)+";
final Pattern namedLinkPattern = Pattern.compile(namedLinkPatternString, Pattern.CASE_INSENSITIVE);

if (namedLinkPattern.matcher(tagString).matches()) {
final String type = tagString.split(COMPOSITE_TAG_DELIMITER)[0].split("[.]")[1];
final String name = tagString.split(COMPOSITE_TAG_DELIMITER)[1];
getScenarioLinks().add(ResultsUtils.createLink(null, name, null, type));
scenarioLinks.add(ResultsUtils.createLink(null, name, null, type));
} else {
LOGGER.warn("Composite named tag {} does not match regex {}. Skipping", tagString,
namedLinkPatternString);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
"ClassDataAbstractionCoupling",
"ClassFanOutComplexity",
"MultipleStringLiterals",
"PMD.ExcessiveImports",
})
public class AllureCucumber5Jvm implements ConcurrentEventListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
/**
* Scenario labels and links builder.
*/
@SuppressWarnings({"CyclomaticComplexity", "PMD.CyclomaticComplexity", "PMD.NcssCount", "MultipleStringLiterals"})
@SuppressWarnings({"CyclomaticComplexity", "MultipleStringLiterals"})
class LabelBuilder {
private static final Logger LOGGER = LoggerFactory.getLogger(LabelBuilder.class);
private static final String COMPOSITE_TAG_DELIMITER = "=";
Expand Down Expand Up @@ -86,34 +86,34 @@ class LabelBuilder {

switch (tagKey) {
case SEVERITY:
getScenarioLabels().add(ResultsUtils.createSeverityLabel(tagValue.toLowerCase()));
scenarioLabels.add(ResultsUtils.createSeverityLabel(tagValue.toLowerCase()));
break;
case TMS_LINK:
getScenarioLinks().add(ResultsUtils.createTmsLink(tagValue));
scenarioLinks.add(ResultsUtils.createTmsLink(tagValue));
break;
case ISSUE_LINK:
getScenarioLinks().add(ResultsUtils.createIssueLink(tagValue));
scenarioLinks.add(ResultsUtils.createIssueLink(tagValue));
break;
case PLAIN_LINK:
getScenarioLinks().add(ResultsUtils.createLink(null, tagValue, tagValue, null));
scenarioLinks.add(ResultsUtils.createLink(null, tagValue, tagValue, null));
break;
default:
LOGGER.warn("Composite tag {} is not supported. adding it as RAW", tagKey);
getScenarioLabels().add(getTagLabel(tag));
scenarioLabels.add(getTagLabel(tag));
break;
}
} else if (tagParser.isPureSeverityTag(tag)) {
getScenarioLabels().add(ResultsUtils.createSeverityLabel(tag.substring(1)));
scenarioLabels.add(ResultsUtils.createSeverityLabel(tag.substring(1)));
} else if (!tagParser.isResultTag(tag)) {
getScenarioLabels().add(getTagLabel(tag));
scenarioLabels.add(getTagLabel(tag));
}
}

final String featureName = feature.getName();
final URI uri = scenario.getUri();

getScenarioLabels().addAll(ResultsUtils.getProvidedLabels());
getScenarioLabels().addAll(Arrays.asList(
scenarioLabels.addAll(ResultsUtils.getProvidedLabels());
scenarioLabels.addAll(Arrays.asList(
createHostLabel(),
createThreadLabel(),
createFeatureLabel(featureName),
Expand All @@ -127,7 +127,7 @@ class LabelBuilder {

featurePackage(uri.toString(), featureName)
.map(ResultsUtils::createPackageLabel)
.ifPresent(getScenarioLabels()::add);
.ifPresent(scenarioLabels::add);
}

public List<Label> getScenarioLabels() {
Expand All @@ -148,13 +148,13 @@ private Label getTagLabel(final String tag) {
* @param tagString Full tag name and value
*/
private void tryHandleNamedLink(final String tagString) {
final String namedLinkPatternString = PLAIN_LINK + "\\.(\\w+-?)+=(\\w+(-|_)?)+";
final String namedLinkPatternString = PLAIN_LINK + "\\.(\\w+-?)+=(\\w+([-_])?)+";
final Pattern namedLinkPattern = Pattern.compile(namedLinkPatternString, Pattern.CASE_INSENSITIVE);

if (namedLinkPattern.matcher(tagString).matches()) {
final String type = tagString.split(COMPOSITE_TAG_DELIMITER)[0].split("[.]")[1];
final String name = tagString.split(COMPOSITE_TAG_DELIMITER)[1];
getScenarioLinks().add(ResultsUtils.createLink(null, name, null, type));
scenarioLinks.add(ResultsUtils.createLink(null, name, null, type));
} else {
LOGGER.warn("Composite named tag {} does not match regex {}. Skipping", tagString,
namedLinkPatternString);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
@SuppressWarnings({
"ClassDataAbstractionCoupling",
"ClassFanOutComplexity",
"PMD.ExcessiveImports",
})
public class AllureCucumber6Jvm implements ConcurrentEventListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
/**
* Scenario labels and links builder.
*/
@SuppressWarnings({"CyclomaticComplexity", "PMD.CyclomaticComplexity", "PMD.NcssCount", "MultipleStringLiterals"})
@SuppressWarnings({"CyclomaticComplexity", "MultipleStringLiterals"})
class LabelBuilder {
private static final Logger LOGGER = LoggerFactory.getLogger(LabelBuilder.class);
private static final String COMPOSITE_TAG_DELIMITER = "=";
Expand Down Expand Up @@ -86,34 +86,34 @@ class LabelBuilder {

switch (tagKey) {
case SEVERITY:
getScenarioLabels().add(ResultsUtils.createSeverityLabel(tagValue.toLowerCase()));
scenarioLabels.add(ResultsUtils.createSeverityLabel(tagValue.toLowerCase()));
break;
case TMS_LINK:
getScenarioLinks().add(ResultsUtils.createTmsLink(tagValue));
scenarioLinks.add(ResultsUtils.createTmsLink(tagValue));
break;
case ISSUE_LINK:
getScenarioLinks().add(ResultsUtils.createIssueLink(tagValue));
scenarioLinks.add(ResultsUtils.createIssueLink(tagValue));
break;
case PLAIN_LINK:
getScenarioLinks().add(ResultsUtils.createLink(null, tagValue, tagValue, null));
scenarioLinks.add(ResultsUtils.createLink(null, tagValue, tagValue, null));
break;
default:
LOGGER.warn("Composite tag {} is not supported. adding it as RAW", tagKey);
getScenarioLabels().add(getTagLabel(tag));
scenarioLabels.add(getTagLabel(tag));
break;
}
} else if (tagParser.isPureSeverityTag(tag)) {
getScenarioLabels().add(ResultsUtils.createSeverityLabel(tag.substring(1)));
scenarioLabels.add(ResultsUtils.createSeverityLabel(tag.substring(1)));
} else if (!tagParser.isResultTag(tag)) {
getScenarioLabels().add(getTagLabel(tag));
scenarioLabels.add(getTagLabel(tag));
}
}

final String featureName = feature.getName();
final URI uri = scenario.getUri();

getScenarioLabels().addAll(ResultsUtils.getProvidedLabels());
getScenarioLabels().addAll(Arrays.asList(
scenarioLabels.addAll(ResultsUtils.getProvidedLabels());
scenarioLabels.addAll(Arrays.asList(
createHostLabel(),
createThreadLabel(),
createFeatureLabel(featureName),
Expand All @@ -127,7 +127,7 @@ class LabelBuilder {

featurePackage(uri.toString(), featureName)
.map(ResultsUtils::createPackageLabel)
.ifPresent(getScenarioLabels()::add);
.ifPresent(scenarioLabels::add);
}

public List<Label> getScenarioLabels() {
Expand All @@ -148,13 +148,13 @@ private Label getTagLabel(final String tag) {
* @param tagString Full tag name and value
*/
private void tryHandleNamedLink(final String tagString) {
final String namedLinkPatternString = PLAIN_LINK + "\\.(\\w+-?)+=(\\w+(-|_)?)+";
final String namedLinkPatternString = PLAIN_LINK + "\\.(\\w+-?)+=(\\w+([-_])?)+";
final Pattern namedLinkPattern = Pattern.compile(namedLinkPatternString, Pattern.CASE_INSENSITIVE);

if (namedLinkPattern.matcher(tagString).matches()) {
final String type = tagString.split(COMPOSITE_TAG_DELIMITER)[0].split("[.]")[1];
final String name = tagString.split(COMPOSITE_TAG_DELIMITER)[1];
getScenarioLinks().add(ResultsUtils.createLink(null, name, null, type));
scenarioLinks.add(ResultsUtils.createLink(null, name, null, type));
} else {
LOGGER.warn("Composite named tag {} does not match regex {}. Skipping", tagString,
namedLinkPatternString);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
@SuppressWarnings({
"ClassDataAbstractionCoupling",
"ClassFanOutComplexity",
"PMD.ExcessiveImports",
})
public class AllureCucumber7Jvm implements ConcurrentEventListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
/**
* Scenario labels and links builder.
*/
@SuppressWarnings({"CyclomaticComplexity", "PMD.CyclomaticComplexity", "PMD.NcssCount", "MultipleStringLiterals"})
@SuppressWarnings({"CyclomaticComplexity", "MultipleStringLiterals"})
class LabelBuilder {
private static final Logger LOGGER = LoggerFactory.getLogger(LabelBuilder.class);
private static final String COMPOSITE_TAG_DELIMITER = "=";
Expand Down Expand Up @@ -87,37 +87,37 @@ class LabelBuilder {

switch (tagKey) {
case SEVERITY:
getScenarioLabels().add(ResultsUtils.createSeverityLabel(tagValue.toLowerCase()));
scenarioLabels.add(ResultsUtils.createSeverityLabel(tagValue.toLowerCase()));
break;
case TMS_LINK:
getScenarioLinks().add(ResultsUtils.createTmsLink(tagValue));
scenarioLinks.add(ResultsUtils.createTmsLink(tagValue));
break;
case ISSUE_LINK:
getScenarioLinks().add(ResultsUtils.createIssueLink(tagValue));
scenarioLinks.add(ResultsUtils.createIssueLink(tagValue));
break;
case PLAIN_LINK:
getScenarioLinks().add(ResultsUtils.createLink(null, tagValue, tagValue, null));
scenarioLinks.add(ResultsUtils.createLink(null, tagValue, tagValue, null));
break;
case OWNER:
getScenarioLabels().add(ResultsUtils.createOwnerLabel(tagValue));
scenarioLabels.add(ResultsUtils.createOwnerLabel(tagValue));
break;
default:
LOGGER.warn("Composite tag {} is not supported. adding it as RAW", tagKey);
getScenarioLabels().add(getTagLabel(tag));
scenarioLabels.add(getTagLabel(tag));
break;
}
} else if (tagParser.isPureSeverityTag(tag)) {
getScenarioLabels().add(ResultsUtils.createSeverityLabel(tag.substring(1)));
scenarioLabels.add(ResultsUtils.createSeverityLabel(tag.substring(1)));
} else if (!tagParser.isResultTag(tag)) {
getScenarioLabels().add(getTagLabel(tag));
scenarioLabels.add(getTagLabel(tag));
}
}

final String featureName = feature.getName();
final URI uri = scenario.getUri();

getScenarioLabels().addAll(ResultsUtils.getProvidedLabels());
getScenarioLabels().addAll(Arrays.asList(
scenarioLabels.addAll(ResultsUtils.getProvidedLabels());
scenarioLabels.addAll(Arrays.asList(
createHostLabel(),
createThreadLabel(),
createFeatureLabel(featureName),
Expand All @@ -131,7 +131,7 @@ class LabelBuilder {

featurePackage(uri.toString(), featureName)
.map(ResultsUtils::createPackageLabel)
.ifPresent(getScenarioLabels()::add);
.ifPresent(scenarioLabels::add);
}

public List<Label> getScenarioLabels() {
Expand All @@ -152,13 +152,13 @@ private Label getTagLabel(final String tag) {
* @param tagString Full tag name and value
*/
private void tryHandleNamedLink(final String tagString) {
final String namedLinkPatternString = PLAIN_LINK + "\\.(\\w+-?)+=(\\w+(-|_)?)+";
final String namedLinkPatternString = PLAIN_LINK + "\\.(\\w+-?)+=(\\w+([-_])?)+";
final Pattern namedLinkPattern = Pattern.compile(namedLinkPatternString, Pattern.CASE_INSENSITIVE);

if (namedLinkPattern.matcher(tagString).matches()) {
final String type = tagString.split(COMPOSITE_TAG_DELIMITER)[0].split("[.]")[1];
final String name = tagString.split(COMPOSITE_TAG_DELIMITER)[1];
getScenarioLinks().add(ResultsUtils.createLink(null, name, null, type));
scenarioLinks.add(ResultsUtils.createLink(null, name, null, type));
} else {
LOGGER.warn("Composite named tag {} does not match regex {}. Skipping", tagString,
namedLinkPatternString);
Expand Down
Loading