Skip to content

Commit

Permalink
feat(model): properties in Test items
Browse files Browse the repository at this point in the history
Ref etf-validator/governance#25

Signed-off-by: Jon Herrmann <herrmann@interactive-instruments.de>
  • Loading branch information
jonherrmann committed Jan 30, 2019
1 parent 883e022 commit 03309b7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import de.interactive_instruments.etf.dal.dto.capabilities.TestObjectTypeDto;
import de.interactive_instruments.etf.dal.dto.translation.TranslationTemplateBundleDto;
import de.interactive_instruments.etf.model.*;
import de.interactive_instruments.properties.Properties;

public class ExecutableTestSuiteDto extends RepositoryItemDto
implements ModelItemTreeNode<TestModelItemDto>, NestedDependencyHolder<ExecutableTestSuiteDto> {
Expand All @@ -45,6 +46,7 @@ public class ExecutableTestSuiteDto extends RepositoryItemDto
private List<TestCaseDto> parameterizedTestCases;
private EidHolderMap<TestModelItemDto> testModules;
private ParameterSet parameters;
private Properties properties;

public ExecutableTestSuiteDto() {}

Expand Down Expand Up @@ -134,6 +136,17 @@ public void setParameters(final ParameterSet parameterSet) {
this.parameters = parameterSet;
}

public Properties properties() {
if (properties == null) {
properties = new Properties();
}
return properties;
}

public void properties(final Properties properties) {
this.properties = properties;
}

public List<TestModuleDto> getTestModules() {
return (List<TestModuleDto>) getChildren();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import de.interactive_instruments.etf.dal.dto.ModelItemTreeNode;
import de.interactive_instruments.etf.model.DefaultEidMap;
import de.interactive_instruments.etf.model.EidMap;
import de.interactive_instruments.properties.Properties;

/**
* Test Model Item Dto
Expand All @@ -37,13 +38,16 @@ public abstract class TestModelItemDto extends MetaDataItemDto implements ModelI

protected EidMap<TestModelItemDto> children;

protected Properties properties;

protected TestModelItemDto() {}

protected TestModelItemDto(final TestModelItemDto other) {
super(other);
if (other.children != null) {
this.children = other.children.createCopy();
}
this.properties = other.properties;
}

@Override
Expand Down Expand Up @@ -77,6 +81,17 @@ public void setChildren(final List<? extends TestModelItemDto> children) {
}
}

public Properties properties() {
if (properties == null) {
properties = new Properties();
}
return properties;
}

public void properties(final Properties properties) {
this.properties = properties;
}

@Override
public String toString() {
final StringBuffer sb = new StringBuffer("TestModelItemDto{");
Expand Down

0 comments on commit 03309b7

Please sign in to comment.