From f0117e0ff066dc880bcc1d34f45c2f3941d7068c Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Sun, 16 Apr 2023 17:50:28 +0200 Subject: [PATCH] Pull up executionOrder property into SpecElementInfo Both SpecInfo and FeatureInfo had identical executionOrder bean properties, declared redundantly. Therefore, I pulled them up into the base class. Relates to #1443. --- .../org/spockframework/runtime/model/FeatureInfo.java | 9 --------- .../spockframework/runtime/model/SpecElementInfo.java | 10 ++++++++++ .../org/spockframework/runtime/model/SpecInfo.java | 10 ---------- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/spock-core/src/main/java/org/spockframework/runtime/model/FeatureInfo.java b/spock-core/src/main/java/org/spockframework/runtime/model/FeatureInfo.java index 7c0f341d34..d3b633b672 100644 --- a/spock-core/src/main/java/org/spockframework/runtime/model/FeatureInfo.java +++ b/spock-core/src/main/java/org/spockframework/runtime/model/FeatureInfo.java @@ -14,7 +14,6 @@ */ public class FeatureInfo extends SpecElementInfo implements ITestTaggable { private int declarationOrder; // per spec class - private int executionOrder; // per spec inheritance chain private final List parameterNames = new ArrayList<>(); private final List dataVariables = new ArrayList<>(); @@ -59,14 +58,6 @@ public void setDeclarationOrder(int declarationOrder) { this.declarationOrder = declarationOrder; } - public int getExecutionOrder() { - return executionOrder; - } - - public void setExecutionOrder(int executionOrder) { - this.executionOrder = executionOrder; - } - public List getParameterNames() { return parameterNames; } diff --git a/spock-core/src/main/java/org/spockframework/runtime/model/SpecElementInfo.java b/spock-core/src/main/java/org/spockframework/runtime/model/SpecElementInfo.java index dd58692020..188c3137b3 100644 --- a/spock-core/src/main/java/org/spockframework/runtime/model/SpecElementInfo.java +++ b/spock-core/src/main/java/org/spockframework/runtime/model/SpecElementInfo.java @@ -31,9 +31,11 @@ public abstract class SpecElementInfo

tags = new ArrayList<>(); private final List attachments = new ArrayList<>(); private final List interceptors = new ArrayList<>(); + @Override public boolean isSkipped() { return skipped; @@ -75,6 +77,14 @@ public void setExcluded(boolean excluded) { this.excluded = excluded; } + public int getExecutionOrder() { + return executionOrder; + } + + public void setExecutionOrder(int executionOrder) { + this.executionOrder = executionOrder; + } + @Override public List getTags() { return tags; diff --git a/spock-core/src/main/java/org/spockframework/runtime/model/SpecInfo.java b/spock-core/src/main/java/org/spockframework/runtime/model/SpecInfo.java index 22da3adee0..287528214b 100644 --- a/spock-core/src/main/java/org/spockframework/runtime/model/SpecInfo.java +++ b/spock-core/src/main/java/org/spockframework/runtime/model/SpecInfo.java @@ -48,8 +48,6 @@ public class SpecInfo extends SpecElementInfo> implements IMe private ExecutionMode executionMode = null; private ExecutionMode childExecutionMode = null; - private int executionOrder; - private String pkg; private String filename; private String narrative; @@ -68,14 +66,6 @@ public class SpecInfo extends SpecElementInfo> implements IMe private final List features = new ArrayList<>(); - public int getExecutionOrder() { - return executionOrder; - } - - public void setExecutionOrder(int executionOrder) { - this.executionOrder = executionOrder; - } - public String getPackage() { return pkg; }