1 package org.testng.internal; 2 3 import org.testng.TestNGException; 4 import org.testng.xml.ISuiteParser; 5 import org.testng.xml.XmlSuite; 6 7 import java.io.FileNotFoundException; 8 import java.io.InputStream; 9 10 public class YamlParser implements ISuiteParser { 11 12 @Override parse(String filePath, InputStream is, boolean loadClasses)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 accept(String fileName)23 public boolean accept(String fileName) { 24 return fileName.endsWith(".yaml"); 25 } 26 27 } 28