From f4a979cb993db894b73c779cfc7676691ba5eb23 Mon Sep 17 00:00:00 2001 From: Gyorgy Mora Date: Wed, 11 May 2022 16:47:38 +0200 Subject: [PATCH] add tags to failed init descriptors too --- .../helmethair/scalatest/descriptor/ScalatestDescriptor.java | 3 ++- .../scalatest/descriptor/ScalatestFailedInitDescriptor.java | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/co/helmethair/scalatest/descriptor/ScalatestDescriptor.java b/src/main/java/co/helmethair/scalatest/descriptor/ScalatestDescriptor.java index 6e58d41..d30fc87 100644 --- a/src/main/java/co/helmethair/scalatest/descriptor/ScalatestDescriptor.java +++ b/src/main/java/co/helmethair/scalatest/descriptor/ScalatestDescriptor.java @@ -16,6 +16,7 @@ public abstract class ScalatestDescriptor implements TestDescriptor { private final UniqueId id; private TestDescriptor parentDescriptor = null; private Set childDescriptors = new HashSet(); + protected Set tags = new HashSet<>(); protected ScalatestDescriptor(UniqueId id) { this.id = id; @@ -75,7 +76,7 @@ public Set getChildren() { @Override public Set getTags() { - return new HashSet<>(); + return tags; } @Override diff --git a/src/main/java/co/helmethair/scalatest/descriptor/ScalatestFailedInitDescriptor.java b/src/main/java/co/helmethair/scalatest/descriptor/ScalatestFailedInitDescriptor.java index 87b847e..a48ac8f 100644 --- a/src/main/java/co/helmethair/scalatest/descriptor/ScalatestFailedInitDescriptor.java +++ b/src/main/java/co/helmethair/scalatest/descriptor/ScalatestFailedInitDescriptor.java @@ -1,18 +1,21 @@ package co.helmethair.scalatest.descriptor; import org.junit.platform.engine.TestSource; +import org.junit.platform.engine.TestTag; import org.junit.platform.engine.support.descriptor.MethodSource; import java.util.Optional; +import java.util.Set; public class ScalatestFailedInitDescriptor extends ScalatestDescriptor { private final Throwable cause; private final String suiteId; - public ScalatestFailedInitDescriptor(Throwable cause, String name) { + public ScalatestFailedInitDescriptor(Throwable cause, String name, Set tags) { super(ENGINE_ID.append("failed", name)); this.cause = cause; this.suiteId = name; + this.tags = tags; } @Override