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

Commit

Permalink
Add javadoc to constructors in LoadableTestNGSuite
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 c3df71f commit 23f2769
Showing 1 changed file with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,45 @@ public LoadableTestNGSuite(FileSystem fileSystem, String xmlSuiteDirectory, Cond
);
}

public LoadableTestNGSuite(FileSystem fileSystem, Directory suitePath, Condition filter) {
/**
* Constructs new instance with the specified file system, suite's directory and tests filter. All filtered tests
* will be printed to {@link System#out}.
*
* @param fileSystem the place with the tests
* @param xmlSuiteDirectory the place to store suite file
* @param filter the filter to be used to select desired tests
* @since 0.1
*/
public LoadableTestNGSuite(FileSystem fileSystem, Directory xmlSuiteDirectory, Condition filter) {
this(
new SunshineSuitePrintable(new SunshineSuiteFilterable(new SunshineSuiteBase(fileSystem), filter)),
suitePath
xmlSuiteDirectory
);
}

public LoadableTestNGSuite(SunshineSuite artifacts, Directory suitePath) {
this.artifacts = artifacts;
this.suitePath = suitePath;
/**
* Constructs new instance with the specified suite and suite's directory.
*
* @param suite the tests to be used
* @param xmlSuiteDirectory the directory to store suite file
* @since 0.1
*/
public LoadableTestNGSuite(SunshineSuite suite, Directory xmlSuiteDirectory) {
artifacts = suite;
suitePath = xmlSuiteDirectory;
}

@Override
public File tests() throws SuiteException {
XmlSuite xmlSuite = new XmlSuite();
xmlSuite.setName("Sunshine suite");
try {
for (SunshineTest sunshineTest : this.artifacts.tests()) {
for (SunshineTest sunshineTest : artifacts.tests()) {
XmlTest test = new TestNGTest(sunshineTest).object();
test.setSuite(xmlSuite);
xmlSuite.addTest(test);
}
FileBase fileBase = new FileBase(this.suitePath, "sunshine-suite.xml");
FileBase fileBase = new FileBase(suitePath, "sunshine-suite.xml");
fileBase.write(xmlSuite.toXml());
return fileBase;
} catch (TestException | IOException e) {
Expand Down

0 comments on commit 23f2769

Please sign in to comment.