use of org.jabref.logic.journals.JournalAbbreviationRepository in project jabref by JabRef.
the class IntegrityCheckTest method assertWrong.
private void assertWrong(BibDatabaseContext context) {
List<IntegrityMessage> messages = new IntegrityCheck(context, mock(FileDirectoryPreferences.class), createBibtexKeyPatternPreferences(), new JournalAbbreviationRepository(new Abbreviation("IEEE Software", "IEEE SW"))).checkBibtexDatabase();
assertFalse(messages.toString(), messages.isEmpty());
}
use of org.jabref.logic.journals.JournalAbbreviationRepository in project jabref by JabRef.
the class IntegrityCheckTest method assertCorrect.
private void assertCorrect(BibDatabaseContext context) {
List<IntegrityMessage> messages = new IntegrityCheck(context, mock(FileDirectoryPreferences.class), createBibtexKeyPatternPreferences(), new JournalAbbreviationRepository(new Abbreviation("IEEE Software", "IEEE SW"))).checkBibtexDatabase();
assertEquals(Collections.emptyList(), messages);
}
use of org.jabref.logic.journals.JournalAbbreviationRepository in project jabref by JabRef.
the class IntegrityCheckTest method testEntryIsUnchangedAfterChecks.
@Test
public void testEntryIsUnchangedAfterChecks() {
BibEntry entry = new BibEntry();
// populate with all known fields
for (String fieldName : InternalBibtexFields.getAllPublicAndInternalFieldNames()) {
entry.setField(fieldName, UUID.randomUUID().toString());
}
// add a random field
entry.setField(UUID.randomUUID().toString(), UUID.randomUUID().toString());
// duplicate entry
BibEntry clonedEntry = (BibEntry) entry.clone();
BibDatabase bibDatabase = new BibDatabase();
bibDatabase.insertEntry(entry);
BibDatabaseContext context = new BibDatabaseContext(bibDatabase, new Defaults());
new IntegrityCheck(context, mock(FileDirectoryPreferences.class), createBibtexKeyPatternPreferences(), new JournalAbbreviationRepository(new Abbreviation("IEEE Software", "IEEE SW"))).checkBibtexDatabase();
assertEquals(clonedEntry, entry);
}
Aggregations