@Test public void shouldUnmarshalSuiteFiles() throws Exception { TestSuiteResult first = new TestSuiteResult().withName("first"); TestSuiteResult second = new TestSuiteResult().withName("second"); File folder = this.folder.newFolder(); File firstFile = new File(folder, "first-testsuite.xml"); JAXB.marshal(first, firstFile); File secondFile = new File(folder, "second-testsuite.xml"); JAXB.marshal(second, secondFile); List<TestSuiteResult> suites = AllureFileUtils.unmarshalSuites(folder); assertThat(suites, hasSize(2)); assertThat(suites, containsInAnyOrder(first, second)); }
public static List<TestSuiteResult> unmarshalSuites(File... directories) throws IOException { List<TestSuiteResult> results = new ArrayList<>(); List<File> files = listTestSuiteFiles(directories); for (File file : files) { results.add(unmarshal(file)); } return results; }
AllureFileUtils { public static List<TestSuiteResult> unmarshalSuites(File... directories) throws IOException { List<TestSuiteResult> results = new ArrayList<>(); List<File> files = listTestSuiteFiles(directories); for (File file : files) { results.add(unmarshal(file)); } return results; } }
AllureFileUtils { public static List<TestSuiteResult> unmarshalSuites(File... directories) throws IOException { List<TestSuiteResult> results = new ArrayList<>(); List<File> files = listTestSuiteFiles(directories); for (File file : files) { results.add(unmarshal(file)); } return results; } AllureFileUtils(); }
AllureFileUtils { public static List<TestSuiteResult> unmarshalSuites(File... directories) throws IOException { List<TestSuiteResult> results = new ArrayList<>(); List<File> files = listTestSuiteFiles(directories); for (File file : files) { results.add(unmarshal(file)); } return results; } AllureFileUtils(); static TestSuiteResult unmarshal(File testSuite); static TestSuiteResult unmarshal(InputStream testSuite); static TestSuiteResult unmarshal(Reader testSuite); static List<TestSuiteResult> unmarshalSuites(File... directories); static List<File> listTestSuiteFiles(File... directories); static List<File> listAttachmentFiles(File... directories); static List<File> listFilesByRegex(String regex, File... directories); static List<File> listFiles(File[] directories, IOFileFilter fileFilter, IOFileFilter dirFilter); }
AllureFileUtils { public static List<TestSuiteResult> unmarshalSuites(File... directories) throws IOException { List<TestSuiteResult> results = new ArrayList<>(); List<File> files = listTestSuiteFiles(directories); for (File file : files) { results.add(unmarshal(file)); } return results; } AllureFileUtils(); static TestSuiteResult unmarshal(File testSuite); static TestSuiteResult unmarshal(InputStream testSuite); static TestSuiteResult unmarshal(Reader testSuite); static List<TestSuiteResult> unmarshalSuites(File... directories); static List<File> listTestSuiteFiles(File... directories); static List<File> listAttachmentFiles(File... directories); static List<File> listFilesByRegex(String regex, File... directories); static List<File> listFiles(File[] directories, IOFileFilter fileFilter, IOFileFilter dirFilter);  }