Skip to content

Commit

Permalink
Pull up executionOrder property into SpecElementInfo
Browse files Browse the repository at this point in the history
Both SpecInfo and FeatureInfo had identical executionOrder bean
properties, declared redundantly. Therefore, I pulled them up into the
base class.

Relates to spockframework#1443.
  • Loading branch information
kriegaex committed May 6, 2023
1 parent a38e407 commit f0117e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
public class FeatureInfo extends SpecElementInfo<SpecInfo, AnnotatedElement> implements ITestTaggable {
private int declarationOrder; // per spec class
private int executionOrder; // per spec inheritance chain

private final List<String> parameterNames = new ArrayList<>();
private final List<String> dataVariables = new ArrayList<>();
Expand Down Expand Up @@ -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<String> getParameterNames() {
return parameterNames;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ public abstract class SpecElementInfo<P extends NodeInfo, R extends AnnotatedEle
private String displayName;

private boolean excluded = false;
private int executionOrder;
private final List<Tag> tags = new ArrayList<>();
private final List<Attachment> attachments = new ArrayList<>();
private final List<IMethodInterceptor> interceptors = new ArrayList<>();

@Override
public boolean isSkipped() {
return skipped;
Expand Down Expand Up @@ -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<Tag> getTags() {
return tags;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ public class SpecInfo extends SpecElementInfo<NodeInfo, Class<?>> implements IMe
private ExecutionMode executionMode = null;
private ExecutionMode childExecutionMode = null;

private int executionOrder;

private String pkg;
private String filename;
private String narrative;
Expand All @@ -68,14 +66,6 @@ public class SpecInfo extends SpecElementInfo<NodeInfo, Class<?>> implements IMe

private final List<FeatureInfo> features = new ArrayList<>();

public int getExecutionOrder() {
return executionOrder;
}

public void setExecutionOrder(int executionOrder) {
this.executionOrder = executionOrder;
}

public String getPackage() {
return pkg;
}
Expand Down

0 comments on commit f0117e0

Please sign in to comment.