Search in sources :

Example 1 with JournalAbbreviationRepository

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());
}
Also used : Abbreviation(org.jabref.logic.journals.Abbreviation) JournalAbbreviationRepository(org.jabref.logic.journals.JournalAbbreviationRepository)

Example 2 with JournalAbbreviationRepository

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);
}
Also used : Abbreviation(org.jabref.logic.journals.Abbreviation) JournalAbbreviationRepository(org.jabref.logic.journals.JournalAbbreviationRepository)

Example 3 with JournalAbbreviationRepository

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);
}
Also used : Abbreviation(org.jabref.logic.journals.Abbreviation) BibEntry(org.jabref.model.entry.BibEntry) Defaults(org.jabref.model.Defaults) JournalAbbreviationRepository(org.jabref.logic.journals.JournalAbbreviationRepository) BibDatabase(org.jabref.model.database.BibDatabase) BibDatabaseContext(org.jabref.model.database.BibDatabaseContext) Test(org.junit.Test)

Aggregations

Abbreviation (org.jabref.logic.journals.Abbreviation)3 JournalAbbreviationRepository (org.jabref.logic.journals.JournalAbbreviationRepository)3 Defaults (org.jabref.model.Defaults)1 BibDatabase (org.jabref.model.database.BibDatabase)1 BibDatabaseContext (org.jabref.model.database.BibDatabaseContext)1 BibEntry (org.jabref.model.entry.BibEntry)1 Test (org.junit.Test)1