org.testng.xml.XmlMethodSelectors Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of testng Show documentation
Show all versions of testng Show documentation
Testing framework for Java
package org.testng.xml;
import static org.testng.collections.CollectionUtils.hasElements;
import java.util.List;
import org.testng.collections.Lists;
import org.testng.reporters.XMLStringBuffer;
public class XmlMethodSelectors {
private List m_methodSelectors = Lists.newArrayList();
public XmlMethodSelectors() {}
public List getMethodSelectors() {
return m_methodSelectors;
}
public void setMethodSelector(XmlMethodSelector xms) {
m_methodSelectors.add(xms);
}
public String toXml(String indent) {
XMLStringBuffer xsb = new XMLStringBuffer(indent);
if (hasElements(m_methodSelectors)) {
xsb.push("method-selectors");
for (XmlMethodSelector selector : m_methodSelectors) {
xsb.getStringBuffer().append(selector.toXml(indent + " "));
}
xsb.pop("method-selectors");
}
return xsb.toXML();
}
}