Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Initialise XML suite file in the constructor
Browse files Browse the repository at this point in the history
Signed-off-by: Dmytro Serdiuk <[email protected]>
  • Loading branch information
extsoft committed Aug 15, 2017
1 parent b676162 commit 0ae84ff
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public final class LoadableTestNGSuite implements TestNGSuite {

private final SunshineSuite artifacts;
private final Directory suitePath;
private final File suiteXml;

/**
* Construct new instance with the specified file system, suite's directory and tests filter.
Expand Down Expand Up @@ -61,8 +61,8 @@ public LoadableTestNGSuite(FileSystem fileSystem, Directory xmlSuiteDirectory, C
* @since 0.1
*/
public LoadableTestNGSuite(SunshineSuite suite, Directory xmlSuiteDirectory) {
this.artifacts = suite;
this.suitePath = xmlSuiteDirectory;
artifacts = suite;
suiteXml = new FileBase(xmlSuiteDirectory, "sunshine-suite.xml");
}

@Override
Expand All @@ -75,9 +75,8 @@ public File tests() throws SuiteException {
test.setSuite(xmlSuite);
xmlSuite.addTest(test);
}
FileBase fileBase = new FileBase(this.suitePath, "sunshine-suite.xml");
fileBase.write(xmlSuite.toXml());
return fileBase;
suiteXml.write(xmlSuite.toXml());
return suiteXml;
} catch (TestException | IOException e) {
throw new SuiteException(e);
}
Expand Down

0 comments on commit 0ae84ff

Please sign in to comment.