1package org.testng.internal; 2 3import org.testng.TestNGException; 4import org.testng.xml.ISuiteParser; 5import org.testng.xml.XmlSuite; 6 7import java.io.FileNotFoundException; 8import java.io.InputStream; 9 10public class YamlParser implements ISuiteParser { 11 12 @Override 13 public XmlSuite parse(String filePath, InputStream is, boolean loadClasses) 14 throws TestNGException { 15 try { 16 return Yaml.parse(filePath, is); 17 } catch (FileNotFoundException e) { 18 throw new TestNGException(e); 19 } 20 } 21 22 @Override 23 public boolean accept(String fileName) { 24 return fileName.endsWith(".yaml"); 25 } 26 27} 28