Skip to content

Commit

Permalink
Remove name property from TestContext to avoid collision
Browse files Browse the repository at this point in the history
  • Loading branch information
lukfor committed Aug 31, 2023
1 parent f77ad8a commit f99f330
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 15 deletions.
15 changes: 3 additions & 12 deletions src/main/java/com/askimed/nf/test/lang/TestContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public class TestContext {

public ITest test;

private String name;

private WorkflowMeta workflow = new WorkflowMeta();

public TestContext(ITest test) {
Expand All @@ -49,10 +47,10 @@ public void init(AbstractTest test) {
this.launchDir = test.launchDir.getAbsolutePath();
this.workDir = test.workDir.getAbsolutePath();
this.outputDir = test.outputDir.getAbsolutePath();
if (moduleDir != null) {
if (test.moduleDir != null) {
this.moduleDir = test.moduleDir.getAbsolutePath();
}
if (moduleTestDir != null) {
if (test.moduleTestDir != null) {
this.moduleTestDir = test.moduleTestDir.getAbsolutePath();
}
}
Expand All @@ -70,6 +68,7 @@ public void params(Closure closure) {
}

public void evaluateParamsClosure() {

if (paramsClosure == null) {
return;
}
Expand All @@ -95,12 +94,4 @@ public void loadParams(String filename) throws CompilationFailedException, Class
params.load(filename);
}

public void setName(String name) {
this.name = name;
}

public String getName() {
return name;
}

}
5 changes: 5 additions & 0 deletions src/main/java/com/askimed/nf/test/lang/WorkflowMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,9 @@ public String getName() {
return name;
}

@Override
public String toString() {
return name;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public FunctionTest(FunctionTestSuite parent) {
super(parent);
this.parent = parent;
context = new FunctionContext(this);
context.setName(parent.getFunction());
}

public void name(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public PipelineTest(PipelineTestSuite parent) {
super(parent);
this.parent = parent;
context = new PipelineContext(this);
context.setName(parent.getName());
}

public void name(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public WorkflowTest(WorkflowTestSuite parent) {
this.parent = parent;
this.autoSort = parent.isAutoSort();
context = new WorkflowContext(this);
context.setName(parent.getWorkflow());
}

public void name(String name) {
Expand Down

0 comments on commit f99f330

Please sign in to comment.