diff --git a/sunshine-testng/src/main/java/io/github/tatools/sunshine/testng/LoadableTestNGSuite.java b/sunshine-testng/src/main/java/io/github/tatools/sunshine/testng/LoadableTestNGSuite.java index 49028af..c8a57e7 100644 --- a/sunshine-testng/src/main/java/io/github/tatools/sunshine/testng/LoadableTestNGSuite.java +++ b/sunshine-testng/src/main/java/io/github/tatools/sunshine/testng/LoadableTestNGSuite.java @@ -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. @@ -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 @@ -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); }