@Test
  public void testImportEntries() throws IOException {

    String bibFileName = fileName + ".bib";
    MsBibImporter testImporter = new MsBibImporter();
    List<BibEntry> result =
        testImporter.importDatabase(xmlFile, Charset.defaultCharset()).getDatabase().getEntries();
    BibEntryAssert.assertEquals(MsBibImporterTest.class, bibFileName, result);
  }
Пример #2
0
 private void doTest(String xmlName, int expectedSize, List<String> resourceNames)
     throws Exception {
   try (InputStream is = GvkParserTest.class.getResourceAsStream(xmlName)) {
     GvkParser parser = new GvkParser();
     List<BibEntry> entries = parser.parseEntries(is);
     Assert.assertNotNull(entries);
     Assert.assertEquals(expectedSize, entries.size());
     int i = 0;
     for (String resourceName : resourceNames) {
       BibEntryAssert.assertEquals(GvkParserTest.class, resourceName, entries.get(i));
       i++;
     }
   }
 }