From 8ea127754b474d51b393843b147268066369aa07 Mon Sep 17 00:00:00 2001 From: Stefan Kolb Date: Fri, 23 Aug 2019 22:59:14 +0200 Subject: [PATCH] refactor: reintroduce standard entry type --- src/main/java/org/jabref/gui/JabRefFrame.java | 4 +- .../gui/importer/ImportEntriesDialog.java | 4 +- .../logic/exporter/BibTeXMLExporter.java | 30 +++--- .../jabref/logic/importer/fetcher/ArXiv.java | 4 +- .../logic/importer/fetcher/CrossRef.java | 6 +- .../logic/importer/fetcher/DOAJFetcher.java | 4 +- .../jabref/logic/importer/fetcher/IEEE.java | 10 +- .../importer/fetcher/SpringerFetcher.java | 6 +- .../importer/fileformat/BibTeXMLImporter.java | 30 +++--- .../fileformat/BiblioscapeImporter.java | 24 ++--- .../importer/fileformat/CoinsParser.java | 6 +- .../importer/fileformat/CopacImporter.java | 4 +- .../importer/fileformat/EndnoteImporter.java | 28 ++--- .../fileformat/EndnoteXmlImporter.java | 16 +-- .../importer/fileformat/FreeCiteImporter.java | 8 +- .../logic/importer/fileformat/GvkParser.java | 16 +-- .../importer/fileformat/InspecImporter.java | 6 +- .../importer/fileformat/IsiImporter.java | 12 +-- .../importer/fileformat/MedlineImporter.java | 6 +- .../fileformat/MedlinePlainImporter.java | 16 +-- .../importer/fileformat/OvidImporter.java | 6 +- .../fileformat/PdfContentImporter.java | 6 +- .../importer/fileformat/RepecNepImporter.java | 4 +- .../importer/fileformat/RisImporter.java | 24 ++--- .../fileformat/SilverPlatterImporter.java | 12 +-- .../jabref/logic/integrity/TypeChecker.java | 4 +- .../jabref/logic/msbib/MSBibConverter.java | 10 +- .../org/jabref/logic/msbib/MSBibMapping.java | 49 +++++---- .../java/org/jabref/logic/util/TestEntry.java | 6 +- .../java/org/jabref/model/entry/BibEntry.java | 6 +- .../model/entry/BibEntryTypeBuilder.java | 4 +- .../types/BiblatexEntryTypeDefinitions.java | 60 +++++------ .../model/entry/types/BibtexEntryType.java | 45 -------- .../types/BibtexEntryTypeDefinitions.java | 28 ++--- .../model/entry/types/EntryTypeFactory.java | 2 +- ...xEntryType.java => StandardEntryType.java} | 8 +- .../AutoSetFileLinksUtilTest.java | 4 +- .../org/jabref/logic/TypedBibEntryTest.java | 8 +- .../logic/bibtex/BibEntryWriterTest.java | 14 +-- .../logic/bibtex/DuplicateCheckTest.java | 36 +++---- .../comparator/FieldComparatorTest.java | 16 +-- .../cleanup/BibtexBiblatexRoundtripTest.java | 6 +- .../cleanup/FieldFormatterCleanupTest.java | 4 +- .../exporter/BibtexDatabaseWriterTest.java | 24 ++--- .../logic/exporter/DocBook5ExporterTest.java | 4 +- .../exporter/FieldFormatterCleanupsTest.java | 4 +- .../fetcher/ACMPortalFetcherTest.java | 4 +- .../logic/importer/fetcher/ArXivTest.java | 6 +- .../fetcher/AstrophysicsDataSystemTest.java | 14 +-- .../logic/importer/fetcher/CiteSeerTest.java | 6 +- .../logic/importer/fetcher/CrossRefTest.java | 4 +- .../importer/fetcher/DBLPFetcherTest.java | 4 +- .../importer/fetcher/DOAJFetcherTest.java | 6 +- .../logic/importer/fetcher/DiVATest.java | 4 +- .../importer/fetcher/DoiFetcherTest.java | 6 +- .../importer/fetcher/GoogleScholarTest.java | 4 +- .../importer/fetcher/GvkFetcherTest.java | 6 +- .../logic/importer/fetcher/IEEETest.java | 6 +- .../importer/fetcher/INSPIREFetcherTest.java | 4 +- .../fetcher/IacrEprintFetcherTest.java | 8 +- .../importer/fetcher/IsbnFetcherTest.java | 4 +- .../fetcher/IsbnViaChimboriFetcherTest.java | 6 +- .../fetcher/IsbnViaEbookDeFetcherTest.java | 6 +- .../fetcher/IsbnViaOttoBibFetcherTest.java | 8 +- .../importer/fetcher/MathSciNetTest.java | 4 +- .../importer/fetcher/MedlineFetcherTest.java | 10 +- .../importer/fetcher/RfcFetcherTest.java | 4 +- .../importer/fetcher/SpringerFetcherTest.java | 4 +- .../importer/fetcher/TitleFetcherTest.java | 4 +- .../logic/importer/fetcher/ZbMATHTest.java | 4 +- .../fileformat/BibTeXMLImporterTestTypes.java | 28 ++--- .../BiblioscapeImporterTestTypes.java | 20 ++-- .../importer/fileformat/BibtexParserTest.java | 100 +++++++++--------- .../fileformat/EndnoteImporterTest.java | 16 +-- .../fileformat/InspecImporterTest.java | 8 +- .../importer/fileformat/IsiImporterTest.java | 18 ++-- .../fileformat/MedlinePlainImporterTest.java | 18 ++-- .../importer/fileformat/OvidImporterTest.java | 12 +-- .../fileformat/PdfContentImporterTest.java | 6 +- .../logic/integrity/IntegrityCheckTest.java | 14 +-- .../org/jabref/logic/layout/LayoutTest.java | 20 ++-- .../logic/openoffice/OOBibStyleTest.java | 24 ++--- .../logic/search/DatabaseSearcherTest.java | 12 +-- .../jabref/logic/search/SearchQueryTest.java | 20 ++-- .../logic/shared/DBMSProcessorTest.java | 6 +- .../logic/shared/DBMSSynchronizerTest.java | 6 +- .../shared/SynchronizationTestSimulator.java | 4 +- .../texparser/TexBibEntriesResolverTest.java | 14 +-- .../jabref/logic/texparser/TexParserTest.java | 14 +-- .../logic/util/BracketedPatternTest.java | 4 +- .../util/io/CiteKeyBasedFileFinderTest.java | 4 +- .../util/io/RegExpBasedFileFinderTests.java | 12 +-- .../jabref/logic/xmp/XmpUtilWriterTest.java | 8 +- .../jabref/model/BibEntryTypeFactoryTest.java | 4 +- .../BibDatabaseModeDetectionTest.java | 19 ++-- .../model/database/BibDatabaseTest.java | 6 +- .../org/jabref/model/entry/BibEntryTests.java | 16 +-- .../model/entry/CanonicalBibEntryTest.java | 6 +- .../rules/ContainBasedSearchRuleTest.java | 4 +- 99 files changed, 583 insertions(+), 630 deletions(-) delete mode 100644 src/main/java/org/jabref/model/entry/types/BibtexEntryType.java rename src/main/java/org/jabref/model/entry/types/{BiblatexEntryType.java => StandardEntryType.java} (86%) diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 6e6de5c9910..ba6c2a02b0d 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -123,7 +123,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.SpecialField; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.preferences.JabRefPreferences; import org.jabref.preferences.LastFocusedTabPreferences; @@ -526,7 +526,7 @@ private Node createToolbar() { pushToApplicationsManager.setToolBarButton(pushToApplicationButton); HBox rightSide = new HBox( - factory.createIconButton(StandardActions.NEW_ARTICLE, new NewEntryAction(this, BibtexEntryType.Article, dialogService, Globals.prefs, stateManager)), + factory.createIconButton(StandardActions.NEW_ARTICLE, new NewEntryAction(this, StandardEntryType.Article, dialogService, Globals.prefs, stateManager)), factory.createIconButton(StandardActions.DELETE_ENTRY, new OldDatabaseCommandWrapper(Actions.DELETE, this, stateManager)), new Separator(Orientation.VERTICAL), factory.createIconButton(StandardActions.UNDO, new OldDatabaseCommandWrapper(Actions.UNDO, this, stateManager)), diff --git a/src/main/java/org/jabref/gui/importer/ImportEntriesDialog.java b/src/main/java/org/jabref/gui/importer/ImportEntriesDialog.java index 3ffb5004989..59d7a6c29cf 100644 --- a/src/main/java/org/jabref/gui/importer/ImportEntriesDialog.java +++ b/src/main/java/org/jabref/gui/importer/ImportEntriesDialog.java @@ -35,8 +35,8 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; @@ -156,7 +156,7 @@ private Node getEntryNode(BibEntry entry) { } private IconTheme.JabRefIcons getIcon(EntryType type) { - if (BibtexEntryType.Book.equals(type)) { + if (StandardEntryType.Book.equals(type)) { return IconTheme.JabRefIcons.BOOK; } return IconTheme.JabRefIcons.ARTICLE; diff --git a/src/main/java/org/jabref/logic/exporter/BibTeXMLExporter.java b/src/main/java/org/jabref/logic/exporter/BibTeXMLExporter.java index edecfa64ac2..2c0100b5f12 100644 --- a/src/main/java/org/jabref/logic/exporter/BibTeXMLExporter.java +++ b/src/main/java/org/jabref/logic/exporter/BibTeXMLExporter.java @@ -42,8 +42,8 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -78,33 +78,33 @@ public void export(final BibDatabaseContext databaseContext, final Path resultFi bibEntry.getCiteKeyOptional().ifPresent(entry::setId); EntryType i = bibEntry.getType(); - if (BibtexEntryType.Article.equals(i)) { + if (StandardEntryType.Article.equals(i)) { parse(new Article(), bibEntry, entry); - } else if (BibtexEntryType.Book.equals(i)) { + } else if (StandardEntryType.Book.equals(i)) { parse(new Book(), bibEntry, entry); - } else if (BibtexEntryType.Booklet.equals(i)) { + } else if (StandardEntryType.Booklet.equals(i)) { parse(new Booklet(), bibEntry, entry); - } else if (BibtexEntryType.Conference.equals(i)) { + } else if (StandardEntryType.Conference.equals(i)) { parse(new Conference(), bibEntry, entry); - } else if (BibtexEntryType.InBook.equals(i)) { + } else if (StandardEntryType.InBook.equals(i)) { parseInbook(new Inbook(), bibEntry, entry); - } else if (BibtexEntryType.InCollection.equals(i)) { + } else if (StandardEntryType.InCollection.equals(i)) { parse(new Incollection(), bibEntry, entry); - } else if (BibtexEntryType.InProceedings.equals(i)) { + } else if (StandardEntryType.InProceedings.equals(i)) { parse(new Inproceedings(), bibEntry, entry); - } else if (BibtexEntryType.MastersThesis.equals(i)) { + } else if (StandardEntryType.MastersThesis.equals(i)) { parse(new Mastersthesis(), bibEntry, entry); - } else if (BibtexEntryType.Manual.equals(i)) { + } else if (StandardEntryType.Manual.equals(i)) { parse(new Manual(), bibEntry, entry); - } else if (BibtexEntryType.Misc.equals(i)) { + } else if (StandardEntryType.Misc.equals(i)) { parse(new Misc(), bibEntry, entry); - } else if (BibtexEntryType.PhdThesis.equals(i)) { + } else if (StandardEntryType.PhdThesis.equals(i)) { parse(new Phdthesis(), bibEntry, entry); - } else if (BibtexEntryType.Proceedings.equals(i)) { + } else if (StandardEntryType.Proceedings.equals(i)) { parse(new Proceedings(), bibEntry, entry); - } else if (BibtexEntryType.TechReport.equals(i)) { + } else if (StandardEntryType.TechReport.equals(i)) { parse(new Techreport(), bibEntry, entry); - } else if (BibtexEntryType.Unpublished.equals(i)) { + } else if (StandardEntryType.Unpublished.equals(i)) { parse(new Unpublished(), bibEntry, entry); } else { LOGGER.warn("unexpected type appeared"); diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ArXiv.java b/src/main/java/org/jabref/logic/importer/fetcher/ArXiv.java index 153a5024258..9dc7da1acf0 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/ArXiv.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/ArXiv.java @@ -32,7 +32,7 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.ArXivIdentifier; import org.jabref.model.entry.identifier.DOI; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; import org.jabref.model.util.OptionalUtil; @@ -405,7 +405,7 @@ public Optional getDate() { } public BibEntry toBibEntry(Character keywordDelimiter) { - BibEntry bibEntry = new BibEntry(BibtexEntryType.Article); + BibEntry bibEntry = new BibEntry(StandardEntryType.Article); bibEntry.setField(StandardField.EPRINTTYPE, "arXiv"); bibEntry.setField(StandardField.AUTHOR, String.join(" and ", authorNames)); bibEntry.addKeywords(categories, keywordDelimiter); diff --git a/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java b/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java index 2eae636e542..38452bbeab5 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java @@ -23,8 +23,8 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.DOI; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.util.OptionalUtil; import org.apache.http.client.utils.URIBuilder; @@ -156,9 +156,9 @@ private String toAuthors(JSONArray authors) { private EntryType convertType(String type) { switch (type) { case "journal-article": - return BibtexEntryType.Article; + return StandardEntryType.Article; default: - return BibtexEntryType.Misc; + return StandardEntryType.Misc; } } diff --git a/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java index 57852117a6b..074c47cff62 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java @@ -20,7 +20,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; import org.apache.http.client.utils.URIBuilder; @@ -58,7 +58,7 @@ public static BibEntry parseBibJSONtoBibtex(JSONObject bibJsonEntry, Character k // Fields that are accessible in the journal part of the BibJson object Field[] journalSingleFields = {StandardField.PUBLISHER, StandardField.NUMBER, StandardField.VOLUME}; - BibEntry entry = new BibEntry(BibtexEntryType.Article); + BibEntry entry = new BibEntry(StandardEntryType.Article); // Authors if (bibJsonEntry.has("author")) { diff --git a/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java b/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java index 388686a973e..79b03b83d71 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java @@ -26,7 +26,7 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.DOI; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.apache.http.client.utils.URIBuilder; import org.json.JSONArray; @@ -66,16 +66,16 @@ private static BibEntry parseJsonRespone(JSONObject jsonEntry, Character keyword switch (jsonEntry.optString("content_type")) { case "Books": - entry.setType(BibtexEntryType.Book); + entry.setType(StandardEntryType.Book); break; case "Conferences": - entry.setType(BibtexEntryType.InProceedings); + entry.setType(StandardEntryType.InProceedings); break; case "Courses": - entry.setType(BibtexEntryType.Misc); + entry.setType(StandardEntryType.Misc); break; default: - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); break; } diff --git a/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java index 92940186f5d..fd38b2e61b1 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java @@ -20,7 +20,7 @@ import org.jabref.model.entry.Month; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.apache.http.client.utils.URIBuilder; import org.json.JSONArray; @@ -58,11 +58,11 @@ public static BibEntry parseSpringerJSONtoBibtex(JSONObject springerJsonEntry) { String isbn = springerJsonEntry.optString("isbn"); if (com.google.common.base.Strings.isNullOrEmpty(isbn)) { // Probably article - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); nametype = StandardField.JOURNAL; } else { // Probably book chapter or from proceeding, go for book chapter - entry.setType(BibtexEntryType.InCollection); + entry.setType(StandardEntryType.InCollection); nametype = StandardField.BOOKTITLE; entry.setField(StandardField.ISBN, isbn); } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/BibTeXMLImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/BibTeXMLImporter.java index 0381e28b3b1..7465b5c3a8c 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/BibTeXMLImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/BibTeXMLImporter.java @@ -30,7 +30,7 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -94,50 +94,50 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { for (Entry entry : entries) { BibEntry bibEntry = new BibEntry(); if (entry.getArticle() != null) { - bibEntry.setType(BibtexEntryType.Article); + bibEntry.setType(StandardEntryType.Article); parse(entry.getArticle(), fields); } else if (entry.getBook() != null) { - bibEntry.setType(BibtexEntryType.Book); + bibEntry.setType(StandardEntryType.Book); parse(entry.getBook(), fields); } else if (entry.getBooklet() != null) { - bibEntry.setType(BibtexEntryType.Booklet); + bibEntry.setType(StandardEntryType.Booklet); parse(entry.getBooklet(), fields); } else if (entry.getConference() != null) { - bibEntry.setType(BibtexEntryType.Conference); + bibEntry.setType(StandardEntryType.Conference); parse(entry.getConference(), fields); } else if (entry.getInbook() != null) { - bibEntry.setType(BibtexEntryType.InBook); + bibEntry.setType(StandardEntryType.InBook); parseInbook(entry.getInbook(), fields); } else if (entry.getIncollection() != null) { - bibEntry.setType(BibtexEntryType.InCollection); + bibEntry.setType(StandardEntryType.InCollection); Incollection incollection = entry.getIncollection(); if (incollection.getChapter() != null) { fields.put(StandardField.CHAPTER, String.valueOf(incollection.getChapter())); } parse(incollection, fields); } else if (entry.getInproceedings() != null) { - bibEntry.setType(BibtexEntryType.InProceedings); + bibEntry.setType(StandardEntryType.InProceedings); parse(entry.getInproceedings(), fields); } else if (entry.getManual() != null) { - bibEntry.setType(BibtexEntryType.Manual); + bibEntry.setType(StandardEntryType.Manual); parse(entry.getManual(), fields); } else if (entry.getMastersthesis() != null) { - bibEntry.setType(BibtexEntryType.MastersThesis); + bibEntry.setType(StandardEntryType.MastersThesis); parse(entry.getMastersthesis(), fields); } else if (entry.getMisc() != null) { - bibEntry.setType(BibtexEntryType.Misc); + bibEntry.setType(StandardEntryType.Misc); parse(entry.getMisc(), fields); } else if (entry.getPhdthesis() != null) { - bibEntry.setType(BibtexEntryType.PhdThesis); + bibEntry.setType(StandardEntryType.PhdThesis); parse(entry.getPhdthesis(), fields); } else if (entry.getProceedings() != null) { - bibEntry.setType(BibtexEntryType.Proceedings); + bibEntry.setType(StandardEntryType.Proceedings); parse(entry.getProceedings(), fields); } else if (entry.getTechreport() != null) { - bibEntry.setType(BibtexEntryType.TechReport); + bibEntry.setType(StandardEntryType.TechReport); parse(entry.getTechreport(), fields); } else if (entry.getUnpublished() != null) { - bibEntry.setType(BibtexEntryType.Unpublished); + bibEntry.setType(StandardEntryType.Unpublished); parse(entry.getUnpublished(), fields); } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java index 3cd0beb0a93..9fc35b6bb43 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java @@ -15,8 +15,8 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; /** * Imports a Biblioscape Tag File. The format is described on @@ -196,37 +196,37 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { } type[i] = type[i].toLowerCase(Locale.ROOT); if (type[i].contains("article")) { - bibtexType = BibtexEntryType.Article; + bibtexType = StandardEntryType.Article; } else if (type[i].contains("journal")) { - bibtexType = BibtexEntryType.Article; + bibtexType = StandardEntryType.Article; } else if (type[i].contains("book section")) { - bibtexType = BibtexEntryType.InBook; + bibtexType = StandardEntryType.InBook; } else if (type[i].contains("book")) { - bibtexType = BibtexEntryType.Book; + bibtexType = StandardEntryType.Book; } else if (type[i].contains("conference")) { - bibtexType = BibtexEntryType.InProceedings; + bibtexType = StandardEntryType.InProceedings; } else if (type[i].contains("proceedings")) { - bibtexType = BibtexEntryType.InProceedings; + bibtexType = StandardEntryType.InProceedings; } else if (type[i].contains("report")) { - bibtexType = BibtexEntryType.TechReport; + bibtexType = StandardEntryType.TechReport; } else if (type[i].contains("thesis") && type[i].contains("master")) { - bibtexType = BibtexEntryType.MastersThesis; + bibtexType = StandardEntryType.MastersThesis; } else if (type[i].contains("thesis")) { - bibtexType = BibtexEntryType.PhdThesis; + bibtexType = StandardEntryType.PhdThesis; } } // depending on bibtexType, decide where to place the titleRT and // titleTI - if (bibtexType.equals(BibtexEntryType.Article)) { + if (bibtexType.equals(StandardEntryType.Article)) { if (titleST != null) { hm.put(StandardField.JOURNAL, titleST); } if (titleTI != null) { hm.put(StandardField.TITLE, titleTI); } - } else if (bibtexType.equals(BibtexEntryType.InBook)) { + } else if (bibtexType.equals(StandardEntryType.InBook)) { if (titleST != null) { hm.put(StandardField.BOOKTITLE, titleST); } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/CoinsParser.java b/src/main/java/org/jabref/logic/importer/fileformat/CoinsParser.java index 4b040c4752e..9763529fb85 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/CoinsParser.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/CoinsParser.java @@ -16,7 +16,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; /** * @implNote implemented by reverse-engineering the implementation by CiteSeerX @@ -50,11 +50,11 @@ public List parseEntries(InputStream inputStream) throws ParseExceptio if (matcherType.find()) { switch (matcherType.group(1)) { case "article": - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); break; case "unknown": default: - entry.setType(BibtexEntryType.Misc); + entry.setType(StandardEntryType.Misc); break; } } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java index 54194c60097..1cd2e5d54c9 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java @@ -15,7 +15,7 @@ import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; /** * Importer for COPAC format. @@ -110,7 +110,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { // Copac does not contain enough information on the type of the // document. A book is assumed. - BibEntry b = new BibEntry(BibtexEntryType.Book); + BibEntry b = new BibEntry(StandardEntryType.Book); String[] lines = entry.split("\n"); diff --git a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java index e3291012c34..f306a5e307a 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java @@ -18,8 +18,8 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; /** * Importer for the Refer/Endnote format. @@ -149,22 +149,22 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { hm.put(StandardField.TITLE, val); } else if ("0".equals(prefix)) { if (val.indexOf("Journal") == 0) { - type = BibtexEntryType.Article; + type = StandardEntryType.Article; } else if (val.indexOf("Book Section") == 0) { - type = BibtexEntryType.InCollection; + type = StandardEntryType.InCollection; } else if (val.indexOf("Book") == 0) { - type = BibtexEntryType.Book; + type = StandardEntryType.Book; } else if (val.indexOf("Edited Book") == 0) { - type = BibtexEntryType.Book; + type = StandardEntryType.Book; isEditedBook = true; } else if (val.indexOf("Conference") == 0) { - type = BibtexEntryType.InProceedings; + type = StandardEntryType.InProceedings; } else if (val.indexOf("Report") == 0) { - type = BibtexEntryType.TechReport; + type = StandardEntryType.TechReport; } else if (val.indexOf("Review") == 0) { - type = BibtexEntryType.Article; + type = StandardEntryType.Article; } else if (val.indexOf("Thesis") == 0) { - type = BibtexEntryType.PhdThesis; + type = StandardEntryType.PhdThesis; } else { type = BibEntry.DEFAULT_TYPE; // } @@ -183,16 +183,16 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { } else if ("B".equals(prefix)) { // This prefix stands for "journal" in a journal entry, and // "series" in a book entry. - if (type.equals(BibtexEntryType.Article)) { + if (type.equals(StandardEntryType.Article)) { hm.put(StandardField.JOURNAL, val); - } else if (type.equals(BibtexEntryType.Book) || type.equals(BibtexEntryType.InBook)) { + } else if (type.equals(StandardEntryType.Book) || type.equals(StandardEntryType.InBook)) { hm.put(StandardField.SERIES, val); } else { /* type = inproceedings */ hm.put(StandardField.BOOKTITLE, val); } } else if ("I".equals(prefix)) { - if (type.equals(BibtexEntryType.PhdThesis)) { + if (type.equals(StandardEntryType.PhdThesis)) { hm.put(StandardField.SCHOOL, val); } else { hm.put(StandardField.PUBLISHER, val); @@ -227,10 +227,10 @@ else if ("P".equals(prefix)) { hm.put(StandardField.ABSTRACT, val); } else if ("9".equals(prefix)) { if (val.indexOf("Ph.D.") == 0) { - type = BibtexEntryType.PhdThesis; + type = StandardEntryType.PhdThesis; } if (val.indexOf("Masters") == 0) { - type = BibtexEntryType.MastersThesis; + type = StandardEntryType.MastersThesis; } } else if ("F".equals(prefix)) { hm.put(InternalField.KEY_FIELD, BibtexKeyGenerator.cleanKey(val, diff --git a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java index fdd92df81c2..9268a519630 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java @@ -51,9 +51,9 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.IEEETranEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; import org.jabref.model.util.OptionalUtil; @@ -160,20 +160,20 @@ private void initUnmarshaller() throws JAXBException { private static EntryType convertRefNameToType(String refName) { switch (refName.toLowerCase().trim()) { case "artwork": - return BibtexEntryType.Misc; + return StandardEntryType.Misc; case "generic": - return BibtexEntryType.Misc; + return StandardEntryType.Misc; case "electronic article": return IEEETranEntryType.Electronic; case "book section": - return BibtexEntryType.InBook; + return StandardEntryType.InBook; case "book": - return BibtexEntryType.Book; + return StandardEntryType.Book; case "journal article": - return BibtexEntryType.Article; + return StandardEntryType.Article; default: - return BibtexEntryType.Article; + return StandardEntryType.Article; } } @@ -238,7 +238,7 @@ private EntryType getType(Record record) { return Optional.ofNullable(record.getRefType()) .map(RefType::getName) .map(EndnoteXmlImporter::convertRefNameToType) - .orElse(BibtexEntryType.Article); + .orElse(StandardEntryType.Article); } private List getLinkedFiles(Record record) { diff --git a/src/main/java/org/jabref/logic/importer/fileformat/FreeCiteImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/FreeCiteImporter.java index d481c45be96..6a7c80ffedd 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/FreeCiteImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/FreeCiteImporter.java @@ -30,8 +30,8 @@ import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -119,7 +119,7 @@ public ParserResult importEntries(String text) { BibEntry e = new BibEntry(); // fallback type - EntryType type = BibtexEntryType.InProceedings; + EntryType type = StandardEntryType.InProceedings; while (!((parser.getEventType() == XMLStreamConstants.END_ELEMENT) && "citation".equals(parser.getLocalName()))) { @@ -154,10 +154,10 @@ public ParserResult importEntries(String text) { // ctx:context-objects / ctx:context-object / ctx:referent / ctx:metadata-by-val / ctx:metadata / journal / rft:genre // the drawback is that ctx:context-objects is NOT nested in citation, but a separate element // we would have to change the whole parser to parse that format. - type = BibtexEntryType.Article; + type = StandardEntryType.Article; e.setField(field, parser.getElementText()); } else if (new UnknownField("tech").equals(field)) { - type = BibtexEntryType.TechReport; + type = StandardEntryType.TechReport; // the content of the "tech" field seems to contain the number of the technical report e.setField(StandardField.NUMBER, parser.getElementText()); } else if (StandardField.DOI.equals(field) || StandardField.INSTITUTION.equals(field) diff --git a/src/main/java/org/jabref/logic/importer/fileformat/GvkParser.java b/src/main/java/org/jabref/logic/importer/fileformat/GvkParser.java index 9cd10438a8a..29c24e20f4d 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/GvkParser.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/GvkParser.java @@ -14,8 +14,8 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; import com.google.common.base.Strings; import org.slf4j.Logger; @@ -94,7 +94,7 @@ private BibEntry parseEntry(Element e) { String mak = ""; String subtitle = ""; - EntryType entryType = BibtexEntryType.Book; // Default + EntryType entryType = StandardEntryType.Book; // Default // Alle relevanten Informationen einsammeln @@ -248,7 +248,7 @@ private BibEntry parseEntry(Element e) { String st = getSubfield("a", datafield); if ((st != null) && st.contains("Diss")) { - entryType = BibtexEntryType.PhdThesis; + entryType = StandardEntryType.PhdThesis; } } @@ -289,12 +289,12 @@ private BibEntry parseEntry(Element e) { subtitle = getSubfield("a", datafield); } - entryType = BibtexEntryType.Proceedings; + entryType = StandardEntryType.Proceedings; } // Wenn eine Verlagsdiss vorliegt - if (entryType.equals(BibtexEntryType.PhdThesis) && (isbn != null)) { - entryType = BibtexEntryType.Book; + if (entryType.equals(StandardEntryType.PhdThesis) && (isbn != null)) { + entryType = StandardEntryType.Book; } //Hilfskategorien zur Entscheidung @article @@ -343,10 +343,10 @@ private BibEntry parseEntry(Element e) { entryType = BibEntry.DEFAULT_TYPE; if (quelle.contains("ISBN")) { - entryType = BibtexEntryType.InCollection; + entryType = StandardEntryType.InCollection; } if (quelle.contains("ZDB-ID")) { - entryType = BibtexEntryType.Article; + entryType = StandardEntryType.Article; } } else if (mak.isEmpty()) { entryType = BibEntry.DEFAULT_TYPE; diff --git a/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java index 75810483e38..c0979e335f6 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java @@ -15,9 +15,9 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.EntryTypeFactory; +import org.jabref.model.entry.types.StandardEntryType; /** * INSPEC format importer. @@ -116,9 +116,9 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { } else if ("RT".equals(f3)) { frest = frest.trim(); if ("Journal-Paper".equals(frest)) { - type = BibtexEntryType.Article; + type = StandardEntryType.Article; } else if ("Conference-Paper".equals(frest) || "Conference-Paper; Journal-Paper".equals(frest)) { - type = BibtexEntryType.InProceedings; + type = StandardEntryType.InProceedings; } else { type = EntryTypeFactory.parse(frest.replace(" ", "")); } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java index c2ea4112cc7..d9ed2e873f3 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java @@ -22,8 +22,8 @@ import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; /** * Importer for the ISI Web of Science, INSPEC and Medline format. @@ -210,12 +210,12 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { } else { PT = value; } - type = BibtexEntryType.Article; // make all of them PT? + type = StandardEntryType.Article; // make all of them PT? } else if ("TY".equals(beg)) { if ("JOUR".equals(value)) { - type = BibtexEntryType.Article; + type = StandardEntryType.Article; } else if ("CONF".equals(value)) { - type = BibtexEntryType.InProceedings; + type = StandardEntryType.InProceedings; } } else if ("JO".equals(beg)) { hm.put(StandardField.BOOKTITLE, value); @@ -279,9 +279,9 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { } else if ("DT".equals(beg)) { if ("Review".equals(value)) { - type = BibtexEntryType.Article; // set "Review" in Note/Comment? + type = StandardEntryType.Article; // set "Review" in Note/Comment? } else if (value.startsWith("Article") || value.startsWith("Journal") || "article".equals(PT)) { - type = BibtexEntryType.Article; + type = StandardEntryType.Article; } else { type = BibEntry.DEFAULT_TYPE; } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java index de7f785de02..bc8feb039f0 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java @@ -79,7 +79,7 @@ import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; import com.google.common.base.Joiner; @@ -267,7 +267,7 @@ private void parseBookArticle(PubmedBookArticle currentArticle, List b putIfValueNotNull(fields, StandardField.PUBSTATE, bookData.getPublicationStatus()); } - BibEntry entry = new BibEntry(BibtexEntryType.Article); + BibEntry entry = new BibEntry(StandardEntryType.Article); entry.setField(fields); bibItems.add(entry); @@ -414,7 +414,7 @@ private void parseArticle(PubmedArticle article, List bibItems) { } } - BibEntry entry = new BibEntry(BibtexEntryType.Article); + BibEntry entry = new BibEntry(StandardEntryType.Article); entry.setField(fields); bibItems.add(entry); diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java index 6109ab76747..4e911b1e8b2 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java @@ -19,8 +19,8 @@ import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; /** * Importer for the MEDLINE Plain format. @@ -230,24 +230,24 @@ private EntryType addSourceType(String value, EntryType type) { String val = value.toLowerCase(Locale.ENGLISH); switch (val) { case "book": - return BibtexEntryType.Book; + return StandardEntryType.Book; case "journal article": case "classical article": case "corrected and republished article": case "historical article": case "introductory journal article": case "newspaper article": - return BibtexEntryType.Article; + return StandardEntryType.Article; case "clinical conference": case "consensus development conference": case "consensus development conference, nih": - return BibtexEntryType.Conference; + return StandardEntryType.Conference; case "technical report": - return BibtexEntryType.TechReport; + return StandardEntryType.TechReport; case "editorial": - return BibtexEntryType.InProceedings; + return StandardEntryType.InProceedings; case "overall": - return BibtexEntryType.Proceedings; + return StandardEntryType.Proceedings; default: return type; } @@ -323,7 +323,7 @@ private void addTitles(Map hm, String lab, String val, EntryType } else if ("BTI".equals(lab) || "CTI".equals(lab)) { hm.put(StandardField.BOOKTITLE, val); } else if ("JT".equals(lab)) { - if (type.equals(BibtexEntryType.InProceedings)) { + if (type.equals(StandardEntryType.InProceedings)) { hm.put(StandardField.BOOKTITLE, val); } else { hm.put(StandardField.JOURNAL, val); diff --git a/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java index ec9936ef3b3..791f40439a6 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java @@ -18,9 +18,9 @@ import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.EntryTypeFactory; +import org.jabref.model.entry.types.StandardEntryType; /** * Imports an Ovid file. @@ -207,9 +207,9 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { // Set the entrytype properly: EntryType entryType = h.containsKey(InternalField.TYPE_HEADER) ? EntryTypeFactory.parse(h.get(InternalField.TYPE_HEADER)) : BibEntry.DEFAULT_TYPE; h.remove(InternalField.TYPE_HEADER); - if (entryType.equals(BibtexEntryType.Book) && h.containsKey(new UnknownField("chaptertitle"))) { + if (entryType.equals(StandardEntryType.Book) && h.containsKey(new UnknownField("chaptertitle"))) { // This means we have an "incollection" entry. - entryType = BibtexEntryType.InCollection; + entryType = StandardEntryType.InCollection; // Move the "chaptertitle" to just "title": h.put(StandardField.TITLE, h.remove(new UnknownField("chaptertitle"))); } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java index 318b38df32f..79060c67918 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java @@ -26,8 +26,8 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.DOI; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; import com.google.common.base.Strings; @@ -276,7 +276,7 @@ Optional getEntryFromPDFContent(String firstpageContents, String lineS // year is a class variable as the method extractYear() uses it; String publisher = null; - EntryType type = BibtexEntryType.InProceedings; + EntryType type = StandardEntryType.InProceedings; if (curString.length() > 4) { // special case: possibly conference as first line on the page extractYear(); @@ -356,7 +356,7 @@ Optional getEntryFromPDFContent(String firstpageContents, String lineS int pos = lower.indexOf("technical"); if (pos >= 0) { - type = BibtexEntryType.TechReport; + type = StandardEntryType.TechReport; pos = curString.trim().lastIndexOf(' '); if (pos >= 0) { // assumption: last character of curString is NOT ' ' diff --git a/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java index 172f656d4a8..c330a465c6b 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java @@ -16,7 +16,7 @@ import org.jabref.model.entry.Date; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -388,7 +388,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { this.inOverviewSection = this.preLine.startsWith("In this issue we have"); } if (isStartOfWorkingPaper()) { - BibEntry be = new BibEntry(BibtexEntryType.TechReport); + BibEntry be = new BibEntry(StandardEntryType.TechReport); paperNoStr = this.lastLine.substring(0, this.lastLine.indexOf('.')); parseTitleString(be, reader); if (startsWithKeyword(RepecNepImporter.RECOGNIZED_FIELDS)) { diff --git a/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java index 81f8f523568..5c941f75fcb 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java @@ -24,9 +24,9 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.IEEETranEntryType; +import org.jabref.model.entry.types.StandardEntryType; public class RisImporter extends Importer { @@ -74,7 +74,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { int datePriority = dateTags.size(); int tagPriority; - EntryType type = BibtexEntryType.Misc; + EntryType type = StandardEntryType.Misc; String author = ""; String editor = ""; String startPage = ""; @@ -108,23 +108,23 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { String value = entry.substring(6).trim(); if ("TY".equals(tag)) { if ("BOOK".equals(value)) { - type = BibtexEntryType.Book; + type = StandardEntryType.Book; } else if ("JOUR".equals(value) || "MGZN".equals(value)) { - type = BibtexEntryType.Article; + type = StandardEntryType.Article; } else if ("THES".equals(value)) { - type = BibtexEntryType.PhdThesis; + type = StandardEntryType.PhdThesis; } else if ("UNPB".equals(value)) { - type = BibtexEntryType.Unpublished; + type = StandardEntryType.Unpublished; } else if ("RPRT".equals(value)) { - type = BibtexEntryType.TechReport; + type = StandardEntryType.TechReport; } else if ("CONF".equals(value)) { - type = BibtexEntryType.InProceedings; + type = StandardEntryType.InProceedings; } else if ("CHAP".equals(value)) { - type = BibtexEntryType.InCollection; + type = StandardEntryType.InCollection; } else if ("PAT".equals(value)) { type = IEEETranEntryType.Patent; } else { - type = BibtexEntryType.Misc; + type = StandardEntryType.Misc; } } else if ("T1".equals(tag) || "TI".equals(tag)) { String oldVal = fields.get(StandardField.TITLE); @@ -161,7 +161,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { editor += " and " + value; } } else if ("JA".equals(tag) || "JF".equals(tag)) { - if (type.equals(BibtexEntryType.InProceedings)) { + if (type.equals(StandardEntryType.InProceedings)) { fields.put(StandardField.BOOKTITLE, value); } else { fields.put(StandardField.JOURNAL, value); @@ -177,7 +177,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { } else if ("SP".equals(tag)) { startPage = value; } else if ("PB".equals(tag)) { - if (type.equals(BibtexEntryType.PhdThesis)) { + if (type.equals(StandardEntryType.PhdThesis)) { fields.put(StandardField.SCHOOL, value); } else { fields.put(StandardField.PUBLISHER, value); diff --git a/src/main/java/org/jabref/logic/importer/fileformat/SilverPlatterImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/SilverPlatterImporter.java index 6ef703bbd02..e7c6f9b9516 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/SilverPlatterImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/SilverPlatterImporter.java @@ -16,9 +16,9 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.EntryTypeFactory; +import org.jabref.model.entry.types.StandardEntryType; /** * Imports a SilverPlatter exported file. This is a poor format to parse, @@ -77,7 +77,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { } } String[] entries = sb.toString().split("__::__"); - EntryType type = BibtexEntryType.Misc; + EntryType type = StandardEntryType.Misc; Map h = new HashMap<>(); for (String entry : entries) { if (entry.trim().length() < 6) { @@ -156,13 +156,13 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { } else if ("DT".equals(f3)) { frest = frest.trim(); if ("Monograph".equals(frest)) { - type = BibtexEntryType.Book; + type = StandardEntryType.Book; } else if (frest.startsWith("Dissertation")) { - type = BibtexEntryType.PhdThesis; + type = StandardEntryType.PhdThesis; } else if (frest.toLowerCase(Locale.ROOT).contains(StandardField.JOURNAL.getName())) { - type = BibtexEntryType.Article; + type = StandardEntryType.Article; } else if ("Contribution".equals(frest) || "Chapter".equals(frest)) { - type = BibtexEntryType.InCollection; + type = StandardEntryType.InCollection; // This entry type contains page numbers and booktitle in the // title field. isChapter = true; diff --git a/src/main/java/org/jabref/logic/integrity/TypeChecker.java b/src/main/java/org/jabref/logic/integrity/TypeChecker.java index 407696278ee..51e899f366c 100644 --- a/src/main/java/org/jabref/logic/integrity/TypeChecker.java +++ b/src/main/java/org/jabref/logic/integrity/TypeChecker.java @@ -8,7 +8,7 @@ import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; public class TypeChecker implements Checker { @@ -19,7 +19,7 @@ public List check(BibEntry entry) { return Collections.emptyList(); } - if (BibtexEntryType.Proceedings.equals(entry.getType())) { + if (StandardEntryType.Proceedings.equals(entry.getType())) { return Collections.singletonList(new IntegrityMessage( Localization.lang("wrong entry type as proceedings has page numbers"), entry, StandardField.PAGES)); } diff --git a/src/main/java/org/jabref/logic/msbib/MSBibConverter.java b/src/main/java/org/jabref/logic/msbib/MSBibConverter.java index fef57cd2278..de99ce6d919 100644 --- a/src/main/java/org/jabref/logic/msbib/MSBibConverter.java +++ b/src/main/java/org/jabref/logic/msbib/MSBibConverter.java @@ -10,8 +10,8 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.IEEETranEntryType; +import org.jabref.model.entry.types.StandardEntryType; public class MSBibConverter { @@ -89,13 +89,13 @@ public static MSBibEntry convert(BibEntry entry) { result.thesisType = entry.getLatexFreeField(StandardField.TYPE).get(); } else { - if (entry.getType().equals(BibtexEntryType.TechReport)) { + if (entry.getType().equals(StandardEntryType.TechReport)) { result.thesisType = "Tech. rep."; - } else if (entry.getType().equals(BibtexEntryType.MastersThesis)) { + } else if (entry.getType().equals(StandardEntryType.MastersThesis)) { result.thesisType = "Master's thesis"; - } else if (entry.getType().equals(BibtexEntryType.PhdThesis)) { + } else if (entry.getType().equals(StandardEntryType.PhdThesis)) { result.thesisType = "Ph.D. dissertation"; - } else if (entry.getType().equals(BibtexEntryType.Unpublished)) { + } else if (entry.getType().equals(StandardEntryType.Unpublished)) { result.thesisType = "unpublished"; } } diff --git a/src/main/java/org/jabref/logic/msbib/MSBibMapping.java b/src/main/java/org/jabref/logic/msbib/MSBibMapping.java index 386dde0bde4..4f4fe16a7de 100644 --- a/src/main/java/org/jabref/logic/msbib/MSBibMapping.java +++ b/src/main/java/org/jabref/logic/msbib/MSBibMapping.java @@ -7,10 +7,9 @@ import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BiblatexEntryType; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.IEEETranEntryType; +import org.jabref.model.entry.types.StandardEntryType; import com.google.common.collect.HashBiMap; @@ -86,39 +85,39 @@ private MSBibMapping() { public static EntryType getBiblatexEntryType(String msbibType) { Map entryTypeMapping = new HashMap<>(); - entryTypeMapping.put("Book", BibtexEntryType.Book); - entryTypeMapping.put("BookSection", BibtexEntryType.Book); - entryTypeMapping.put("JournalArticle", BibtexEntryType.Article); + entryTypeMapping.put("Book", StandardEntryType.Book); + entryTypeMapping.put("BookSection", StandardEntryType.Book); + entryTypeMapping.put("JournalArticle", StandardEntryType.Article); entryTypeMapping.put("ArticleInAPeriodical", IEEETranEntryType.Periodical); - entryTypeMapping.put("ConferenceProceedings", BibtexEntryType.InProceedings); - entryTypeMapping.put("Report", BibtexEntryType.TechReport); + entryTypeMapping.put("ConferenceProceedings", StandardEntryType.InProceedings); + entryTypeMapping.put("Report", StandardEntryType.TechReport); entryTypeMapping.put("Patent", IEEETranEntryType.Patent); - entryTypeMapping.put("InternetSite", BiblatexEntryType.Online); + entryTypeMapping.put("InternetSite", StandardEntryType.Online); - return entryTypeMapping.getOrDefault(msbibType, BibtexEntryType.Misc); + return entryTypeMapping.getOrDefault(msbibType, StandardEntryType.Misc); } public static MSBibEntryType getMSBibEntryType(EntryType bibtexType) { Map entryTypeMapping = new HashMap<>(); - entryTypeMapping.put(BibtexEntryType.Book, MSBibEntryType.Book); - entryTypeMapping.put(BibtexEntryType.InBook, MSBibEntryType.BookSection); - entryTypeMapping.put(BibtexEntryType.Booklet, MSBibEntryType.BookSection); - entryTypeMapping.put(BibtexEntryType.InCollection, MSBibEntryType.BookSection); - entryTypeMapping.put(BibtexEntryType.Article, MSBibEntryType.JournalArticle); - entryTypeMapping.put(BibtexEntryType.InProceedings, MSBibEntryType.ConferenceProceedings); - entryTypeMapping.put(BibtexEntryType.Conference, MSBibEntryType.ConferenceProceedings); - entryTypeMapping.put(BibtexEntryType.Proceedings, MSBibEntryType.ConferenceProceedings); - entryTypeMapping.put(BibtexEntryType.Collection, MSBibEntryType.ConferenceProceedings); - entryTypeMapping.put(BibtexEntryType.TechReport, MSBibEntryType.Report); - entryTypeMapping.put(BibtexEntryType.Manual, MSBibEntryType.Report); - entryTypeMapping.put(BibtexEntryType.MastersThesis, MSBibEntryType.Report); - entryTypeMapping.put(BibtexEntryType.PhdThesis, MSBibEntryType.Report); - entryTypeMapping.put(BibtexEntryType.Unpublished, MSBibEntryType.Report); + entryTypeMapping.put(StandardEntryType.Book, MSBibEntryType.Book); + entryTypeMapping.put(StandardEntryType.InBook, MSBibEntryType.BookSection); + entryTypeMapping.put(StandardEntryType.Booklet, MSBibEntryType.BookSection); + entryTypeMapping.put(StandardEntryType.InCollection, MSBibEntryType.BookSection); + entryTypeMapping.put(StandardEntryType.Article, MSBibEntryType.JournalArticle); + entryTypeMapping.put(StandardEntryType.InProceedings, MSBibEntryType.ConferenceProceedings); + entryTypeMapping.put(StandardEntryType.Conference, MSBibEntryType.ConferenceProceedings); + entryTypeMapping.put(StandardEntryType.Proceedings, MSBibEntryType.ConferenceProceedings); + entryTypeMapping.put(StandardEntryType.Collection, MSBibEntryType.ConferenceProceedings); + entryTypeMapping.put(StandardEntryType.TechReport, MSBibEntryType.Report); + entryTypeMapping.put(StandardEntryType.Manual, MSBibEntryType.Report); + entryTypeMapping.put(StandardEntryType.MastersThesis, MSBibEntryType.Report); + entryTypeMapping.put(StandardEntryType.PhdThesis, MSBibEntryType.Report); + entryTypeMapping.put(StandardEntryType.Unpublished, MSBibEntryType.Report); entryTypeMapping.put(IEEETranEntryType.Patent, MSBibEntryType.Patent); - entryTypeMapping.put(BibtexEntryType.Misc, MSBibEntryType.Misc); + entryTypeMapping.put(StandardEntryType.Misc, MSBibEntryType.Misc); entryTypeMapping.put(IEEETranEntryType.Electronic, MSBibEntryType.ElectronicSource); - entryTypeMapping.put(BiblatexEntryType.Online, MSBibEntryType.InternetSite); + entryTypeMapping.put(StandardEntryType.Online, MSBibEntryType.InternetSite); return entryTypeMapping.getOrDefault(bibtexType, MSBibEntryType.Misc); } diff --git a/src/main/java/org/jabref/logic/util/TestEntry.java b/src/main/java/org/jabref/logic/util/TestEntry.java index 5cff695d163..d2d6e80ceed 100644 --- a/src/main/java/org/jabref/logic/util/TestEntry.java +++ b/src/main/java/org/jabref/logic/util/TestEntry.java @@ -4,7 +4,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; public class TestEntry { @@ -13,7 +13,7 @@ private TestEntry() { public static BibEntry getTestEntry() { - BibEntry entry = new BibEntry(BibtexEntryType.Article); + BibEntry entry = new BibEntry(StandardEntryType.Article); entry.setCiteKey("Smith2016"); entry.setField(StandardField.AUTHOR, "Smith, Bill and Jones, Bob and Williams, Jeff"); entry.setField(StandardField.EDITOR, "Taylor, Phil"); @@ -42,7 +42,7 @@ public static BibEntry getTestEntry() { } public static BibEntry getTestEntryBook() { - BibEntry entry = new BibEntry(BibtexEntryType.Book); + BibEntry entry = new BibEntry(StandardEntryType.Book); entry.setCiteKey("Harrer2018"); entry.setField(StandardField.AUTHOR, "Simon Harrer and Jörg Lenhard and Linus Dietz"); entry.setField(StandardField.EDITOR, "Andrea Steward"); diff --git a/src/main/java/org/jabref/model/entry/BibEntry.java b/src/main/java/org/jabref/model/entry/BibEntry.java index 34c472a2b61..85adabb0ed7 100644 --- a/src/main/java/org/jabref/model/entry/BibEntry.java +++ b/src/main/java/org/jabref/model/entry/BibEntry.java @@ -31,8 +31,8 @@ import org.jabref.model.entry.field.OrFields; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.DOI; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.LatexToUnicodeAdapter; import org.jabref.model.strings.StringUtil; @@ -43,7 +43,7 @@ public class BibEntry implements Cloneable { - public static final EntryType DEFAULT_TYPE = BibtexEntryType.Misc; + public static final EntryType DEFAULT_TYPE = StandardEntryType.Misc; private static final Logger LOGGER = LoggerFactory.getLogger(BibEntry.class); private static final Pattern REMOVE_TRAILING_WHITESPACE = Pattern.compile("\\s+$"); private final SharedBibEntryData sharedBibEntryData; @@ -142,7 +142,7 @@ public Optional getResolvedFieldOrAlias(Field field, BibDatabase databas Optional referred = database.getReferencedEntry(this); if (referred.isPresent()) { result = referred.get().getFieldOrAlias(field); - if (!result.isPresent() && type.equals(BibtexEntryType.InProceedings)) { + if (!result.isPresent() && type.equals(StandardEntryType.InProceedings)) { if (field == StandardField.BOOKTITLE) { result = referred.get().getFieldOrAlias(StandardField.TITLE); } diff --git a/src/main/java/org/jabref/model/entry/BibEntryTypeBuilder.java b/src/main/java/org/jabref/model/entry/BibEntryTypeBuilder.java index 8bb44320ab8..a48e7b8001a 100644 --- a/src/main/java/org/jabref/model/entry/BibEntryTypeBuilder.java +++ b/src/main/java/org/jabref/model/entry/BibEntryTypeBuilder.java @@ -13,13 +13,13 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldPriority; import org.jabref.model.entry.field.OrFields; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; import com.google.common.collect.Streams; public class BibEntryTypeBuilder { - private EntryType type = BibtexEntryType.Misc; + private EntryType type = StandardEntryType.Misc; private Set fields = new HashSet<>(); private Set requiredFields = new HashSet<>(); diff --git a/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java b/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java index e994b400881..1e50af39b65 100644 --- a/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java +++ b/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java @@ -16,7 +16,7 @@ public class BiblatexEntryTypeDefinitions { private static final BibEntryType ARTICLE = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.Article) + .withType(StandardEntryType.Article) .withImportantFields( StandardField.SUBTITLE, StandardField.EDITOR, StandardField.SERIES, StandardField.VOLUME, StandardField.NUMBER, StandardField.EID, StandardField.ISSUE, StandardField.PAGES, StandardField.NOTE, StandardField.ISSN, StandardField.DOI, @@ -34,7 +34,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType BOOK = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.Book) + .withType(StandardEntryType.Book) .withImportantFields(StandardField.EDITOR, StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.MAINTITLE, StandardField.MAINSUBTITLE, StandardField.MAINTITLEADDON, StandardField.VOLUME, StandardField.EDITION, StandardField.PUBLISHER, StandardField.ISBN, @@ -53,7 +53,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType MVBOOK = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.MvBook) + .withType(StandardEntryType.MvBook) .withImportantFields(StandardField.EDITOR, StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.EDITION, StandardField.PUBLISHER, StandardField.ISBN, StandardField.PAGETOTAL, StandardField.DOI, StandardField.EPRINT, StandardField.EPRINTCLASS, StandardField.EPRINTTYPE, StandardField.URL, StandardField.URLDATE) @@ -68,7 +68,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType INBOOK = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.InBook) + .withType(StandardEntryType.InBook) .withImportantFields( StandardField.BOOKAUTHOR, StandardField.EDITOR, StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.MAINTITLE, StandardField.MAINSUBTITLE, StandardField.MAINTITLEADDON, StandardField.BOOKSUBTITLE, @@ -88,21 +88,21 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType BOOKINBOOK = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.BookInBook) + .withType(StandardEntryType.BookInBook) .withImportantFields(INBOOK.getPrimaryOptionalFields()) .withDetailFields(INBOOK.getSecondaryOptionalFields()) .withRequiredFields(INBOOK.getRequiredFields()) .build(); private static final BibEntryType SUPPBOOK = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.SuppBook) + .withType(StandardEntryType.SuppBook) .withImportantFields(INBOOK.getPrimaryOptionalFields()) .withDetailFields(INBOOK.getSecondaryOptionalFields()) .withRequiredFields(INBOOK.getRequiredFields()) .build(); private static final BibEntryType BOOKLET = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.Booklet) + .withType(StandardEntryType.Booklet) .withImportantFields(StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.HOWPUBLISHED, StandardField.CHAPTER, StandardField.PAGES, StandardField.DOI, StandardField.EPRINT, StandardField.EPRINTCLASS, StandardField.EPRINTTYPE, StandardField.URL, StandardField.URLDATE) @@ -114,7 +114,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType COLLECTION = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.Collection) + .withType(StandardEntryType.Collection) .withImportantFields( StandardField.TRANSLATOR, StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.MAINTITLE, StandardField.MAINSUBTITLE, StandardField.MAINTITLEADDON, StandardField.VOLUME, StandardField.EDITION, @@ -133,7 +133,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType MVCOLLECTION = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.MvCollection) + .withType(StandardEntryType.MvCollection) .withImportantFields(StandardField.TRANSLATOR, StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.EDITION, StandardField.PUBLISHER, StandardField.ISBN, StandardField.DOI, StandardField.EPRINT, StandardField.EPRINTCLASS, StandardField.EPRINTTYPE, StandardField.URL, StandardField.URLDATE) @@ -148,7 +148,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType INCOLLECTION = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.InCollection) + .withType(StandardEntryType.InCollection) .withImportantFields(StandardField.TRANSLATOR, StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.MAINTITLE, StandardField.MAINSUBTITLE, StandardField.MAINTITLEADDON, StandardField.BOOKSUBTITLE, StandardField.BOOKTITLEADDON, StandardField.VOLUME, StandardField.EDITION, StandardField.PUBLISHER, @@ -167,14 +167,14 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType SUPPCOLLECTION = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.SuppCollection) + .withType(StandardEntryType.SuppCollection) .withImportantFields(INCOLLECTION.getPrimaryOptionalFields()) .withDetailFields(INCOLLECTION.getSecondaryOptionalFields()) .withRequiredFields(INCOLLECTION.getRequiredFields()) .build(); private static final BibEntryType MANUAL = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.Manual) + .withType(StandardEntryType.Manual) .withImportantFields(StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.EDITION, StandardField.PUBLISHER, StandardField.ISBN, StandardField.CHAPTER, StandardField.PAGES, StandardField.DOI, StandardField.EPRINT, StandardField.EPRINTCLASS, StandardField.EPRINTTYPE, StandardField.URL, StandardField.URLDATE) @@ -187,7 +187,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType MISC = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.Misc) + .withType(StandardEntryType.Misc) .withImportantFields( StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.HOWPUBLISHED, StandardField.LOCATION, StandardField.DOI, StandardField.EPRINT, StandardField.EPRINTCLASS, StandardField.EPRINTTYPE, StandardField.URL, StandardField.URLDATE) @@ -199,7 +199,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType ONLINE = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.Online) + .withType(StandardEntryType.Online) .withImportantFields( StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.NOTE, StandardField.ORGANIZATION, StandardField.URLDATE) .withRequiredFields(new OrFields(StandardField.AUTHOR, StandardField.EDITOR), StandardField.TITLE, StandardField.DATE, StandardField.URL) @@ -234,14 +234,14 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType SUPPPERIODICAL = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.SuppPeriodical) + .withType(StandardEntryType.SuppPeriodical) .withImportantFields(ARTICLE.getPrimaryOptionalFields()) .withDetailFields(ARTICLE.getSecondaryOptionalFields()) .withRequiredFields(ARTICLE.getRequiredFields()) .build(); private static final BibEntryType PROCEEDINGS = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.Proceedings) + .withType(StandardEntryType.Proceedings) .withImportantFields( StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.MAINTITLE, StandardField.MAINSUBTITLE, StandardField.MAINTITLEADDON, StandardField.EVENTTITLE, StandardField.VOLUME, StandardField.PUBLISHER, StandardField.ISBN, @@ -259,7 +259,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType MVPROCEEDINGS = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.MvProceedings) + .withType(StandardEntryType.MvProceedings) .withImportantFields( StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.MAINTITLE, StandardField.MAINSUBTITLE, StandardField.MAINTITLEADDON, StandardField.EVENTTITLE, StandardField.VOLUME, StandardField.PUBLISHER, StandardField.ISBN, @@ -276,7 +276,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType INPROCEEDINGS = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.InProceedings) + .withType(StandardEntryType.InProceedings) .withImportantFields(StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.MAINTITLE, StandardField.MAINSUBTITLE, StandardField.MAINTITLEADDON, StandardField.BOOKSUBTITLE, StandardField.BOOKTITLEADDON, StandardField.EVENTTITLE, StandardField.VOLUME, StandardField.PUBLISHER, @@ -294,28 +294,28 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType REFERENCE = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.Reference) + .withType(StandardEntryType.Reference) .withImportantFields(COLLECTION.getPrimaryOptionalFields()) .withDetailFields(COLLECTION.getSecondaryOptionalFields()) .withRequiredFields(COLLECTION.getRequiredFields()) .build(); private static final BibEntryType MVREFERENCE = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.MvReference) + .withType(StandardEntryType.MvReference) .withImportantFields(MVCOLLECTION.getPrimaryOptionalFields()) .withDetailFields(MVCOLLECTION.getSecondaryOptionalFields()) .withRequiredFields(MVCOLLECTION.getRequiredFields()) .build(); private static final BibEntryType INREFERENCE = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.InReference) + .withType(StandardEntryType.InReference) .withImportantFields(INCOLLECTION.getPrimaryOptionalFields()) .withDetailFields(INCOLLECTION.getSecondaryOptionalFields()) .withRequiredFields(INCOLLECTION.getRequiredFields()) .build(); private static final BibEntryType REPORT = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.Report) + .withType(StandardEntryType.Report) .withImportantFields( StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.NUMBER, StandardField.ISRN, StandardField.CHAPTER, StandardField.PAGES, StandardField.PAGETOTAL, StandardField.DOI, StandardField.EPRINT, @@ -329,12 +329,12 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType SET = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.Set) + .withType(StandardEntryType.Set) .withRequiredFields(StandardField.ENTRYSET, StandardField.CROSSREF) .build(); private static final BibEntryType THESIS = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.Thesis) + .withType(StandardEntryType.Thesis) .withImportantFields(StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.CHAPTER, StandardField.PAGES, StandardField.PAGETOTAL, StandardField.DOI, StandardField.EPRINT, StandardField.EPRINTCLASS, StandardField.EPRINTTYPE, StandardField.URL, StandardField.URLDATE) @@ -346,7 +346,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType UNPUBLISHED = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.Unpublished) + .withType(StandardEntryType.Unpublished) .withImportantFields(StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.HOWPUBLISHED, StandardField.PUBSTATE, StandardField.URL, StandardField.URLDATE) .withRequiredFields(StandardField.AUTHOR, StandardField.TITLE, StandardField.DATE) @@ -356,7 +356,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType CONFERENCE = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.Conference) + .withType(StandardEntryType.Conference) .withImportantFields(INPROCEEDINGS.getPrimaryOptionalFields()) .withDetailFields(INPROCEEDINGS.getSecondaryOptionalFields()) .withRequiredFields(INPROCEEDINGS.getRequiredFields()) @@ -370,7 +370,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType MASTERSTHESIS = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.MastersThesis) + .withType(StandardEntryType.MastersThesis) .withImportantFields(StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.TYPE, StandardField.CHAPTER, StandardField.PAGES, StandardField.PAGETOTAL, StandardField.DOI, StandardField.EPRINT, StandardField.EPRINTCLASS, StandardField.EPRINTTYPE, StandardField.URL, StandardField.URLDATE) @@ -382,7 +382,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType PHDTHESIS = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.PhdThesis) + .withType(StandardEntryType.PhdThesis) .withImportantFields(StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.TYPE, StandardField.CHAPTER, StandardField.PAGES, StandardField.PAGETOTAL, StandardField.DOI, StandardField.EPRINT, StandardField.EPRINTCLASS, StandardField.EPRINTTYPE, StandardField.URL, StandardField.URLDATE) @@ -394,7 +394,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType TECHREPORT = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.TechReport) + .withType(StandardEntryType.TechReport) .withImportantFields( StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.TYPE, StandardField.NUMBER, StandardField.ISRN, StandardField.CHAPTER, StandardField.PAGES, StandardField.PAGETOTAL, StandardField.DOI, StandardField.EPRINT, @@ -408,7 +408,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType WWW = new BibEntryTypeBuilder() - .withType(BiblatexEntryType.WWW) + .withType(StandardEntryType.WWW) .withImportantFields(ONLINE.getPrimaryOptionalFields()) .withDetailFields(ONLINE.getSecondaryOptionalFields()) .withRequiredFields(ONLINE.getRequiredFields()) diff --git a/src/main/java/org/jabref/model/entry/types/BibtexEntryType.java b/src/main/java/org/jabref/model/entry/types/BibtexEntryType.java deleted file mode 100644 index b990162c945..00000000000 --- a/src/main/java/org/jabref/model/entry/types/BibtexEntryType.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.jabref.model.entry.types; - -import java.util.Arrays; -import java.util.Locale; -import java.util.Optional; - -public enum BibtexEntryType implements EntryType { - Article("Article"), - Book("Book"), - Booklet("Booklet"), - Collection("Collection"), - Conference("Conference"), - InBook("InBook"), - InCollection("InCollection"), - InProceedings("InProceedings"), - Manual("Manual"), - MastersThesis("MastersThesis"), - Misc("Misc"), - PhdThesis("PhdThesis"), - Proceedings("Proceedings"), - TechReport("TechReport"), - Unpublished("Unpublished"); - - private final String displayName; - - BibtexEntryType(String displayName) { - this.displayName = displayName; - } - - public static Optional fromName(String name) { - return Arrays.stream(BibtexEntryType.values()) - .filter(field -> field.getName().equalsIgnoreCase(name)) - .findAny(); - } - - @Override - public String getName() { - return displayName.toLowerCase(Locale.ENGLISH); - } - - @Override - public String getDisplayName() { - return displayName; - } -} diff --git a/src/main/java/org/jabref/model/entry/types/BibtexEntryTypeDefinitions.java b/src/main/java/org/jabref/model/entry/types/BibtexEntryTypeDefinitions.java index 707159b6394..068db83100f 100644 --- a/src/main/java/org/jabref/model/entry/types/BibtexEntryTypeDefinitions.java +++ b/src/main/java/org/jabref/model/entry/types/BibtexEntryTypeDefinitions.java @@ -22,7 +22,7 @@ public class BibtexEntryTypeDefinitions { * Optional fields: volume, number, pages, month, note. */ private static final BibEntryType ARTICLE = new BibEntryTypeBuilder() - .withType(BibtexEntryType.Article) + .withType(StandardEntryType.Article) .withRequiredFields(StandardField.AUTHOR, StandardField.TITLE, StandardField.JOURNAL, StandardField.YEAR) .withImportantFields(StandardField.VOLUME, StandardField.NUMBER, StandardField.PAGES, StandardField.MONTH, StandardField.ISSN, StandardField.NOTE) .build(); @@ -34,7 +34,7 @@ public class BibtexEntryTypeDefinitions { * Optional fields: volume or number, series, address, edition, month, note. */ private static final BibEntryType BOOK = new BibEntryTypeBuilder() - .withType(BibtexEntryType.Book) + .withType(StandardEntryType.Book) .withRequiredFields(new OrFields(StandardField.AUTHOR, StandardField.EDITOR), StandardField.TITLE, StandardField.PUBLISHER, StandardField.YEAR) .withImportantFields(StandardField.VOLUME, StandardField.NUMBER, StandardField.SERIES, StandardField.ADDRESS, StandardField.EDITION, StandardField.MONTH, StandardField.ISBN, StandardField.NOTE) .build(); @@ -46,7 +46,7 @@ public class BibtexEntryTypeDefinitions { * Optional fields: author, howpublished, address, month, year, note. */ private static final BibEntryType BOOKLET = new BibEntryTypeBuilder() - .withType(BibtexEntryType.Booklet) + .withType(StandardEntryType.Booklet) .withRequiredFields(StandardField.TITLE) .withImportantFields(StandardField.AUTHOR, StandardField.HOWPUBLISHED, StandardField.ADDRESS, StandardField.MONTH, StandardField.YEAR, StandardField.NOTE) .build(); @@ -58,7 +58,7 @@ public class BibtexEntryTypeDefinitions { * Optional fields: editor, volume or number, series, pages, address, month, organization, publisher, note. */ private static final BibEntryType CONFERENCE = new BibEntryTypeBuilder() - .withType(BibtexEntryType.Conference) + .withType(StandardEntryType.Conference) .withRequiredFields(StandardField.AUTHOR, StandardField.TITLE, StandardField.BOOKTITLE, StandardField.YEAR) .withImportantFields(StandardField.EDITOR, StandardField.VOLUME, StandardField.NUMBER, StandardField.SERIES, StandardField.PAGES, StandardField.ADDRESS, StandardField.MONTH, StandardField.ORGANIZATION, StandardField.PUBLISHER, StandardField.NOTE) .build(); @@ -70,7 +70,7 @@ public class BibtexEntryTypeDefinitions { * Optional fields: volume or number, series, type, address, edition, month, note. */ private static final BibEntryType INBOOK = new BibEntryTypeBuilder() - .withType(BibtexEntryType.InBook) + .withType(StandardEntryType.InBook) .withRequiredFields(Arrays.asList(new OrFields(StandardField.CHAPTER, StandardField.PAGES), new OrFields(StandardField.AUTHOR, StandardField.EDITOR)), StandardField.TITLE, StandardField.PUBLISHER, StandardField.YEAR) .withImportantFields(StandardField.VOLUME, StandardField.NUMBER, StandardField.SERIES, StandardField.TYPE, StandardField.ADDRESS, StandardField.EDITION, StandardField.MONTH, StandardField.ISBN, StandardField.NOTE) .build(); @@ -81,7 +81,7 @@ public class BibtexEntryTypeDefinitions { * Optional fields: editor, volume or number, series, type, chapter, pages, address, edition, month, note. */ private static final BibEntryType INCOLLECTION = new BibEntryTypeBuilder() - .withType(BibtexEntryType.InCollection) + .withType(StandardEntryType.InCollection) .withRequiredFields(StandardField.AUTHOR, StandardField.TITLE, StandardField.BOOKTITLE, StandardField.PUBLISHER, StandardField.YEAR) .withImportantFields(StandardField.EDITOR, StandardField.VOLUME, StandardField.NUMBER, StandardField.SERIES, StandardField.TYPE, StandardField.CHAPTER, StandardField.PAGES, StandardField.ADDRESS, StandardField.EDITION, StandardField.MONTH, StandardField.ISBN, StandardField.NOTE) .build(); @@ -93,7 +93,7 @@ public class BibtexEntryTypeDefinitions { * Optional fields: editor, volume or number, series, pages, address, month, organization, publisher, note. */ private static final BibEntryType INPROCEEDINGS = new BibEntryTypeBuilder() - .withType(BibtexEntryType.InProceedings) + .withType(StandardEntryType.InProceedings) .withRequiredFields(StandardField.AUTHOR, StandardField.TITLE, StandardField.BOOKTITLE, StandardField.YEAR) .withImportantFields(StandardField.EDITOR, StandardField.VOLUME, StandardField.NUMBER, StandardField.SERIES, StandardField.PAGES, StandardField.ADDRESS, StandardField.MONTH, StandardField.ORGANIZATION, StandardField.PUBLISHER, StandardField.NOTE) .build(); @@ -103,7 +103,7 @@ public class BibtexEntryTypeDefinitions { * Required field: title. * Optional fields: author, organization, address, edition, month, year, note. */ - private static final BibEntryType MANUAL = new BibEntryTypeBuilder().withRequiredFields(StandardField.TITLE).withImportantFields(StandardField.AUTHOR, StandardField.ORGANIZATION, StandardField.ADDRESS, StandardField.EDITION, StandardField.MONTH, StandardField.YEAR, StandardField.ISBN, StandardField.NOTE).withType(BibtexEntryType.Manual) + private static final BibEntryType MANUAL = new BibEntryTypeBuilder().withRequiredFields(StandardField.TITLE).withImportantFields(StandardField.AUTHOR, StandardField.ORGANIZATION, StandardField.ADDRESS, StandardField.EDITION, StandardField.MONTH, StandardField.YEAR, StandardField.ISBN, StandardField.NOTE).withType(StandardEntryType.Manual) .build(); /** @@ -113,7 +113,7 @@ public class BibtexEntryTypeDefinitions { * Optional fields: type, address, month, note. */ private static final BibEntryType MASTERSTHESIS = new BibEntryTypeBuilder() - .withType(BibtexEntryType.MastersThesis) + .withType(StandardEntryType.MastersThesis) .withRequiredFields(StandardField.AUTHOR, StandardField.TITLE, StandardField.SCHOOL, StandardField.YEAR) .withImportantFields(StandardField.TYPE, StandardField.ADDRESS, StandardField.MONTH, StandardField.NOTE) .build(); @@ -125,7 +125,7 @@ public class BibtexEntryTypeDefinitions { * Optional fields: author, title, howpublished, month, year, note. */ private static final BibEntryType MISC = new BibEntryTypeBuilder() - .withType(BibtexEntryType.Misc) + .withType(StandardEntryType.Misc) .withImportantFields(StandardField.AUTHOR, StandardField.TITLE, StandardField.HOWPUBLISHED, StandardField.MONTH, StandardField.YEAR, StandardField.NOTE) .build(); @@ -136,7 +136,7 @@ public class BibtexEntryTypeDefinitions { * Optional fields: type, address, month, note. */ private static final BibEntryType PHDTHESIS = new BibEntryTypeBuilder() - .withType(BibtexEntryType.PhdThesis) + .withType(StandardEntryType.PhdThesis) .withRequiredFields(StandardField.AUTHOR, StandardField.TITLE, StandardField.SCHOOL, StandardField.YEAR) .withImportantFields(StandardField.TYPE, StandardField.ADDRESS, StandardField.MONTH, StandardField.NOTE) .build(); @@ -148,7 +148,7 @@ public class BibtexEntryTypeDefinitions { * Optional fields: editor, volume or number, series, address, month, organization, publisher, note. */ private static final BibEntryType PROCEEDINGS = new BibEntryTypeBuilder() - .withType(BibtexEntryType.Proceedings) + .withType(StandardEntryType.Proceedings) .withRequiredFields(StandardField.TITLE, StandardField.YEAR) .withImportantFields(StandardField.EDITOR, StandardField.VOLUME, StandardField.NUMBER, StandardField.SERIES, StandardField.ADDRESS, StandardField.PUBLISHER, StandardField.MONTH, StandardField.ORGANIZATION, StandardField.ISBN, StandardField.NOTE) .build(); @@ -160,7 +160,7 @@ public class BibtexEntryTypeDefinitions { * Optional fields: type, number, address, month, note. */ private static final BibEntryType TECHREPORT = new BibEntryTypeBuilder() - .withType(BibtexEntryType.TechReport) + .withType(StandardEntryType.TechReport) .withRequiredFields(StandardField.AUTHOR, StandardField.TITLE, StandardField.INSTITUTION, StandardField.YEAR) .withImportantFields(StandardField.TYPE, StandardField.NUMBER, StandardField.ADDRESS, StandardField.MONTH, StandardField.NOTE) .build(); @@ -172,7 +172,7 @@ public class BibtexEntryTypeDefinitions { * Optional fields: month, year. */ private static final BibEntryType UNPUBLISHED = new BibEntryTypeBuilder() - .withType(BibtexEntryType.Unpublished) + .withType(StandardEntryType.Unpublished) .withRequiredFields(StandardField.AUTHOR, StandardField.TITLE, StandardField.NOTE) .withImportantFields(StandardField.MONTH, StandardField.YEAR) .build(); diff --git a/src/main/java/org/jabref/model/entry/types/EntryTypeFactory.java b/src/main/java/org/jabref/model/entry/types/EntryTypeFactory.java index b17ec65f66e..64e4f6cfc64 100644 --- a/src/main/java/org/jabref/model/entry/types/EntryTypeFactory.java +++ b/src/main/java/org/jabref/model/entry/types/EntryTypeFactory.java @@ -42,6 +42,6 @@ private static boolean isBiblatex(EntryType type) { } public static EntryType parse(String typeName) { - return OptionalUtil.orElse(BibtexEntryType.fromName(typeName), new UnknownEntryType(typeName)); + return OptionalUtil.orElse(StandardEntryType.fromName(typeName), new UnknownEntryType(typeName)); } } diff --git a/src/main/java/org/jabref/model/entry/types/BiblatexEntryType.java b/src/main/java/org/jabref/model/entry/types/StandardEntryType.java similarity index 86% rename from src/main/java/org/jabref/model/entry/types/BiblatexEntryType.java rename to src/main/java/org/jabref/model/entry/types/StandardEntryType.java index acefa2f93f0..51bfd341e23 100644 --- a/src/main/java/org/jabref/model/entry/types/BiblatexEntryType.java +++ b/src/main/java/org/jabref/model/entry/types/StandardEntryType.java @@ -4,7 +4,7 @@ import java.util.Locale; import java.util.Optional; -public enum BiblatexEntryType implements EntryType { +public enum StandardEntryType implements EntryType { // BibTeX Article("Article"), Book("Book"), @@ -40,12 +40,12 @@ public enum BiblatexEntryType implements EntryType { private final String displayName; - BiblatexEntryType(String displayName) { + StandardEntryType(String displayName) { this.displayName = displayName; } - public static Optional fromName(String name) { - return Arrays.stream(BiblatexEntryType.values()) + public static Optional fromName(String name) { + return Arrays.stream(StandardEntryType.values()) .filter(field -> field.getName().equalsIgnoreCase(name)) .findAny(); } diff --git a/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java b/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java index cbc598cfa72..04050a9bd20 100644 --- a/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java +++ b/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java @@ -11,7 +11,7 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.metadata.FilePreferences; import org.junit.jupiter.api.BeforeEach; @@ -29,7 +29,7 @@ public class AutoSetFileLinksUtilTest { private final AutoLinkPreferences autoLinkPrefs = new AutoLinkPreferences(false, "", true, ';'); private final BibDatabaseContext databaseContext = mock(BibDatabaseContext.class); private final ExternalFileTypes externalFileTypes = mock(ExternalFileTypes.class); - private final BibEntry entry = new BibEntry(BibtexEntryType.Article); + private final BibEntry entry = new BibEntry(StandardEntryType.Article); @BeforeEach public void setUp(@TempDir Path folder) throws Exception { diff --git a/src/test/java/org/jabref/logic/TypedBibEntryTest.java b/src/test/java/org/jabref/logic/TypedBibEntryTest.java index a64a1d2b9d6..683d636e7c2 100644 --- a/src/test/java/org/jabref/logic/TypedBibEntryTest.java +++ b/src/test/java/org/jabref/logic/TypedBibEntryTest.java @@ -4,7 +4,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.entry.types.UnknownEntryType; import org.junit.jupiter.api.BeforeEach; @@ -24,7 +24,7 @@ void setUp() { @Test public void hasAllRequiredFieldsFail() { - BibEntry e = new BibEntry(BibtexEntryType.Article); + BibEntry e = new BibEntry(StandardEntryType.Article); e.setField(StandardField.AUTHOR, "abc"); e.setField(StandardField.TITLE, "abc"); e.setField(StandardField.JOURNAL, "abc"); @@ -35,7 +35,7 @@ public void hasAllRequiredFieldsFail() { @Test public void hasAllRequiredFields() { - BibEntry e = new BibEntry(BibtexEntryType.Article); + BibEntry e = new BibEntry(StandardEntryType.Article); e.setField(StandardField.AUTHOR, "abc"); e.setField(StandardField.TITLE, "abc"); e.setField(StandardField.JOURNAL, "abc"); @@ -55,7 +55,7 @@ public void hasAllRequiredFieldsForUnknownTypeReturnsTrue() { @Test public void getTypeForDisplayReturnsTypeName() { - BibEntry e = new BibEntry(BibtexEntryType.InProceedings); + BibEntry e = new BibEntry(StandardEntryType.InProceedings); TypedBibEntry typedEntry = new TypedBibEntry(e, BibDatabaseMode.BIBTEX); assertEquals("InProceedings", typedEntry.getTypeForDisplay()); diff --git a/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java b/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java index 665ccc5f12e..3c158a64d53 100644 --- a/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java +++ b/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java @@ -16,7 +16,7 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.entry.types.UnknownEntryType; import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.model.util.FileUpdateMonitor; @@ -47,7 +47,7 @@ public void setUpWriter() { public void testSerialization() throws IOException { StringWriter stringWriter = new StringWriter(); - BibEntry entry = new BibEntry(BibtexEntryType.Article); + BibEntry entry = new BibEntry(StandardEntryType.Article); //set a required field entry.setField(StandardField.AUTHOR, "Foo Bar"); entry.setField(StandardField.JOURNAL, "International Journal of Something"); @@ -91,7 +91,7 @@ public void writeOtherTypeTest() throws Exception { @Test void writeEntryWithFile() throws Exception { - BibEntry entry = new BibEntry(BibtexEntryType.Article); + BibEntry entry = new BibEntry(StandardEntryType.Article); LinkedFile file = new LinkedFile("test", "/home/uers/test.pdf", "PDF"); entry.addFile(file); @@ -263,7 +263,7 @@ public void testEntryTypeChange() throws IOException { BibEntry entry = entries.iterator().next(); // modify entry - entry.setType(BibtexEntryType.InProceedings); + entry.setType(StandardEntryType.InProceedings); //write out bibtex string StringWriter stringWriter = new StringWriter(); @@ -408,7 +408,7 @@ public void addFieldWithLongerLength() throws IOException { public void doNotWriteEmptyFields() throws IOException { StringWriter stringWriter = new StringWriter(); - BibEntry entry = new BibEntry(BibtexEntryType.Article); + BibEntry entry = new BibEntry(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, " "); entry.setField(StandardField.NOTE, "some note"); @@ -427,7 +427,7 @@ public void doNotWriteEmptyFields() throws IOException { public void trimFieldContents() throws IOException { StringWriter stringWriter = new StringWriter(); - BibEntry entry = new BibEntry(BibtexEntryType.Article); + BibEntry entry = new BibEntry(StandardEntryType.Article); entry.setField(StandardField.NOTE, " some note \t"); writer.write(entry, stringWriter, BibDatabaseMode.BIBTEX); @@ -445,7 +445,7 @@ public void trimFieldContents() throws IOException { public void writeThrowsErrorIfFieldContainsUnbalancedBraces() { StringWriter stringWriter = new StringWriter(); - BibEntry entry = new BibEntry(BibtexEntryType.Article); + BibEntry entry = new BibEntry(StandardEntryType.Article); entry.setField(StandardField.NOTE, "some text with unbalanced { braces"); assertThrows(IOException.class, () -> writer.write(entry, stringWriter, BibDatabaseMode.BIBTEX)); diff --git a/src/test/java/org/jabref/logic/bibtex/DuplicateCheckTest.java b/src/test/java/org/jabref/logic/bibtex/DuplicateCheckTest.java index 00744ddecc0..a4dddfacea5 100644 --- a/src/test/java/org/jabref/logic/bibtex/DuplicateCheckTest.java +++ b/src/test/java/org/jabref/logic/bibtex/DuplicateCheckTest.java @@ -5,7 +5,7 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -24,22 +24,22 @@ public class DuplicateCheckTest { @BeforeEach public void setUp() { - simpleArticle = new BibEntry(BibtexEntryType.Article) + simpleArticle = new BibEntry(StandardEntryType.Article) .withField(StandardField.AUTHOR, "Single Author") .withField(StandardField.TITLE, "A serious paper about something") .withField(StandardField.YEAR, "2017"); - unrelatedArticle = new BibEntry(BibtexEntryType.Article) + unrelatedArticle = new BibEntry(StandardEntryType.Article) .withField(StandardField.AUTHOR, "Completely Different") .withField(StandardField.TITLE, "Holy Moly Uffdada und Trallalla") .withField(StandardField.YEAR, "1992"); - simpleInbook = new BibEntry(BibtexEntryType.InBook) + simpleInbook = new BibEntry(StandardEntryType.InBook) .withField(StandardField.TITLE, "Alice in Wonderland") .withField(StandardField.AUTHOR, "Charles Lutwidge Dodgson") .withField(StandardField.CHAPTER, "Chapter One – Down the Rabbit Hole") .withField(StandardField.LANGUAGE, "English") .withField(StandardField.PUBLISHER, "Macmillan") .withField(StandardField.YEAR, "1865"); - simpleIncollection = new BibEntry(BibtexEntryType.InCollection) + simpleIncollection = new BibEntry(StandardEntryType.InCollection) .withField(StandardField.TITLE, "Innovation and Intellectual Property Rights") .withField(StandardField.AUTHOR, "Ove Grandstrand") .withField(StandardField.BOOKTITLE, "The Oxford Handbook of Innovation") @@ -50,9 +50,9 @@ public void setUp() { @Test public void testDuplicateDetection() { - BibEntry one = new BibEntry(BibtexEntryType.Article); + BibEntry one = new BibEntry(StandardEntryType.Article); - BibEntry two = new BibEntry(BibtexEntryType.Article); + BibEntry two = new BibEntry(StandardEntryType.Article); one.setField(StandardField.AUTHOR, "Billy Bob"); two.setField(StandardField.AUTHOR, "Billy Bob"); @@ -62,10 +62,10 @@ public void testDuplicateDetection() { assertFalse(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); two.setField(StandardField.AUTHOR, "Billy Bob"); - two.setType(BibtexEntryType.Book); + two.setType(StandardEntryType.Book); assertFalse(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX)); - two.setType(BibtexEntryType.Article); + two.setType(StandardEntryType.Article); one.setField(StandardField.YEAR, "2005"); two.setField(StandardField.YEAR, "2005"); one.setField(StandardField.TITLE, "A title"); @@ -156,7 +156,7 @@ public void twoUnrelatedEntriesWithEqualEprintAreDuplicates() { public void twoEntriesWithSameDoiButDifferentTypesAreDuplicates() { simpleArticle.setField(StandardField.DOI, "10.1016/j.is.2004.02.002"); BibEntry duplicateWithDifferentType = (BibEntry) simpleArticle.clone(); - duplicateWithDifferentType.setType(BibtexEntryType.InCollection); + duplicateWithDifferentType.setType(StandardEntryType.InCollection); assertTrue(duplicateChecker.isDuplicate(simpleArticle, duplicateWithDifferentType, BibDatabaseMode.BIBTEX)); } @@ -208,14 +208,14 @@ public void inbookWithoutChapterCouldBeDuplicateOfInbookWithChapter() { @Test public void twoBooksWithDifferentEditionsAreNotDuplicates() { - BibEntry editionOne = new BibEntry(BibtexEntryType.Book); + BibEntry editionOne = new BibEntry(StandardEntryType.Book); editionOne.setField(StandardField.TITLE, "Effective Java"); editionOne.setField(StandardField.AUTHOR, "Bloch, Joshua"); editionOne.setField(StandardField.PUBLISHER, "Prentice Hall"); editionOne.setField(StandardField.DATE, "2001"); editionOne.setField(StandardField.EDITION, "1"); - BibEntry editionTwo = new BibEntry(BibtexEntryType.Book); + BibEntry editionTwo = new BibEntry(StandardEntryType.Book); editionTwo.setField(StandardField.TITLE, "Effective Java"); editionTwo.setField(StandardField.AUTHOR, "Bloch, Joshua"); editionTwo.setField(StandardField.PUBLISHER, "Prentice Hall"); @@ -227,13 +227,13 @@ public void twoBooksWithDifferentEditionsAreNotDuplicates() { @Test public void sameBooksWithMissingEditionAreDuplicates() { - BibEntry editionOne = new BibEntry(BibtexEntryType.Book); + BibEntry editionOne = new BibEntry(StandardEntryType.Book); editionOne.setField(StandardField.TITLE, "Effective Java"); editionOne.setField(StandardField.AUTHOR, "Bloch, Joshua"); editionOne.setField(StandardField.PUBLISHER, "Prentice Hall"); editionOne.setField(StandardField.DATE, "2001"); - BibEntry editionTwo = new BibEntry(BibtexEntryType.Book); + BibEntry editionTwo = new BibEntry(StandardEntryType.Book); editionTwo.setField(StandardField.TITLE, "Effective Java"); editionTwo.setField(StandardField.AUTHOR, "Bloch, Joshua"); editionTwo.setField(StandardField.PUBLISHER, "Prentice Hall"); @@ -244,13 +244,13 @@ public void sameBooksWithMissingEditionAreDuplicates() { @Test public void sameBooksWithPartiallyMissingEditionAreDuplicates() { - BibEntry editionOne = new BibEntry(BibtexEntryType.Book); + BibEntry editionOne = new BibEntry(StandardEntryType.Book); editionOne.setField(StandardField.TITLE, "Effective Java"); editionOne.setField(StandardField.AUTHOR, "Bloch, Joshua"); editionOne.setField(StandardField.PUBLISHER, "Prentice Hall"); editionOne.setField(StandardField.DATE, "2001"); - BibEntry editionTwo = new BibEntry(BibtexEntryType.Book); + BibEntry editionTwo = new BibEntry(StandardEntryType.Book); editionTwo.setField(StandardField.TITLE, "Effective Java"); editionTwo.setField(StandardField.AUTHOR, "Bloch, Joshua"); editionTwo.setField(StandardField.PUBLISHER, "Prentice Hall"); @@ -262,7 +262,7 @@ public void sameBooksWithPartiallyMissingEditionAreDuplicates() { @Test public void sameBooksWithDifferentEditionsAreNotDuplicates() { - BibEntry editionTwo = new BibEntry(BibtexEntryType.Book); + BibEntry editionTwo = new BibEntry(StandardEntryType.Book); editionTwo.setCiteKey("Sutton17reinfLrnIntroBook"); editionTwo.setField(StandardField.TITLE, "Reinforcement learning:An introduction"); editionTwo.setField(StandardField.PUBLISHER, "MIT Press"); @@ -273,7 +273,7 @@ public void sameBooksWithDifferentEditionsAreNotDuplicates() { editionTwo.setField(StandardField.JOURNAL, "MIT Press"); editionTwo.setField(StandardField.URL, "https://webdocs.cs.ualberta.ca/~sutton/book/the-book-2nd.html"); - BibEntry editionOne = new BibEntry(BibtexEntryType.Book); + BibEntry editionOne = new BibEntry(StandardEntryType.Book); editionOne.setCiteKey("Sutton98reinfLrnIntroBook"); editionOne.setField(StandardField.TITLE, "Reinforcement learning: An introduction"); editionOne.setField(StandardField.PUBLISHER, "MIT press Cambridge"); diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/FieldComparatorTest.java b/src/test/java/org/jabref/logic/bibtex/comparator/FieldComparatorTest.java index ac02cbb5910..706e4f04427 100644 --- a/src/test/java/org/jabref/logic/bibtex/comparator/FieldComparatorTest.java +++ b/src/test/java/org/jabref/logic/bibtex/comparator/FieldComparatorTest.java @@ -4,7 +4,7 @@ import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.OrFields; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.Test; @@ -98,7 +98,7 @@ public void compareYearFieldBiggerDescending() throws Exception { @Test public void compareTypeFieldIdentity() throws Exception { FieldComparator comparator = new FieldComparator(InternalField.TYPE_HEADER); - BibEntry equal = new BibEntry(BibtexEntryType.Article); + BibEntry equal = new BibEntry(StandardEntryType.Article); assertEquals(0, comparator.compare(equal, equal)); } @@ -106,9 +106,9 @@ public void compareTypeFieldIdentity() throws Exception { @Test public void compareTypeFieldEquality() throws Exception { FieldComparator comparator = new FieldComparator(InternalField.TYPE_HEADER); - BibEntry equal = new BibEntry(BibtexEntryType.Article); + BibEntry equal = new BibEntry(StandardEntryType.Article); equal.setId("1"); - BibEntry equal2 = new BibEntry(BibtexEntryType.Article); + BibEntry equal2 = new BibEntry(StandardEntryType.Article); equal2.setId("1"); assertEquals(0, comparator.compare(equal, equal2)); @@ -117,8 +117,8 @@ public void compareTypeFieldEquality() throws Exception { @Test public void compareTypeFieldBiggerAscending() throws Exception { FieldComparator comparator = new FieldComparator(InternalField.TYPE_HEADER); - BibEntry smaller = new BibEntry(BibtexEntryType.Article); - BibEntry bigger = new BibEntry(BibtexEntryType.Book); + BibEntry smaller = new BibEntry(StandardEntryType.Article); + BibEntry bigger = new BibEntry(StandardEntryType.Book); assertEquals(1, comparator.compare(bigger, smaller)); } @@ -126,8 +126,8 @@ public void compareTypeFieldBiggerAscending() throws Exception { @Test public void compareTypeFieldBiggerDescending() throws Exception { FieldComparator comparator = new FieldComparator(new OrFields(InternalField.TYPE_HEADER), true); - BibEntry bigger = new BibEntry(BibtexEntryType.Article); - BibEntry smaller = new BibEntry(BibtexEntryType.Book); + BibEntry bigger = new BibEntry(StandardEntryType.Article); + BibEntry smaller = new BibEntry(StandardEntryType.Book); assertEquals(1, comparator.compare(bigger, smaller)); } diff --git a/src/test/java/org/jabref/logic/cleanup/BibtexBiblatexRoundtripTest.java b/src/test/java/org/jabref/logic/cleanup/BibtexBiblatexRoundtripTest.java index 3a2cb53bdad..fe5f3d8b123 100644 --- a/src/test/java/org/jabref/logic/cleanup/BibtexBiblatexRoundtripTest.java +++ b/src/test/java/org/jabref/logic/cleanup/BibtexBiblatexRoundtripTest.java @@ -3,7 +3,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -16,7 +16,7 @@ class BibtexBiblatexRoundtripTest { @BeforeEach void setUp() { - bibtex = new BibEntry(BibtexEntryType.Article); + bibtex = new BibEntry(StandardEntryType.Article); bibtex.setField(StandardField.AUTHOR, "Frame, J. S. and Robinson, G. de B. and Thrall, R. M."); bibtex.setField(StandardField.TITLE, "The hook graphs of the symmetric groups"); bibtex.setField(StandardField.JOURNAL, "Canadian J. Math."); @@ -29,7 +29,7 @@ void setUp() { bibtex.setField(StandardField.MR_NUMBER, "0062127"); bibtex.setField(new UnknownField("mrreviewer"), "D. E. Littlewood"); - biblatex = new BibEntry(BibtexEntryType.Article); + biblatex = new BibEntry(StandardEntryType.Article); biblatex.setField(StandardField.AUTHOR, "Frame, J. S. and Robinson, G. de B. and Thrall, R. M."); biblatex.setField(StandardField.TITLE, "The hook graphs of the symmetric groups"); biblatex.setField(StandardField.JOURNALTITLE, "Canadian J. Math."); diff --git a/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java index 21876d8ac0e..dc0b5a9958c 100644 --- a/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java @@ -10,7 +10,7 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -27,7 +27,7 @@ public void setUp() { fieldMap = new HashMap<>(); entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); fieldMap.put(StandardField.TITLE, "JabRef"); fieldMap.put(StandardField.BOOKTITLE, "JabRefBook"); fieldMap.put(StandardField.YEAR, "twohundredsixteen"); diff --git a/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java b/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java index eba08acaaf9..4c001b7b70d 100644 --- a/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java +++ b/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java @@ -33,8 +33,8 @@ import org.jabref.model.entry.field.FieldPriority; import org.jabref.model.entry.field.OrFields; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.entry.types.UnknownEntryType; import org.jabref.model.groups.AllEntriesGroup; import org.jabref.model.groups.ExplicitGroup; @@ -124,7 +124,7 @@ void writePreambleAndEncoding() throws Exception { @Test void writeEntry() throws Exception { BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); database.insertEntry(entry); databaseWriter.savePartOfDatabase(bibtexContext, Collections.singletonList(entry)); @@ -139,7 +139,7 @@ void writeEntry() throws Exception { void writeEncodingAndEntry() throws Exception { when(preferences.getEncoding()).thenReturn(StandardCharsets.US_ASCII); BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); database.insertEntry(entry); databaseWriter.savePartOfDatabase(bibtexContext, Collections.singletonList(entry)); @@ -375,7 +375,7 @@ void roundtripWithUnknownMetaData() throws Exception { @Test void writeSavedSerializationOfEntryIfUnchanged() throws Exception { BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "Mr. author"); entry.setParsedSerialization("presaved serialization"); entry.setChanged(false); @@ -390,7 +390,7 @@ void writeSavedSerializationOfEntryIfUnchanged() throws Exception { @Test void reformatEntryIfAskedToDoSo() throws Exception { BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "Mr. author"); entry.setParsedSerialization("wrong serialization"); entry.setChanged(false); @@ -460,7 +460,7 @@ void writeSaveOrderConfig() throws Exception { void writeCustomKeyPattern() throws Exception { AbstractBibtexKeyPattern pattern = new DatabaseBibtexKeyPattern(mock(GlobalBibtexKeyPattern.class)); pattern.setDefaultValue("test"); - pattern.addBibtexKeyPattern(BibtexEntryType.Article, "articleTest"); + pattern.addBibtexKeyPattern(StandardEntryType.Article, "articleTest"); metaData.setCiteKeyPattern(pattern); databaseWriter.savePartOfDatabase(bibtexContext, Collections.emptyList()); @@ -512,17 +512,17 @@ void writeEntriesSorted() throws Exception { metaData.setSaveOrderConfig(saveOrderConfig); BibEntry firstEntry = new BibEntry(); - firstEntry.setType(BibtexEntryType.Article); + firstEntry.setType(StandardEntryType.Article); firstEntry.setField(StandardField.AUTHOR, "A"); firstEntry.setField(StandardField.YEAR, "2010"); BibEntry secondEntry = new BibEntry(); - secondEntry.setType(BibtexEntryType.Article); + secondEntry.setType(StandardEntryType.Article); secondEntry.setField(StandardField.AUTHOR, "A"); secondEntry.setField(StandardField.YEAR, "2000"); BibEntry thirdEntry = new BibEntry(); - thirdEntry.setType(BibtexEntryType.Article); + thirdEntry.setType(StandardEntryType.Article); thirdEntry.setField(StandardField.AUTHOR, "B"); thirdEntry.setField(StandardField.YEAR, "2000"); @@ -556,17 +556,17 @@ void writeEntriesSorted() throws Exception { @Test void writeEntriesInOriginalOrderWhenNoSaveOrderConfigIsSetInMetadata() throws Exception { BibEntry firstEntry = new BibEntry(); - firstEntry.setType(BibtexEntryType.Article); + firstEntry.setType(StandardEntryType.Article); firstEntry.setField(StandardField.AUTHOR, "A"); firstEntry.setField(StandardField.YEAR, "2010"); BibEntry secondEntry = new BibEntry(); - secondEntry.setType(BibtexEntryType.Article); + secondEntry.setType(StandardEntryType.Article); secondEntry.setField(StandardField.AUTHOR, "B"); secondEntry.setField(StandardField.YEAR, "2000"); BibEntry thirdEntry = new BibEntry(); - thirdEntry.setType(BibtexEntryType.Article); + thirdEntry.setType(StandardEntryType.Article); thirdEntry.setField(StandardField.AUTHOR, "A"); thirdEntry.setField(StandardField.YEAR, "2000"); diff --git a/src/test/java/org/jabref/logic/exporter/DocBook5ExporterTest.java b/src/test/java/org/jabref/logic/exporter/DocBook5ExporterTest.java index ad446caab21..d732c561bed 100644 --- a/src/test/java/org/jabref/logic/exporter/DocBook5ExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/DocBook5ExporterTest.java @@ -16,7 +16,7 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -56,7 +56,7 @@ void setUp() throws URISyntaxException { databaseContext = new BibDatabaseContext(); charset = StandardCharsets.UTF_8; - BibEntry entry = new BibEntry(BibtexEntryType.Book); + BibEntry entry = new BibEntry(StandardEntryType.Book); entry.setField(StandardField.TITLE, "my paper title"); entry.setField(StandardField.AUTHOR, "Stefan Kolb and Tobias Diez"); entry.setField(StandardField.ISBN, "1-2-34"); diff --git a/src/test/java/org/jabref/logic/exporter/FieldFormatterCleanupsTest.java b/src/test/java/org/jabref/logic/exporter/FieldFormatterCleanupsTest.java index f63068f6969..b6a9b8de6c7 100644 --- a/src/test/java/org/jabref/logic/exporter/FieldFormatterCleanupsTest.java +++ b/src/test/java/org/jabref/logic/exporter/FieldFormatterCleanupsTest.java @@ -14,7 +14,7 @@ import org.jabref.model.cleanup.FieldFormatterCleanups; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,7 +28,7 @@ public class FieldFormatterCleanupsTest { @BeforeEach public void setUp() { entry = new BibEntry(); - entry.setType(BibtexEntryType.InProceedings); + entry.setType(StandardEntryType.InProceedings); entry.setCiteKey("6055279"); entry.setField(StandardField.TITLE, "Educational session 1"); entry.setField(StandardField.BOOKTITLE, "Custom Integrated Circuits Conference (CICC), 2011 IEEE"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java index 5352ffae307..4a673179f57 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java @@ -8,7 +8,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -31,7 +31,7 @@ void setUp() { @Test void searchByQueryFindsEntry() throws Exception { - BibEntry expected = new BibEntry(BibtexEntryType.InProceedings); + BibEntry expected = new BibEntry(StandardEntryType.InProceedings); expected.setCiteKey("Olsson:2017:RCC:3129790.3129810"); expected.setField(new UnknownField("acmid"), "3129810"); expected.setField(StandardField.ADDRESS, "New York, NY, USA"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ArXivTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ArXivTest.java index 2982f9eadfb..572d6681164 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ArXivTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ArXivTest.java @@ -10,7 +10,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.ArXivIdentifier; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -36,7 +36,7 @@ public void setUp() { entry = new BibEntry(); sliceTheoremPaper = new BibEntry(); - sliceTheoremPaper.setType(BibtexEntryType.Article); + sliceTheoremPaper.setType(StandardEntryType.Article); sliceTheoremPaper.setField(StandardField.AUTHOR, "Tobias Diez"); sliceTheoremPaper.setField(StandardField.TITLE, "Slice theorem for Fréchet group actions and covariant symplectic field theory"); sliceTheoremPaper.setField(StandardField.DATE, "2014-05-09"); @@ -136,7 +136,7 @@ public void searchEntryByPartOfTitleWithAcuteAccent() throws Exception { @Test public void searchEntryByOldId() throws Exception { BibEntry expected = new BibEntry(); - expected.setType(BibtexEntryType.Article); + expected.setType(StandardEntryType.Article); expected.setField(StandardField.AUTHOR, "H1 Collaboration"); expected.setField(StandardField.TITLE, "Multi-Electron Production at High Transverse Momenta in ep Collisions at HERA"); expected.setField(StandardField.DATE, "2003-07-07"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java b/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java index f4dcdf308c6..4ece520646d 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java @@ -9,7 +9,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -34,7 +34,7 @@ public void setUp() throws Exception { fetcher = new AstrophysicsDataSystem(importFormatPreferences); diezSliceTheoremEntry = new BibEntry(); - diezSliceTheoremEntry.setType(BibtexEntryType.Article); + diezSliceTheoremEntry.setType(StandardEntryType.Article); diezSliceTheoremEntry.setCiteKey("2014arXiv1405.2249D"); diezSliceTheoremEntry.setField(StandardField.AUTHOR, "Diez, T."); diezSliceTheoremEntry.setField(StandardField.TITLE, "Slice theorem for Fr$\\backslash$'echet group actions and covariant symplectic field theory"); @@ -64,7 +64,7 @@ public void setUp() throws Exception { + "occurring symmetries."); famaeyMcGaughEntry = new BibEntry(); - famaeyMcGaughEntry.setType(BibtexEntryType.Article); + famaeyMcGaughEntry.setType(StandardEntryType.Article); famaeyMcGaughEntry.setCiteKey("2012LRR....15...10F"); famaeyMcGaughEntry.setField(StandardField.AUTHOR, "Famaey, B. and McGaugh, S. S."); famaeyMcGaughEntry.setField(StandardField.TITLE, "Modified Newtonian Dynamics (MOND): Observational Phenomenology and Relativistic Extensions"); @@ -81,7 +81,7 @@ public void setUp() throws Exception { famaeyMcGaughEntry.setField(StandardField.URL, "http://adsabs.harvard.edu/abs/2012LRR....15...10F"); sunWelchEntry = new BibEntry(); - sunWelchEntry.setType(BibtexEntryType.Article); + sunWelchEntry.setType(StandardEntryType.Article); sunWelchEntry.setCiteKey("2012NatMa..11...44S"); sunWelchEntry.setField(StandardField.AUTHOR, "Sun, Y. and Welch, G. C. and Leong, W. L. and Takacs, C. J. and Bazan, G. C. and Heeger, A. J."); sunWelchEntry.setField(StandardField.DOI, "10.1038/nmat3160"); @@ -94,7 +94,7 @@ public void setUp() throws Exception { sunWelchEntry.setField(StandardField.URL, "http://adsabs.harvard.edu/abs/2012NatMa..11...44S"); xiongSunEntry = new BibEntry(); - xiongSunEntry.setType(BibtexEntryType.Article); + xiongSunEntry.setType(StandardEntryType.Article); xiongSunEntry.setCiteKey("2007ITGRS..45..879X"); xiongSunEntry.setField(StandardField.AUTHOR, "Xiong, X. and Sun, J. and Barnes, W. and Salomonson, V. and Esposito, J. and Erives, H. and Guenther, B."); xiongSunEntry.setField(StandardField.DOI, "10.1109/TGRS.2006.890567"); @@ -107,7 +107,7 @@ public void setUp() throws Exception { xiongSunEntry.setField(StandardField.URL, "http://adsabs.harvard.edu/abs/2007ITGRS..45..879X"); ingersollPollardEntry = new BibEntry(); - ingersollPollardEntry.setType(BibtexEntryType.Article); + ingersollPollardEntry.setType(StandardEntryType.Article); ingersollPollardEntry.setCiteKey("1982Icar...52...62I"); ingersollPollardEntry.setField(StandardField.AUTHOR, "Ingersoll, A. P. and Pollard, D."); ingersollPollardEntry.setField(StandardField.DOI, "10.1016/0019-1035(82)90169-5"); @@ -121,7 +121,7 @@ public void setUp() throws Exception { ingersollPollardEntry.setField(StandardField.URL, "http://adsabs.harvard.edu/abs/1982Icar...52...62I"); luceyPaulEntry = new BibEntry(); - luceyPaulEntry.setType(BibtexEntryType.Article); + luceyPaulEntry.setType(StandardEntryType.Article); luceyPaulEntry.setCiteKey("2000JGR...10520297L"); luceyPaulEntry.setField(StandardField.AUTHOR, "Lucey, P. G. and Blewett, D. T. and Jolliff, B. L."); luceyPaulEntry.setField(StandardField.DOI, "10.1029/1999JE001117"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java index 069b54a4585..26ee250cda8 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java @@ -5,7 +5,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -26,7 +26,7 @@ void setUp() throws Exception { @Test void searchByQueryFindsEntry() throws Exception { BibEntry expected = new BibEntry(); - expected.setType(BibtexEntryType.Misc); + expected.setType(StandardEntryType.Misc); expected.setField(StandardField.AUTHOR, "Wang Wei and Zhang Pingwen and Zhang Zhifei"); expected.setField(StandardField.TITLE, "Rigorous Derivation from Landau-de Gennes Theory to Eericksen-leslie Theory"); expected.setField(StandardField.DOI, "10.1.1.744.5780"); @@ -38,7 +38,7 @@ void searchByQueryFindsEntry() throws Exception { @Test void searchByQueryFindsEntry2() throws Exception { BibEntry expected = new BibEntry(); - expected.setType(BibtexEntryType.Misc); + expected.setType(StandardEntryType.Misc); expected.setField(StandardField.AUTHOR, "Lazarus Richard S."); expected.setField(StandardField.TITLE, "Coping Theory and Research: Past Present and Future"); expected.setField(StandardField.DOI, "10.1.1.115.9665"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java b/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java index 1ba6a8b32a3..1ae95774833 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java @@ -6,7 +6,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -118,7 +118,7 @@ public void findByEntry() throws Exception { @Test public void performSearchByIdFindsPaperWithoutTitle() throws Exception { - BibEntry entry = new BibEntry(BibtexEntryType.Article); + BibEntry entry = new BibEntry(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "Dominik Wujastyk"); entry.setField(StandardField.DOI, "10.1023/a:1003473214310"); entry.setField(StandardField.ISSN, "0019-7246"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java index 2d28c823478..8618818fbd5 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java @@ -9,7 +9,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -33,7 +33,7 @@ public void setUp() { dblpFetcher = new DBLPFetcher(importFormatPreferences); entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); entry.setCiteKey("DBLP:journals/stt/GeigerHL16"); entry.setField(StandardField.TITLE, "Process Engine Benchmarking with Betsy in the Context of {ISO/IEC} Quality Standards"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java index c68f77294ed..a5c81f98570 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java @@ -7,7 +7,7 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.apache.http.client.utils.URIBuilder; @@ -33,7 +33,7 @@ void setUp() { @Test void searchByQueryFindsEntry() throws Exception { - BibEntry expected = new BibEntry(BibtexEntryType.Article); + BibEntry expected = new BibEntry(StandardEntryType.Article); expected.setField(StandardField.AUTHOR, "Wei Wang and Yun He and Tong Li and Jiajun Zhu and Jinzhuo Liu"); expected.setField(StandardField.DOI, "10.1155/2018/5913634"); expected.setField(StandardField.ISSN, "1875-919X"); @@ -63,7 +63,7 @@ void testBibJSONConverter() { JSONObject jsonObject = new JSONObject(jsonString); BibEntry bibEntry = DOAJFetcher.parseBibJSONtoBibtex(jsonObject, ','); - assertEquals(BibtexEntryType.Article, bibEntry.getType()); + assertEquals(StandardEntryType.Article, bibEntry.getType()); assertEquals(Optional.of("VLSI Design"), bibEntry.getField(StandardField.JOURNAL)); assertEquals(Optional.of("10.1155/2014/217495"), bibEntry.getField(StandardField.DOI)); assertEquals(Optional.of("Syed Asad Alam and Oscar Gustafsson"), bibEntry.getField(StandardField.AUTHOR)); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java b/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java index c256771c848..e9fea44adff 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java @@ -6,7 +6,7 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -41,7 +41,7 @@ public void testGetHelpPage() { @Test public void testPerformSearchById() throws Exception { BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); entry.setCiteKey("Gustafsson260746"); entry.setField(StandardField.AUTHOR, "Gustafsson, Oscar"); entry.setField(StandardField.INSTITUTION, "Linköping University, The Institute of Technology"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java index e91e9861a36..88411f1f08d 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java @@ -6,7 +6,7 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -28,7 +28,7 @@ public void setUp() { fetcher = new DoiFetcher(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS)); bibEntryBurd2011 = new BibEntry(); - bibEntryBurd2011.setType(BibtexEntryType.Book); + bibEntryBurd2011.setType(StandardEntryType.Book); bibEntryBurd2011.setCiteKey("Burd_2011"); bibEntryBurd2011.setField(StandardField.TITLE, "Java{\\textregistered} For Dummies{\\textregistered}"); bibEntryBurd2011.setField(StandardField.PUBLISHER, "Wiley Publishing, Inc."); @@ -38,7 +38,7 @@ public void setUp() { bibEntryBurd2011.setField(StandardField.DOI, "10.1002/9781118257517"); bibEntryDecker2007 = new BibEntry(); - bibEntryDecker2007.setType(BibtexEntryType.InProceedings); + bibEntryDecker2007.setType(StandardEntryType.InProceedings); bibEntryDecker2007.setCiteKey("Decker_2007"); bibEntryDecker2007.setField(StandardField.AUTHOR, "Gero Decker and Oliver Kopp and Frank Leymann and Mathias Weske"); bibEntryDecker2007.setField(StandardField.BOOKTITLE, "{IEEE} International Conference on Web Services ({ICWS} 2007)"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/GoogleScholarTest.java b/src/test/java/org/jabref/logic/importer/fetcher/GoogleScholarTest.java index f64fea92296..a9b7ced5928 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/GoogleScholarTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/GoogleScholarTest.java @@ -11,7 +11,7 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; @@ -59,7 +59,7 @@ void noLinkFound() throws IOException, FetcherException { @Test @DisabledOnCIServer("CI server is blocked by Google") void findSingleEntry() throws FetcherException { - entry.setType(BibtexEntryType.InProceedings); + entry.setType(StandardEntryType.InProceedings); entry.setCiteKey("geiger2013detecting"); entry.setField(StandardField.TITLE, "Detecting Interoperability and Correctness Issues in BPMN 2.0 Process Models."); entry.setField(StandardField.AUTHOR, "Geiger, Matthias and Wirtz, Guido"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java index 540b525a8f6..c97574620a7 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java @@ -10,7 +10,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -31,7 +31,7 @@ public void setUp() { fetcher = new GvkFetcher(); bibEntryPPN591166003 = new BibEntry(); - bibEntryPPN591166003.setType(BibtexEntryType.Book); + bibEntryPPN591166003.setType(StandardEntryType.Book); bibEntryPPN591166003.setField(StandardField.TITLE, "Effective Java"); bibEntryPPN591166003.setField(StandardField.PUBLISHER, "Addison-Wesley"); bibEntryPPN591166003.setField(StandardField.YEAR, "2008"); @@ -46,7 +46,7 @@ public void setUp() { bibEntryPPN591166003.setField(StandardField.SUBTITLE, "[revised and updated for JAVA SE 6]"); bibEntryPPN66391437X = new BibEntry(); - bibEntryPPN66391437X.setType(BibtexEntryType.Book); + bibEntryPPN66391437X.setType(StandardEntryType.Book); bibEntryPPN66391437X.setField(StandardField.TITLE, "Effective unit testing"); bibEntryPPN66391437X.setField(StandardField.PUBLISHER, "Manning"); bibEntryPPN66391437X.setField(StandardField.YEAR, "2013"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IEEETest.java b/src/test/java/org/jabref/logic/importer/fetcher/IEEETest.java index 9482ee85a40..112fc0f0efb 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IEEETest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/IEEETest.java @@ -10,7 +10,7 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; @@ -93,7 +93,7 @@ void notFoundByDOI() throws IOException { @Test void searchResultHasNoKeywordTerms() throws FetcherException { - BibEntry expected = new BibEntry(BibtexEntryType.Article); + BibEntry expected = new BibEntry(StandardEntryType.Article); expected.setField(StandardField.AUTHOR, "Shatakshi Jha and Ikhlaq Hussain and Bhim Singh and Sukumar Mishra"); expected.setField(StandardField.DATE, "25 2 2019"); @@ -115,7 +115,7 @@ void searchResultHasNoKeywordTerms() throws FetcherException { @Test void searchByQueryFindsEntry() throws Exception { - BibEntry expected = new BibEntry(BibtexEntryType.InProceedings); + BibEntry expected = new BibEntry(StandardEntryType.InProceedings); expected.setField(StandardField.AUTHOR, "Igor Steinmacher and Tayana Uchoa Conte and Christoph Treude and Marco Aurélio Gerosa"); expected.setField(StandardField.DATE, "14-22 May 2016"); expected.setField(StandardField.EVENTDATE, "14-22 May 2016"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/INSPIREFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/INSPIREFetcherTest.java index a5df7590395..239955ca8dd 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/INSPIREFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/INSPIREFetcherTest.java @@ -8,7 +8,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -31,7 +31,7 @@ void setUp() { @Test void searchByQueryFindsEntry() throws Exception { - BibEntry expected = new BibEntry(BibtexEntryType.MastersThesis); + BibEntry expected = new BibEntry(StandardEntryType.MastersThesis); expected.setCiteKey("Diez:2014ppa"); expected.setField(StandardField.AUTHOR, "Diez, Tobias"); expected.setField(StandardField.TITLE, "Slice theorem for Fr\\'echet group actions and covariant symplectic field theory"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java index d26a22cb5be..0c0a3c94531 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java @@ -11,7 +11,7 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -42,7 +42,7 @@ public void setUp() { fetcher = new IacrEprintFetcher(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS)); abram2017 = new BibEntry(); - abram2017.setType(BibtexEntryType.Misc); + abram2017.setType(StandardEntryType.Misc); abram2017.setCiteKey("cryptoeprint:2017:1118"); abram2017.setField(StandardField.ABSTRACT, "dummy"); abram2017.setField(StandardField.AUTHOR, "Ittai Abraham and Dahlia Malkhi and Kartik Nayak and Ling Ren and Alexander Spiegelman"); @@ -55,7 +55,7 @@ public void setUp() { abram2017.setField(StandardField.YEAR, "2017"); beierle2016 = new BibEntry(); - beierle2016.setType(BibtexEntryType.Misc); + beierle2016.setType(StandardEntryType.Misc); beierle2016.setCiteKey("cryptoeprint:2016:119"); beierle2016.setField(StandardField.ABSTRACT, "dummy"); beierle2016.setField(StandardField.AUTHOR, "Christof Beierle and Thorsten Kranz and Gregor Leander"); @@ -68,7 +68,7 @@ public void setUp() { beierle2016.setField(StandardField.YEAR, "2016"); delgado2017 = new BibEntry(); - delgado2017.setType(BibtexEntryType.Misc); + delgado2017.setType(StandardEntryType.Misc); delgado2017.setCiteKey("cryptoeprint:2017:1095"); delgado2017.setField(StandardField.ABSTRACT, "dummy"); delgado2017.setField(StandardField.AUTHOR, "Sergi Delgado-Segura and Cristina Pérez-Solà and Guillermo Navarro-Arribas and Jordi Herrera-Joancomartí"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IsbnFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/IsbnFetcherTest.java index eafad4abc3a..4c1fe285d31 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IsbnFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/IsbnFetcherTest.java @@ -9,7 +9,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -32,7 +32,7 @@ void setUp() { fetcher = new IsbnFetcher(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS)); bibEntry = new BibEntry(); - bibEntry.setType(BibtexEntryType.Book); + bibEntry.setType(StandardEntryType.Book); bibEntry.setCiteKey("9780134685991"); bibEntry.setField(StandardField.TITLE, "Effective Java"); bibEntry.setField(StandardField.PUBLISHER, "Addison Wesley"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcherTest.java index 73a10db7868..21fc0268564 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcherTest.java @@ -6,7 +6,7 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -23,7 +23,7 @@ public class IsbnViaChimboriFetcherTest extends AbstractIsbnFetcherTest { @BeforeEach public void setUp() { bibEntry = new BibEntry(); - bibEntry.setType(BibtexEntryType.Book); + bibEntry.setType(StandardEntryType.Book); bibEntry.setCiteKey("9780321356680"); bibEntry.setField(StandardField.TITLE, "Effective Java (2nd Edition)"); bibEntry.setField(StandardField.PUBLISHER, "Addison-Wesley"); @@ -70,7 +70,7 @@ public void searchByIdSuccessfulWithLongISBN() throws FetcherException { @Override public void authorsAreCorrectlyFormatted() throws Exception { BibEntry bibEntry = new BibEntry(); - bibEntry.setType(BibtexEntryType.Book); + bibEntry.setType(StandardEntryType.Book); bibEntry.setCiteKey("3642434738"); bibEntry.setField(StandardField.TITLE, "Fundamentals of Business Process Management"); bibEntry.setField(StandardField.PUBLISHER, "Springer"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java index b52f0b07a18..90d8b99902f 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java @@ -7,7 +7,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -23,7 +23,7 @@ public class IsbnViaEbookDeFetcherTest extends AbstractIsbnFetcherTest { @BeforeEach public void setUp() { bibEntry = new BibEntry(); - bibEntry.setType(BibtexEntryType.Book); + bibEntry.setType(StandardEntryType.Book); bibEntry.setCiteKey("9780134685991"); bibEntry.setField(StandardField.TITLE, "Effective Java"); bibEntry.setField(StandardField.PUBLISHER, "Addison Wesley"); @@ -67,7 +67,7 @@ public void searchByIdSuccessfulWithLongISBN() throws FetcherException { @Override public void authorsAreCorrectlyFormatted() throws Exception { BibEntry bibEntry = new BibEntry(); - bibEntry.setType(BibtexEntryType.Book); + bibEntry.setType(StandardEntryType.Book); bibEntry.setCiteKey("9783662585856"); bibEntry.setField(StandardField.TITLE, "Fundamentals of Business Process Management"); bibEntry.setField(StandardField.PUBLISHER, "Springer Berlin Heidelberg"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaOttoBibFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaOttoBibFetcherTest.java index 2a4badc1d93..c6f6a05fc77 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaOttoBibFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaOttoBibFetcherTest.java @@ -6,7 +6,7 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -22,7 +22,7 @@ public class IsbnViaOttoBibFetcherTest extends AbstractIsbnFetcherTest { @BeforeEach public void setUp() { bibEntry = new BibEntry(); - bibEntry.setType(BibtexEntryType.Book); + bibEntry.setType(StandardEntryType.Book); bibEntry.setCiteKey("bloch2008effective"); bibEntry.setField(StandardField.TITLE, "Effective Java"); bibEntry.setField(StandardField.PUBLISHER, "Addison-Wesley"); @@ -66,7 +66,7 @@ public void searchByIdSuccessfulWithLongISBN() throws FetcherException { @Override public void authorsAreCorrectlyFormatted() throws Exception { BibEntry bibEntry = new BibEntry(); - bibEntry.setType(BibtexEntryType.Book); + bibEntry.setType(StandardEntryType.Book); bibEntry.setCiteKey("dumas2018fundamentals"); bibEntry.setField(StandardField.TITLE, "Fundamentals of business process management"); bibEntry.setField(StandardField.PUBLISHER, "Springer"); @@ -82,7 +82,7 @@ public void authorsAreCorrectlyFormatted() throws Exception { @Test public void testISBNNotAvaiableOnEbookDeOrChimbori() throws Exception { bibEntry = new BibEntry(); - bibEntry.setType(BibtexEntryType.Book); + bibEntry.setType(StandardEntryType.Book); bibEntry.setCiteKey("denis2012les"); bibEntry.setField(StandardField.TITLE, "Les mots du passé : roman"); bibEntry.setField(StandardField.PUBLISHER, "Éd. les Nouveaux auteurs"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/MathSciNetTest.java b/src/test/java/org/jabref/logic/importer/fetcher/MathSciNetTest.java index 1f655b5f084..6bf142f76ab 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/MathSciNetTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/MathSciNetTest.java @@ -8,7 +8,7 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; @@ -34,7 +34,7 @@ void setUp() throws Exception { fetcher = new MathSciNet(importFormatPreferences); ratiuEntry = new BibEntry(); - ratiuEntry.setType(BibtexEntryType.Article); + ratiuEntry.setType(StandardEntryType.Article); ratiuEntry.setCiteKey("MR3537908"); ratiuEntry.setField(StandardField.AUTHOR, "Chechkin, Gregory A. and Ratiu, Tudor S. and Romanov, Maxim S. and Samokhin, Vyacheslav N."); ratiuEntry.setField(StandardField.TITLE, "Existence and uniqueness theorems for the two-dimensional {E}ricksen-{L}eslie system"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java index 2ebf55c64fe..578e8cdb569 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java @@ -8,7 +8,7 @@ import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -28,7 +28,7 @@ public void setUp() { fetcher = new MedlineFetcher(); entryWijedasa = new BibEntry(); - entryWijedasa.setType(BibtexEntryType.Article); + entryWijedasa.setType(StandardEntryType.Article); entryWijedasa.setField(StandardField.AUTHOR, "Wijedasa, Lahiru S. and Jauhiainen, Jyrki and Könönen, Mari and Lampela, Maija and Vasander, Harri and Leblanc, Marie-Claire and Evers, Stephanie and Smith, Thomas E. L. and Yule, Catherine M. and Varkkey, Helena and Lupascu, Massimo and Parish, Faizal and Singleton, Ian and Clements, Gopalasamy R. and Aziz, Sheema Abdul and Harrison, Mark E. and Cheyne, Susan and Anshari, Gusti Z. and Meijaard, Erik and Goldstein, Jenny E. and Waldron, Susan and Hergoualc'h, Kristell and Dommain, Rene and Frolking, Steve and Evans, Christopher D. and Posa, Mary Rose C. and Glaser, Paul H. and Suryadiputra, Nyoman and Lubis, Reza and Santika, Truly and Padfield, Rory and Kurnianto, Sofyan and Hadisiswoyo, Panut and Lim, Teck Wyn and Page, Susan E. and Gauci, Vincent and Van Der Meer, Peter J. and Buckland, Helen and Garnier, Fabien and Samuel, Marshall K. and Choo, Liza Nuriati Lim Kim and O'Reilly, Patrick and Warren, Matthew and Suksuwan, Surin and Sumarga, Elham and Jain, Anuj and Laurance, William F. and Couwenberg, John and Joosten, Hans and Vernimmen, Ronald and Hooijer, Aljosja and Malins, Chris and Cochrane, Mark A. and Perumal, Balu and Siegert, Florian and Peh, Kelvin S.-H. and Comeau, Louis-Pierre and Verchot, Louis and Harvey, Charles F. and Cobb, Alex and Jaafar, Zeehan and Wösten, Henk and Manuri, Solichin and Müller, Moritz and Giesen, Wim and Phelps, Jacob and Yong, Ding Li and Silvius, Marcel and Wedeux, Béatrice M. M. and Hoyt, Alison and Osaki, Mitsuru and Hirano, Takashi and Takahashi, Hidenori and Kohyama, Takashi S. and Haraguchi, Akira and Nugroho, Nunung P. and Coomes, David A. and Quoi, Le Phat and Dohong, Alue and Gunawan, Haris and Gaveau, David L. A. and Langner, Andreas and Lim, Felix K. S. and Edwards, David P. and Giam, Xingli and Van Der Werf, Guido and Carmenta, Rachel and Verwer, Caspar C. and Gibson, Luke and Gandois, Laure and Graham, Laura Linda Bozena and Regalino, Jhanson and Wich, Serge A. and Rieley, Jack and Kettridge, Nicholas and Brown, Chloe and Pirard, Romain and Moore, Sam and Capilla, B. Ripoll and Ballhorn, Uwe and Ho, Hua Chew and Hoscilo, Agata and Lohberger, Sandra and Evans, Theodore A. and Yulianti, Nina and Blackham, Grace and Onrizal and Husson, Simon and Murdiyarso, Daniel and Pangala, Sunita and Cole, Lydia E. S. and Tacconi, Luca and Segah, Hendrik and Tonoto, Prayoto and Lee, Janice S. H. and Schmilewski, Gerald and Wulffraat, Stephan and Putra, Erianto Indra and Cattau, Megan E. and Clymo, R. S. and Morrison, Ross and Mujahid, Aazani and Miettinen, Jukka and Liew, Soo Chin and Valpola, Samu and Wilson, David and D'Arcy, Laura and Gerding, Michiel and Sundari, Siti and Thornton, Sara A. and Kalisz, Barbara and Chapman, Stephen J. and Su, Ahmad Suhaizi Mat and Basuki, Imam and Itoh, Masayuki and Traeholt, Carl and Sloan, Sean and Sayok, Alexander K. and Andersen, Roxane"); entryWijedasa.setField(new UnknownField("country"), "England"); entryWijedasa.setField(StandardField.DOI, "10.1111/gcb.13516"); @@ -49,7 +49,7 @@ public void setUp() { entryWijedasa.setField(StandardField.YEAR, "2017"); entryEndharti = new BibEntry(); - entryEndharti.setType(BibtexEntryType.Article); + entryEndharti.setType(StandardEntryType.Article); entryEndharti.setField(StandardField.TITLE, "Dendrophthoe pentandra (L.) Miq extract effectively inhibits inflammation, proliferation and induces p53 expression on colitis-associated colon cancer."); entryEndharti.setField(StandardField.AUTHOR, "Endharti, Agustina Tri and Wulandari, Adisti and Listyana, Anik and Norahmawati, Eviana and Permana, Sofy"); entryEndharti.setField(new UnknownField("country"), "England"); @@ -73,7 +73,7 @@ public void setUp() { entryEndharti.setField(StandardField.YEAR, "2016"); bibEntryIchikawa = new BibEntry(); - bibEntryIchikawa.setType(BibtexEntryType.Article); + bibEntryIchikawa.setType(StandardEntryType.Article); bibEntryIchikawa.setField(StandardField.AUTHOR, "Ichikawa-Seki, Madoka and Guswanto, Azirwan and Allamanda, Puttik and Mariamah, Euis Siti and Wibowo, Putut Eko and Igarashi, Ikuo and Nishikawa, Yoshifumi"); bibEntryIchikawa.setField(new UnknownField("chemicals"), "Antibodies, Protozoan, Antigens, Protozoan, GRA7 protein, Toxoplasma gondii, Protozoan Proteins"); bibEntryIchikawa.setField(new UnknownField("citation-subset"), "IM"); @@ -99,7 +99,7 @@ public void setUp() { bibEntryIchikawa.setField(StandardField.YEAR, "2015"); bibEntrySari = new BibEntry(); - bibEntrySari.setType(BibtexEntryType.Article); + bibEntrySari.setType(StandardEntryType.Article); bibEntrySari.setField(StandardField.AUTHOR, "Sari, Yulia and Haryati, Sri and Raharjo, Irvan and Prasetyo, Afiono Agung"); bibEntrySari.setField(new UnknownField("chemicals"), "Antibodies, Protozoan, Antibodies, Viral, HTLV-I Antibodies, HTLV-II Antibodies, Hepatitis Antibodies, Hepatitis B Antibodies, Hepatitis C Antibodies, Immunoglobulin G, Immunoglobulin M"); bibEntrySari.setField(new UnknownField("citation-subset"), "IM"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java index af2573e3ec2..2cea53e900f 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java @@ -5,7 +5,7 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -26,7 +26,7 @@ public void setUp() { fetcher = new RfcFetcher(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS)); bibEntry = new BibEntry(); - bibEntry.setType(BibtexEntryType.Misc); + bibEntry.setType(StandardEntryType.Misc); bibEntry.setField(StandardField.SERIES, "Request for Comments"); bibEntry.setField(StandardField.NUMBER, "1945"); bibEntry.setField(StandardField.HOWPUBLISHED, "RFC 1945"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java index c82ce9fea8e..063b561a4cf 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java @@ -6,7 +6,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.json.JSONObject; @@ -27,7 +27,7 @@ void setUp() { @Test void searchByQueryFindsEntry() throws Exception { - BibEntry expected = new BibEntry(BibtexEntryType.Article); + BibEntry expected = new BibEntry(StandardEntryType.Article); expected.setField(StandardField.AUTHOR, "Steinmacher, Igor and Gerosa, Marco and Conte, Tayana U. and Redmiles, David F."); expected.setField(StandardField.DATE, "2018-06-14"); expected.setField(StandardField.DOI, "10.1007/s10606-018-9335-z"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java index 518e252925a..aadd223f5cf 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java @@ -6,7 +6,7 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; @@ -27,7 +27,7 @@ public void setUp() { fetcher = new TitleFetcher(mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS)); bibEntryBischof2009 = new BibEntry(); - bibEntryBischof2009.setType(BibtexEntryType.InProceedings); + bibEntryBischof2009.setType(StandardEntryType.InProceedings); bibEntryBischof2009.setCiteKey("Bischof_2009"); bibEntryBischof2009.setField(StandardField.AUTHOR, "Marc Bischof and Oliver Kopp and Tammo van Lessen and Frank Leymann"); bibEntryBischof2009.setField(StandardField.BOOKTITLE, "2009 35th Euromicro Conference on Software Engineering and Advanced Applications"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ZbMATHTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ZbMATHTest.java index 5245a990d1a..55a77da28ca 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ZbMATHTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ZbMATHTest.java @@ -8,7 +8,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; @@ -32,7 +32,7 @@ void setUp() throws Exception { fetcher = new ZbMATH(importFormatPreferences); donaldsonEntry = new BibEntry(); - donaldsonEntry.setType(BibtexEntryType.Article); + donaldsonEntry.setType(StandardEntryType.Article); donaldsonEntry.setCiteKey("zbMATH03800580"); donaldsonEntry.setField(StandardField.AUTHOR, "S.K. {Donaldson}"); donaldsonEntry.setField(StandardField.JOURNAL, "Journal of Differential Geometry"); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestTypes.java b/src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestTypes.java index 3c96f66682a..18f415931be 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestTypes.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/BibTeXMLImporterTestTypes.java @@ -10,8 +10,8 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; @@ -25,19 +25,19 @@ public class BibTeXMLImporterTestTypes { public static Collection types() { return Arrays.asList( - BibtexEntryType.Article, - BibtexEntryType.Book, - BibtexEntryType.Booklet, - BibtexEntryType.Conference, - BibtexEntryType.InBook, - BibtexEntryType.InCollection, - BibtexEntryType.InProceedings, - BibtexEntryType.Manual, - BibtexEntryType.MastersThesis, - BibtexEntryType.Misc, - BibtexEntryType.PhdThesis, - BibtexEntryType.TechReport, - BibtexEntryType.Unpublished); + StandardEntryType.Article, + StandardEntryType.Book, + StandardEntryType.Booklet, + StandardEntryType.Conference, + StandardEntryType.InBook, + StandardEntryType.InCollection, + StandardEntryType.InProceedings, + StandardEntryType.Manual, + StandardEntryType.MastersThesis, + StandardEntryType.Misc, + StandardEntryType.PhdThesis, + StandardEntryType.TechReport, + StandardEntryType.Unpublished); } @ParameterizedTest diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTestTypes.java b/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTestTypes.java index 22665d81623..387d057fd74 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTestTypes.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTestTypes.java @@ -9,8 +9,8 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; @@ -21,15 +21,15 @@ class BiblioscapeImporterTestTypes { private static Stream types() { return Stream.of( - Arguments.of("journal", BibtexEntryType.Article), - Arguments.of("book section", BibtexEntryType.InBook), - Arguments.of("book", BibtexEntryType.Book), - Arguments.of("conference", BibtexEntryType.InProceedings), - Arguments.of("proceedings", BibtexEntryType.InProceedings), - Arguments.of("report", BibtexEntryType.TechReport), - Arguments.of("master thesis", BibtexEntryType.MastersThesis), - Arguments.of("thesis", BibtexEntryType.PhdThesis), - Arguments.of("master", BibtexEntryType.Misc) + Arguments.of("journal", StandardEntryType.Article), + Arguments.of("book section", StandardEntryType.InBook), + Arguments.of("book", StandardEntryType.Book), + Arguments.of("conference", StandardEntryType.InProceedings), + Arguments.of("proceedings", StandardEntryType.InProceedings), + Arguments.of("report", StandardEntryType.TechReport), + Arguments.of("master thesis", StandardEntryType.MastersThesis), + Arguments.of("thesis", StandardEntryType.PhdThesis), + Arguments.of("master", StandardEntryType.Misc) ); } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java b/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java index 3dc2bb6299b..71b452cdd8b 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java @@ -32,7 +32,7 @@ import org.jabref.model.entry.field.OrFields; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.entry.types.UnknownEntryType; import org.jabref.model.groups.AllEntriesGroup; import org.jabref.model.groups.ExplicitGroup; @@ -83,7 +83,7 @@ void fromStringRecognizesEntry() throws ParseException { .parseEntries("@article{test,author={Ed von Test}}"); BibEntry expected = new BibEntry(); - expected.setType(BibtexEntryType.Article); + expected.setType(StandardEntryType.Article); expected.setCiteKey("test"); expected.setField(StandardField.AUTHOR, "Ed von Test"); @@ -114,7 +114,7 @@ void singleFromStringRecognizesEntry() throws ParseException { importFormatPreferences, fileMonitor); BibEntry expected = new BibEntry(); - expected.setType(BibtexEntryType.Article); + expected.setType(StandardEntryType.Article); expected.setCiteKey("canh05"); expected.setField(StandardField.AUTHOR, "Crowston, K. and Annabi, H."); expected.setField(StandardField.TITLE, "Title A"); @@ -156,7 +156,7 @@ void parseRecognizesEntry() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Ed von Test"), entry.getField(StandardField.AUTHOR)); @@ -171,7 +171,7 @@ void parseQuotedEntries() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Ed von Test"), entry.getField(StandardField.AUTHOR)); @@ -185,7 +185,7 @@ void parseRecognizesEntryOnlyWithKey() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); } @@ -198,7 +198,7 @@ void parseRecognizesEntryWithWhitespaceAtBegining() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Ed von Test"), entry.getField(StandardField.AUTHOR)); @@ -213,7 +213,7 @@ void parseRecognizesEntryWithWhitespace() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Ed von Test"), entry.getField(StandardField.AUTHOR)); @@ -228,7 +228,7 @@ void parseRecognizesEntryWithNewlines() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Ed von Test"), entry.getField(StandardField.AUTHOR)); @@ -273,7 +273,7 @@ void parseRecognizesEntryInParenthesis() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Ed von Test"), entry.getField(StandardField.AUTHOR)); @@ -287,7 +287,7 @@ void parseRecognizesEntryWithBigNumbers() throws IOException { Collection parsed = result.getDatabase().getEntries(); BibEntry entry = parsed.iterator().next(); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("canh05"), entry.getCiteKeyOptional()); assertEquals(Optional.of("1234567890123456789"), entry.getField(StandardField.ISBN)); assertEquals(Optional.of("1234567890123456789"), entry.getField(new UnknownField("isbn2"))); @@ -302,7 +302,7 @@ void parseRecognizesBibtexKeyWithSpecialCharacters() throws IOException { Collection parsed = result.getDatabase().getEntries(); BibEntry entry = parsed.iterator().next(); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("te_st:with-special(characters)"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Ed von Test"), entry.getField(StandardField.AUTHOR)); @@ -317,7 +317,7 @@ void parseRecognizesEntryWhereLastFieldIsFinishedWithComma() throws IOException BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Ed von Test"), entry.getField(StandardField.AUTHOR)); @@ -330,8 +330,8 @@ void parseRecognizesEntryWithAtInField() throws IOException { List parsed = result.getDatabase().getEntries(); - BibEntry expected = new BibEntry(BibtexEntryType.Article).withField(InternalField.KEY_FIELD, "test") - .withField(StandardField.AUTHOR, "Ed von T@st"); + BibEntry expected = new BibEntry(StandardEntryType.Article).withField(InternalField.KEY_FIELD, "test") + .withField(StandardField.AUTHOR, "Ed von T@st"); assertEquals(Collections.singletonList(expected), parsed); } @@ -341,7 +341,7 @@ void parseRecognizesEntryPrecedingComment() throws IOException { String comment = "@Comment{@article{myarticle,}" + OS.NEWLINE + "@inproceedings{blabla, title={the proceedings of bl@bl@}; }" + OS.NEWLINE + "}"; String entryWithComment = comment + OS.NEWLINE + "@article{test,author={Ed von T@st}}"; - BibEntry expected = new BibEntry(BibtexEntryType.Article) + BibEntry expected = new BibEntry(StandardEntryType.Article) .withField(InternalField.KEY_FIELD, "test") .withField(StandardField.AUTHOR, "Ed von T@st"); expected.setCommentsBeforeEntry(comment); @@ -357,14 +357,14 @@ void parseRecognizesEntryPrecedingComment() throws IOException { void parseRecognizesMultipleEntries() throws IOException { List expected = new ArrayList<>(); BibEntry firstEntry = new BibEntry(); - firstEntry.setType(BibtexEntryType.Article); + firstEntry.setType(StandardEntryType.Article); firstEntry.setCiteKey("canh05"); firstEntry.setField(StandardField.AUTHOR, "Crowston, K. and Annabi, H."); firstEntry.setField(StandardField.TITLE, "Title A"); expected.add(firstEntry); BibEntry secondEntry = new BibEntry(); - secondEntry.setType(BibtexEntryType.InProceedings); + secondEntry.setType(StandardEntryType.InProceedings); secondEntry.setCiteKey("foo"); secondEntry.setField(StandardField.AUTHOR, "Norton Bar"); expected.add(secondEntry); @@ -399,12 +399,12 @@ void parseSetsParsedSerialization() throws IOException { void parseRecognizesMultipleEntriesOnSameLine() throws IOException { List expected = new ArrayList<>(); BibEntry firstEntry = new BibEntry(); - firstEntry.setType(BibtexEntryType.Article); + firstEntry.setType(StandardEntryType.Article); firstEntry.setCiteKey("canh05"); expected.add(firstEntry); BibEntry secondEntry = new BibEntry(); - secondEntry.setType(BibtexEntryType.InProceedings); + secondEntry.setType(StandardEntryType.InProceedings); secondEntry.setCiteKey("foo"); expected.add(secondEntry); @@ -424,7 +424,7 @@ void parseCombinesMultipleAuthorFields() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Ed von Test and Second Author and Third Author"), entry.getField(StandardField.AUTHOR)); @@ -439,7 +439,7 @@ void parseCombinesMultipleEditorFields() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Ed von Test and Second Author and Third Author"), entry.getField(StandardField.EDITOR)); @@ -454,7 +454,7 @@ void parseCombinesMultipleKeywordsFields() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Test, Second Keyword, Third Keyword"), entry.getField(StandardField.KEYWORDS)); @@ -475,7 +475,7 @@ void parseRecognizesHeaderButIgnoresEncoding() throws IOException { assertEquals(Optional.empty(), result.getMetaData().getEncoding()); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.InProceedings, entry.getType()); + assertEquals(StandardEntryType.InProceedings, entry.getType()); assertEquals(8, entry.getFields().size()); assertEquals(Optional.of("CroAnnHow05"), entry.getCiteKeyOptional()); assertEquals(Optional.of("Crowston, K. and Annabi, H. and Howison, J. and Masango, C."), entry.getField(StandardField.AUTHOR)); @@ -503,7 +503,7 @@ void parseRecognizesFormatedEntry() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.InProceedings, entry.getType()); + assertEquals(StandardEntryType.InProceedings, entry.getType()); assertEquals(8, entry.getFields().size()); assertEquals(Optional.of("CroAnnHow05"), entry.getCiteKeyOptional()); assertEquals(Optional.of("Crowston, K. and Annabi, H. and Howison, J. and Masango, C."), entry.getField(StandardField.AUTHOR)); @@ -526,7 +526,7 @@ void parseRecognizesFieldValuesInQuotationMarks() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Ed von Test"), entry.getField(StandardField.AUTHOR)); @@ -541,7 +541,7 @@ void parseRecognizesNumbersWithoutBracketsOrQuotationMarks() throws IOException BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("2005"), entry.getField(StandardField.YEAR)); @@ -556,7 +556,7 @@ void parseRecognizesUppercaseFields() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Ed von Test"), entry.getField(StandardField.AUTHOR)); @@ -571,7 +571,7 @@ void parseRecognizesAbsoluteFile() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("D:\\Documents\\literature\\Tansel-PRL2006.pdf"), entry.getField(StandardField.FILE)); @@ -586,7 +586,7 @@ void parseRecognizesDateFieldWithConcatenation() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("1-4~#nov#"), entry.getField(StandardField.DATE)); @@ -632,7 +632,7 @@ void parseRecognizesDuplicateBibtexKeys() throws IOException { void parseNotWarnsAboutEntryWithoutBibtexKey() throws IOException { BibEntry expected = new BibEntry(); expected.setField(StandardField.AUTHOR, "Ed von Test"); - expected.setType(BibtexEntryType.Article); + expected.setType(StandardEntryType.Article); ParserResult result = parser .parse(new StringReader("@article{,author={Ed von Test}}")); @@ -662,7 +662,7 @@ void parseAddsEscapedOpenBracketToFieldValue() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(Optional.of("escaped \\{ bracket"), entry.getField(StandardField.REVIEW)); assertFalse(result.hasWarnings()); @@ -677,7 +677,7 @@ void parseAddsEscapedClosingBracketToFieldValue() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(Optional.of("escaped \\} bracket"), entry.getField(StandardField.REVIEW)); assertFalse(result.hasWarnings()); @@ -744,7 +744,7 @@ void parseRecognizesEntryWithAtSymbolInQuotationMarks() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("author @ good"), entry.getField(StandardField.AUTHOR)); @@ -759,7 +759,7 @@ void parseRecognizesFieldsWithBracketsEnclosedInQuotationMarks() throws IOExcept BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Test {Ed {von} Test}"), entry.getField(StandardField.AUTHOR)); @@ -775,7 +775,7 @@ void parseRecognizesFieldsWithEscapedQuotationMarks() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Test {\" Test}"), entry.getField(StandardField.AUTHOR)); @@ -802,7 +802,7 @@ void parseIgnoresAndWarnsAboutCorruptedEntryButRecognizeOthers() throws IOExcept BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(2, entry.getFields().size()); assertEquals(Optional.of("Ed von Test"), entry.getField(StandardField.AUTHOR)); @@ -818,7 +818,7 @@ void parseRecognizesMonthFieldsWithFollowingComma() throws IOException { BibEntry entry = parsed.iterator().next(); assertEquals(1, parsed.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("test"), entry.getCiteKeyOptional()); assertEquals(3, entry.getFields().size()); assertEquals(Optional.of("Ed von Test"), entry.getField(StandardField.AUTHOR)); @@ -951,7 +951,7 @@ void parseRecognizesStringAndEntry() throws IOException { assertEquals("bourdieu", parsedString.getName()); assertEquals("Bourdieu, Pierre", parsedString.getContent()); assertEquals(1, parsedEntries.size()); - assertEquals(BibtexEntryType.Book, parsedEntry.getType()); + assertEquals(StandardEntryType.Book, parsedEntry.getType()); assertEquals(Optional.of("bourdieu-2002-questions-sociologie"), parsedEntry.getCiteKeyOptional()); assertEquals(Optional.of("Paris"), parsedEntry.getField(StandardField.ADDRESS)); assertEquals(Optional.of("#bourdieu#"), parsedEntry.getField(StandardField.AUTHOR)); @@ -995,7 +995,7 @@ void parseIgnoresCommentsBeforeEntry() throws IOException { BibEntry parsedEntry = parsedEntries.iterator().next(); assertEquals(1, parsedEntries.size()); - assertEquals(BibtexEntryType.Article, parsedEntry.getType()); + assertEquals(StandardEntryType.Article, parsedEntry.getType()); assertEquals(Optional.of("test"), parsedEntry.getCiteKeyOptional()); assertEquals(2, parsedEntry.getFields().size()); assertEquals(Optional.of("Ed von Test"), parsedEntry.getField(StandardField.AUTHOR)); @@ -1010,7 +1010,7 @@ void parseIgnoresCommentsAfterEntry() throws IOException { BibEntry parsedEntry = parsedEntries.iterator().next(); assertEquals(1, parsedEntries.size()); - assertEquals(BibtexEntryType.Article, parsedEntry.getType()); + assertEquals(StandardEntryType.Article, parsedEntry.getType()); assertEquals(Optional.of("test"), parsedEntry.getCiteKeyOptional()); assertEquals(2, parsedEntry.getFields().size()); assertEquals(Optional.of("Ed von Test"), parsedEntry.getField(StandardField.AUTHOR)); @@ -1033,7 +1033,7 @@ void parseIgnoresTextBeforeEntry() throws IOException { BibEntry parsedEntry = parsedEntries.iterator().next(); assertEquals(1, parsedEntries.size()); - assertEquals(BibtexEntryType.Article, parsedEntry.getType()); + assertEquals(StandardEntryType.Article, parsedEntry.getType()); assertEquals(Optional.of("test"), parsedEntry.getCiteKeyOptional()); assertEquals(2, parsedEntry.getFields().size()); assertEquals(Optional.of("Ed von Test"), parsedEntry.getField(StandardField.AUTHOR)); @@ -1048,7 +1048,7 @@ void parseIgnoresTextAfterEntry() throws IOException { BibEntry parsedEntry = parsedEntries.iterator().next(); assertEquals(1, parsedEntries.size()); - assertEquals(BibtexEntryType.Article, parsedEntry.getType()); + assertEquals(StandardEntryType.Article, parsedEntry.getType()); assertEquals(Optional.of("test"), parsedEntry.getCiteKeyOptional()); assertEquals(2, parsedEntry.getFields().size()); assertEquals(Optional.of("Ed von Test"), parsedEntry.getField(StandardField.AUTHOR)); @@ -1146,7 +1146,7 @@ void parseHandlesAccentsCorrectly() throws IOException { assertFalse(result.hasWarnings()); assertEquals(1, parsedEntries.size()); - assertEquals(BibtexEntryType.Article, parsedEntry.getType()); + assertEquals(StandardEntryType.Article, parsedEntry.getType()); assertEquals(Optional.of("test"), parsedEntry.getCiteKeyOptional()); assertEquals(Optional.of("H\'{e}lne Fiaux"), parsedEntry.getField(StandardField.AUTHOR)); } @@ -1165,7 +1165,7 @@ void parsePreambleAndEntryWithoutNewLine() throws IOException { assertFalse(result.hasWarnings()); assertEquals(Optional.of("some text and \\latex"), result.getDatabase().getPreamble()); assertEquals(1, parsedEntries.size()); - assertEquals(BibtexEntryType.Article, parsedEntry.getType()); + assertEquals(StandardEntryType.Article, parsedEntry.getType()); assertEquals(Optional.of("test"), parsedEntry.getCiteKeyOptional()); assertEquals(Optional.of("H\'{e}lne Fiaux"), parsedEntry.getField(StandardField.AUTHOR)); } @@ -1362,7 +1362,7 @@ void integrationTestCustomKeyPattern() throws IOException { AbstractBibtexKeyPattern bibtexKeyPattern = result.getMetaData().getCiteKeyPattern(pattern); AbstractBibtexKeyPattern expectedPattern = new DatabaseBibtexKeyPattern(pattern); expectedPattern.setDefaultValue("test"); - expectedPattern.addBibtexKeyPattern(BibtexEntryType.Article, "articleTest"); + expectedPattern.addBibtexKeyPattern(StandardEntryType.Article, "articleTest"); assertEquals(expectedPattern, bibtexKeyPattern); } @@ -1495,17 +1495,17 @@ void integrationTestFileDirectories() throws IOException { void parseReturnsEntriesInSameOrder() throws IOException { List expected = new ArrayList<>(); BibEntry first = new BibEntry(); - first.setType(BibtexEntryType.Article); + first.setType(StandardEntryType.Article); first.setCiteKey("a"); expected.add(first); BibEntry second = new BibEntry(); - second.setType(BibtexEntryType.Article); + second.setType(StandardEntryType.Article); second.setCiteKey("b"); expected.add(second); BibEntry third = new BibEntry(); - third.setType(BibtexEntryType.InProceedings); + third.setType(StandardEntryType.InProceedings); third.setCiteKey("c"); expected.add(third); @@ -1567,7 +1567,7 @@ void parseCommentAndEntryInOneLine() throws IOException { @Test void preserveEncodingPrefixInsideEntry() throws ParseException { BibEntry expected = new BibEntry(); - expected.setType(BibtexEntryType.Article); + expected.setType(StandardEntryType.Article); expected.setCiteKey("test"); expected.setField(StandardField.AUTHOR, SavePreferences.ENCODING_PREFIX); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java index 084b08a08c6..de1bb49f04e 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java @@ -16,7 +16,7 @@ import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -87,13 +87,13 @@ public void testImportEntries0() throws IOException, URISyntaxException { assertEquals(5, bibEntries.size()); BibEntry first = bibEntries.get(0); - assertEquals(BibtexEntryType.Misc, first.getType()); + assertEquals(StandardEntryType.Misc, first.getType()); assertEquals(Optional.of("testA0 and testA1"), first.getField(StandardField.AUTHOR)); assertEquals(Optional.of("testE0 and testE1"), first.getField(StandardField.EDITOR)); assertEquals(Optional.of("testT"), first.getField(StandardField.TITLE)); BibEntry second = bibEntries.get(1); - assertEquals(BibtexEntryType.Misc, second.getType()); + assertEquals(StandardEntryType.Misc, second.getType()); assertEquals(Optional.of("testC"), second.getField(StandardField.ADDRESS)); assertEquals(Optional.of("testB2"), second.getField(StandardField.BOOKTITLE)); assertEquals(Optional.of("test8"), second.getField(StandardField.DATE)); @@ -102,16 +102,16 @@ public void testImportEntries0() throws IOException, URISyntaxException { assertEquals(Optional.of("testD"), second.getField(StandardField.YEAR)); BibEntry third = bibEntries.get(2); - assertEquals(BibtexEntryType.Article, third.getType()); + assertEquals(StandardEntryType.Article, third.getType()); assertEquals(Optional.of("testB0"), third.getField(StandardField.JOURNAL)); BibEntry fourth = bibEntries.get(3); - assertEquals(BibtexEntryType.Book, fourth.getType()); + assertEquals(StandardEntryType.Book, fourth.getType()); assertEquals(Optional.of("testI0"), fourth.getField(StandardField.PUBLISHER)); assertEquals(Optional.of("testB1"), fourth.getField(StandardField.SERIES)); BibEntry fifth = bibEntries.get(4); - assertEquals(BibtexEntryType.MastersThesis, fifth.getType()); + assertEquals(StandardEntryType.MastersThesis, fifth.getType()); assertEquals(Optional.of("testX"), fifth.getField(StandardField.ABSTRACT)); assertEquals(Optional.of("testF"), fifth.getCiteKeyOptional()); assertEquals(Optional.of("testR"), fifth.getField(StandardField.DOI)); @@ -133,7 +133,7 @@ public void testImportEntries1() throws IOException { BibEntry entry = bibEntries.get(0); assertEquals(1, bibEntries.size()); - assertEquals(BibtexEntryType.Misc, entry.getType()); + assertEquals(StandardEntryType.Misc, entry.getType()); assertEquals(Optional.of("testA"), entry.getField(StandardField.AUTHOR)); assertEquals(Optional.of("testE0, testE1"), entry.getField(StandardField.EDITOR)); assertEquals(Optional.of("testO"), entry.getField(StandardField.PAGES)); @@ -147,7 +147,7 @@ public void testImportEntriesBookExample() throws IOException, URISyntaxExceptio BibEntry entry = bibEntries.get(0); assertEquals(1, bibEntries.size()); - assertEquals(BibtexEntryType.Book, entry.getType()); + assertEquals(StandardEntryType.Book, entry.getType()); assertEquals(Optional.of("Heidelberg"), entry.getField(StandardField.ADDRESS)); assertEquals(Optional.of("Preißel, René and Stachmann, Bjørn"), entry.getField(StandardField.AUTHOR)); assertEquals(Optional.of("3., aktualisierte und erweiterte Auflage"), entry.getField(StandardField.EDITION)); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java index 54a3229e749..60de76aff26 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java @@ -13,7 +13,7 @@ import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -58,7 +58,7 @@ public void testIsRecognizedFormatReject(String fileName) throws IOException { @Test public void testCompleteBibtexEntryOnJournalPaperImport() throws IOException, URISyntaxException { - BibEntry expectedEntry = new BibEntry(BibtexEntryType.Article); + BibEntry expectedEntry = new BibEntry(StandardEntryType.Article); expectedEntry.setField(StandardField.TITLE, "The SIS project : software reuse with a natural language approach"); expectedEntry.setField(StandardField.AUTHOR, "Prechelt, Lutz"); expectedEntry.setField(StandardField.YEAR, "1992"); @@ -78,7 +78,7 @@ public void importConferencePaperGivesInproceedings() throws IOException { "\n" + "RT ~ Conference-Paper\n" + "AU ~ Prechelt, Lutz"; - BibEntry expectedEntry = new BibEntry(BibtexEntryType.InProceedings); + BibEntry expectedEntry = new BibEntry(StandardEntryType.InProceedings); expectedEntry.setField(StandardField.AUTHOR, "Prechelt, Lutz"); try (BufferedReader reader = new BufferedReader(new StringReader(testInput))) { @@ -93,7 +93,7 @@ public void importMiscGivesMisc() throws IOException { "\n" + "AU ~ Prechelt, Lutz \n" + "RT ~ Misc"; - BibEntry expectedEntry = new BibEntry(BibtexEntryType.Misc); + BibEntry expectedEntry = new BibEntry(StandardEntryType.Misc); expectedEntry.setField(StandardField.AUTHOR, "Prechelt, Lutz"); try (BufferedReader reader = new BufferedReader(new StringReader(testInput))) { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java index e01342e7340..daa7834214b 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java @@ -16,7 +16,7 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -140,7 +140,7 @@ public void testImportEntries1() throws IOException, URISyntaxException { Optional.of( "James Brown and James Marc Brown and Brown, J. M. and Brown, J. and Brown, J. M. and Brown, J."), entry.getField(StandardField.AUTHOR)); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("Optical Materials"), entry.getField(StandardField.JOURNAL)); assertEquals(Optional.of("2006"), entry.getField(StandardField.YEAR)); assertEquals(Optional.of("28"), entry.getField(StandardField.VOLUME)); @@ -157,7 +157,7 @@ public void testImportEntries2() throws IOException, URISyntaxException { assertEquals(3, entries.size()); assertEquals(Optional.of("Optical properties of MgO doped LiNbO$_3$ single crystals"), entry.getField(StandardField.TITLE)); - assertEquals(BibtexEntryType.Misc, entry.getType()); + assertEquals(StandardEntryType.Misc, entry.getType()); assertEquals(Optional.of("Optical Materials"), entry.getField(StandardField.JOURNAL)); assertEquals(Optional.of("2006"), entry.getField(StandardField.YEAR)); assertEquals(Optional.of("28"), entry.getField(StandardField.VOLUME)); @@ -185,7 +185,7 @@ public void testImportEntriesINSPEC() throws IOException, URISyntaxException { Optional.of( "Second harmonic generation of continuous wave ultraviolet light and production of beta -BaB$_2$O$_4$ optical waveguides"), first.getField(StandardField.TITLE)); - assertEquals(BibtexEntryType.Article, first.getType()); + assertEquals(StandardEntryType.Article, first.getType()); assertEquals(Optional.of("Degl'Innocenti, R. and Guarino, A. and Poberaj, G. and Gunter, P."), first.getField(StandardField.AUTHOR)); @@ -199,7 +199,7 @@ public void testImportEntriesINSPEC() throws IOException, URISyntaxException { assertEquals( Optional.of("Optical and photoelectric spectroscopy of photorefractive Sn$_2$P$_2$S$_6$ crystals"), second.getField(StandardField.TITLE)); - assertEquals(BibtexEntryType.Article, second.getType()); + assertEquals(StandardEntryType.Article, second.getType()); } @Test @@ -265,7 +265,7 @@ public void testImportIEEEExport() throws IOException, URISyntaxException { BibEntry entry = entries.get(0); assertEquals(1, entries.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("Geoscience and Remote Sensing Letters, IEEE"), entry.getField(StandardField.JOURNAL)); assertEquals(Optional.of("Improving Urban Road Extraction in High-Resolution " + "Images Exploiting Directional Filtering, Perceptual " + "Grouping, and Simple Topological Concepts"), @@ -288,7 +288,7 @@ public void testIEEEImport() throws IOException, URISyntaxException { BibEntry entry = entries.get(0); assertEquals(1, entries.size()); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("Geoscience and Remote Sensing Letters, IEEE"), entry.getField(StandardField.JOURNAL)); assertEquals( Optional.of( @@ -324,7 +324,7 @@ public void testImportEntriesMedline() throws IOException, URISyntaxException { assertEquals(Optional.of("12"), first.getField(StandardField.VOLUME)); assertEquals(Optional.of("20"), first.getField(StandardField.NUMBER)); assertEquals(Optional.of("2457--71"), first.getField(StandardField.PAGES)); - assertEquals(BibtexEntryType.Article, first.getType()); + assertEquals(StandardEntryType.Article, first.getType()); assertEquals( Optional.of( "Estrogen therapy selectively enhances prefrontal cognitive processes: a randomized, double-blind, placebo-controlled study with functional magnetic resonance imaging in perimenopausal and recently postmenopausal women."), @@ -338,7 +338,7 @@ public void testImportEntriesMedline() throws IOException, URISyntaxException { assertEquals(Optional.of("13"), second.getField(StandardField.VOLUME)); assertEquals(Optional.of("3"), second.getField(StandardField.NUMBER)); assertEquals(Optional.of("411--22"), second.getField(StandardField.PAGES)); - assertEquals(BibtexEntryType.Article, second.getType()); + assertEquals(StandardEntryType.Article, second.getType()); } @Test diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java index 1b6de9a3b5c..536ecb8009d 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java @@ -19,7 +19,7 @@ import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.apache.commons.codec.Charsets; import org.junit.jupiter.api.BeforeEach; @@ -85,7 +85,7 @@ void testImportMultipleEntriesInSingleFile() throws IOException, URISyntaxExcept BibEntry testEntry = entries.get(0); assertEquals(7, entries.size()); - assertEquals(BibtexEntryType.Article, testEntry.getType()); + assertEquals(StandardEntryType.Article, testEntry.getType()); assertEquals(Optional.empty(), testEntry.getField(StandardField.MONTH)); assertEquals(Optional.of("Long, Vicky and Marland, Hilary"), testEntry.getField(StandardField.AUTHOR)); assertEquals( @@ -94,32 +94,32 @@ void testImportMultipleEntriesInSingleFile() throws IOException, URISyntaxExcept testEntry.getField(StandardField.TITLE)); testEntry = entries.get(1); - assertEquals(BibtexEntryType.Conference, testEntry.getType()); + assertEquals(StandardEntryType.Conference, testEntry.getType()); assertEquals(Optional.of("06"), testEntry.getField(StandardField.MONTH)); assertEquals(Optional.empty(), testEntry.getField(StandardField.AUTHOR)); assertEquals(Optional.empty(), testEntry.getField(StandardField.TITLE)); testEntry = entries.get(2); - assertEquals(BibtexEntryType.Book, testEntry.getType()); + assertEquals(StandardEntryType.Book, testEntry.getType()); assertEquals( Optional.of( "This is a Testtitle: This title should be appended: This title should also be appended. Another append to the Title? LastTitle"), testEntry.getField(StandardField.TITLE)); testEntry = entries.get(3); - assertEquals(BibtexEntryType.TechReport, testEntry.getType()); + assertEquals(StandardEntryType.TechReport, testEntry.getType()); assertTrue(testEntry.getField(StandardField.DOI).isPresent()); testEntry = entries.get(4); - assertEquals(BibtexEntryType.InProceedings, testEntry.getType()); + assertEquals(StandardEntryType.InProceedings, testEntry.getType()); assertEquals(Optional.of("Inproceedings book title"), testEntry.getField(StandardField.BOOKTITLE)); - BibEntry expectedEntry5 = new BibEntry(BibtexEntryType.Proceedings); + BibEntry expectedEntry5 = new BibEntry(StandardEntryType.Proceedings); expectedEntry5.setField(StandardField.KEYWORDS, "Female"); assertEquals(expectedEntry5, entries.get(5)); BibEntry expectedEntry6 = new BibEntry(); - expectedEntry6.setType(BibtexEntryType.Misc); + expectedEntry6.setType(StandardEntryType.Misc); expectedEntry6.setField(StandardField.KEYWORDS, "Female"); assertEquals(expectedEntry6, entries.get(6)); } @@ -234,7 +234,7 @@ void testAllArticleTypes() throws IOException { List actualEntries = importer.importDatabase(reader).getDatabase().getEntries(); BibEntry expectedEntry = new BibEntry(); - expectedEntry.setType(BibtexEntryType.Article); + expectedEntry.setType(StandardEntryType.Article); expectedEntry.setField(StandardField.KEYWORDS, "Female"); assertEquals(Collections.singletonList(expectedEntry), actualEntries); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java index fa80686ab15..b3ea3c95c33 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java @@ -17,7 +17,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -95,14 +95,14 @@ public void testImportEntries1() throws IOException, URISyntaxException { assertEquals(5, entries.size()); BibEntry entry = entries.get(0); - assertEquals(BibtexEntryType.Misc, entry.getType()); + assertEquals(StandardEntryType.Misc, entry.getType()); assertEquals(Optional.of("Mustermann and Musterfrau"), entry.getField(StandardField.AUTHOR)); assertEquals(Optional.of("Short abstract"), entry.getField(StandardField.ABSTRACT)); assertEquals(Optional.of("Musterbuch"), entry.getField(StandardField.TITLE)); assertEquals(Optional.of("Einleitung"), entry.getField(new UnknownField("chaptertitle"))); entry = entries.get(1); - assertEquals(BibtexEntryType.InProceedings, entry.getType()); + assertEquals(StandardEntryType.InProceedings, entry.getType()); assertEquals(Optional.of("Max"), entry.getField(StandardField.EDITOR)); assertEquals(Optional.of("Max the Editor"), entry.getField(StandardField.TITLE)); assertEquals(Optional.of("Very Long Title"), entry.getField(StandardField.JOURNAL)); @@ -112,7 +112,7 @@ public void testImportEntries1() throws IOException, URISyntaxException { assertEquals(Optional.of("103--106"), entry.getField(StandardField.PAGES)); entry = entries.get(2); - assertEquals(BibtexEntryType.InCollection, entry.getType()); + assertEquals(StandardEntryType.InCollection, entry.getType()); assertEquals(Optional.of("Max"), entry.getField(StandardField.AUTHOR)); assertEquals(Optional.of("Test"), entry.getField(StandardField.TITLE)); assertEquals(Optional.of("Very Long Title"), entry.getField(StandardField.JOURNAL)); @@ -123,7 +123,7 @@ public void testImportEntries1() throws IOException, URISyntaxException { assertEquals(Optional.of("103--106"), entry.getField(StandardField.PAGES)); entry = entries.get(3); - assertEquals(BibtexEntryType.Book, entry.getType()); + assertEquals(StandardEntryType.Book, entry.getType()); assertEquals(Optional.of("Max"), entry.getField(StandardField.AUTHOR)); assertEquals(Optional.of("2015"), entry.getField(StandardField.YEAR)); assertEquals(Optional.of("Editor"), entry.getField(StandardField.EDITOR)); @@ -133,7 +133,7 @@ public void testImportEntries1() throws IOException, URISyntaxException { assertEquals(Optional.of("Publisher"), entry.getField(StandardField.PUBLISHER)); entry = entries.get(4); - assertEquals(BibtexEntryType.Article, entry.getType()); + assertEquals(StandardEntryType.Article, entry.getType()); assertEquals(Optional.of("2014"), entry.getField(StandardField.YEAR)); assertEquals(Optional.of("58"), entry.getField(StandardField.PAGES)); assertEquals(Optional.of("Test"), entry.getField(StandardField.ADDRESS)); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java index 093b0ec4822..6a1c7b2b2e4 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java @@ -12,7 +12,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -52,7 +52,7 @@ void importTwiceWorksAsExpected() throws Exception { Path file = Paths.get(PdfContentImporter.class.getResource("/pdfs/minimal.pdf").toURI()); List result = importer.importDatabase(file, StandardCharsets.UTF_8).getDatabase().getEntries(); - BibEntry expected = new BibEntry(BibtexEntryType.InProceedings); + BibEntry expected = new BibEntry(StandardEntryType.InProceedings); expected.setField(StandardField.AUTHOR, "1 "); expected.setField(StandardField.TITLE, "Hello World"); expected.setFiles(Collections.singletonList(new LinkedFile("", file.toAbsolutePath(), "PDF"))); @@ -65,7 +65,7 @@ void importTwiceWorksAsExpected() throws Exception { @Test void testParsingEditorWithoutPagesorSeriesInformation() { - BibEntry entry = new BibEntry(BibtexEntryType.InProceedings); + BibEntry entry = new BibEntry(StandardEntryType.InProceedings); entry.setField(StandardField.AUTHOR, "Anke Lüdeling and Merja Kytö (Eds.)"); entry.setField(StandardField.EDITOR, "Anke Lüdeling and Merja Kytö"); entry.setField(StandardField.PUBLISHER, "Springer"); diff --git a/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java b/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java index 6e65a734359..fbfb3f556c9 100644 --- a/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java +++ b/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java @@ -22,9 +22,9 @@ import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.IEEETranEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.metadata.FilePreferences; import org.jabref.model.metadata.MetaData; @@ -41,10 +41,10 @@ class IntegrityCheckTest { @Test void testEntryTypeChecks() { - assertCorrect(withMode(createContext(StandardField.TITLE, "sometitle", BibtexEntryType.Article), BibDatabaseMode.BIBTEX)); + assertCorrect(withMode(createContext(StandardField.TITLE, "sometitle", StandardEntryType.Article), BibDatabaseMode.BIBTEX)); assertWrong(withMode(createContext(StandardField.TITLE, "sometitle", IEEETranEntryType.Patent), BibDatabaseMode.BIBTEX)); assertCorrect((withMode(createContext(StandardField.TITLE, "sometitle", IEEETranEntryType.Patent), BibDatabaseMode.BIBLATEX))); - assertCorrect(withMode(createContext(StandardField.TITLE, "sometitle", BibtexEntryType.Article), BibDatabaseMode.BIBLATEX)); + assertCorrect(withMode(createContext(StandardField.TITLE, "sometitle", StandardEntryType.Article), BibDatabaseMode.BIBLATEX)); } @Test @@ -240,14 +240,14 @@ void fileCheckFindsFilesRelativeToBibFile(@TempDir Path testFolder) throws IOExc @Test void testTypeChecks() { - assertCorrect(createContext(StandardField.PAGES, "11--15", BibtexEntryType.InProceedings)); - assertWrong(createContext(StandardField.PAGES, "11--15", BibtexEntryType.Proceedings)); + assertCorrect(createContext(StandardField.PAGES, "11--15", StandardEntryType.InProceedings)); + assertWrong(createContext(StandardField.PAGES, "11--15", StandardEntryType.Proceedings)); } @Test void testBooktitleChecks() { - assertCorrect(createContext(StandardField.BOOKTITLE, "2014 Fourth International Conference on Digital Information and Communication Technology and it's Applications (DICTAP)", BibtexEntryType.Proceedings)); - assertWrong(createContext(StandardField.BOOKTITLE, "Digital Information and Communication Technology and it's Applications (DICTAP), 2014 Fourth International Conference on", BibtexEntryType.Proceedings)); + assertCorrect(createContext(StandardField.BOOKTITLE, "2014 Fourth International Conference on Digital Information and Communication Technology and it's Applications (DICTAP)", StandardEntryType.Proceedings)); + assertWrong(createContext(StandardField.BOOKTITLE, "Digital Information and Communication Technology and it's Applications (DICTAP), 2014 Fourth International Conference on", StandardEntryType.Proceedings)); } @Test diff --git a/src/test/java/org/jabref/logic/layout/LayoutTest.java b/src/test/java/org/jabref/logic/layout/LayoutTest.java index c920beee10b..368e1bd5fc2 100644 --- a/src/test/java/org/jabref/logic/layout/LayoutTest.java +++ b/src/test/java/org/jabref/logic/layout/LayoutTest.java @@ -10,7 +10,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.entry.types.UnknownEntryType; import org.junit.jupiter.api.BeforeEach; @@ -47,21 +47,21 @@ void entryTypeForUnknown() throws IOException { @Test void entryTypeForArticle() throws IOException { - BibEntry entry = new BibEntry(BibtexEntryType.Article).withField(StandardField.AUTHOR, "test"); + BibEntry entry = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "test"); assertEquals("Article", layout("\\bibtextype", entry)); } @Test void entryTypeForMisc() throws IOException { - BibEntry entry = new BibEntry(BibtexEntryType.Misc).withField(StandardField.AUTHOR, "test"); + BibEntry entry = new BibEntry(StandardEntryType.Misc).withField(StandardField.AUTHOR, "test"); assertEquals("Misc", layout("\\bibtextype", entry)); } @Test void HTMLChar() throws IOException { - BibEntry entry = new BibEntry(BibtexEntryType.Article).withField(StandardField.AUTHOR, "This\nis\na\ntext"); + BibEntry entry = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "This\nis\na\ntext"); String actual = layout("\\begin{author}\\format[HTMLChars]{\\author}\\end{author}", entry); @@ -70,7 +70,7 @@ void HTMLChar() throws IOException { @Test void HTMLCharWithDoubleLineBreak() throws IOException { - BibEntry entry = new BibEntry(BibtexEntryType.Article).withField(StandardField.AUTHOR, "This\nis\na\n\ntext"); + BibEntry entry = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "This\nis\na\n\ntext"); String layoutText = layout("\\begin{author}\\format[HTMLChars]{\\author}\\end{author} ", entry); @@ -79,7 +79,7 @@ void HTMLCharWithDoubleLineBreak() throws IOException { @Test void nameFormatter() throws IOException { - BibEntry entry = new BibEntry(BibtexEntryType.Article).withField(StandardField.AUTHOR, "Joe Doe and Jane, Moon"); + BibEntry entry = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Joe Doe and Jane, Moon"); String layoutText = layout("\\begin{author}\\format[NameFormatter]{\\author}\\end{author}", entry); @@ -88,7 +88,7 @@ void nameFormatter() throws IOException { @Test void HTMLCharsWithDotlessIAndTiled() throws IOException { - BibEntry entry = new BibEntry(BibtexEntryType.Article) + BibEntry entry = new BibEntry(StandardEntryType.Article) .withField(StandardField.ABSTRACT, "\\~{n} \\~n \\'i \\i \\i"); String layoutText = layout( @@ -107,7 +107,7 @@ void HTMLCharsWithDotlessIAndTiled() throws IOException { void wrapFileLinksExpandFile() throws IOException { when(layoutFormatterPreferences.getFileLinkPreferences()).thenReturn( new FileLinkPreferences(Collections.emptyList(), Collections.singletonList("src/test/resources/pdfs/"))); - BibEntry entry = new BibEntry(BibtexEntryType.Article); + BibEntry entry = new BibEntry(StandardEntryType.Article); entry.addFile(new LinkedFile("Test file", "encrypted.pdf", "PDF")); String layoutText = layout("\\begin{file}\\format[WrapFileLinks(\\i. \\d (\\p))]{\\file}\\end{file}", entry); @@ -119,7 +119,7 @@ void wrapFileLinksExpandFile() throws IOException { @Test void expandCommandIfTerminatedByMinus() throws IOException { - BibEntry entry = new BibEntry(BibtexEntryType.Article).withField(StandardField.EDITION, "2"); + BibEntry entry = new BibEntry(StandardEntryType.Article).withField(StandardField.EDITION, "2"); String layoutText = layout("\\edition-th ed.-", entry); @@ -130,7 +130,7 @@ void expandCommandIfTerminatedByMinus() throws IOException { void customNameFormatter() throws IOException { when(layoutFormatterPreferences.getNameFormatterPreferences()).thenReturn( new NameFormatterPreferences(Collections.singletonList("DCA"), Collections.singletonList("1@*@{ll}@@2@1..1@{ff}{ll}@2..2@ and {ff}{l}@@*@*@more"))); - BibEntry entry = new BibEntry(BibtexEntryType.Article).withField(StandardField.AUTHOR, "Joe Doe and Mary Jane"); + BibEntry entry = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Joe Doe and Mary Jane"); String layoutText = layout("\\begin{author}\\format[DCA]{\\author}\\end{author}", entry); diff --git a/src/test/java/org/jabref/logic/openoffice/OOBibStyleTest.java b/src/test/java/org/jabref/logic/openoffice/OOBibStyleTest.java index 7459b0fa969..c08c319e581 100644 --- a/src/test/java/org/jabref/logic/openoffice/OOBibStyleTest.java +++ b/src/test/java/org/jabref/logic/openoffice/OOBibStyleTest.java @@ -22,7 +22,7 @@ import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.entry.types.UnknownEntryType; import org.jabref.model.util.DummyFileUpdateMonitor; @@ -177,7 +177,7 @@ public void testLayout() throws IOException { "Boström, G.; Wäyrynen, J.; Bodén, M.; Beznosov, K. and Kruchten, P. (2006). Extending XP practices to support security requirements engineering, : 11-18.", l.doLayout(entry, db)); - l = style.getReferenceFormat(BibtexEntryType.InCollection); + l = style.getReferenceFormat(StandardEntryType.InCollection); l.setPostFormatter(new OOPreFormatter()); assertEquals( "Boström, G.; Wäyrynen, J.; Bodén, M.; Beznosov, K. and Kruchten, P. (2006). Extending XP practices to support security requirements engineering. In: (Ed.), SESS '06: Proceedings of the 2006 international workshop on Software engineering for secure systems, ACM.", @@ -190,11 +190,11 @@ public void testInstitutionAuthor() throws IOException { layoutFormatterPreferences); BibDatabase database = new BibDatabase(); - Layout l = style.getReferenceFormat(BibtexEntryType.Article); + Layout l = style.getReferenceFormat(StandardEntryType.Article); l.setPostFormatter(new OOPreFormatter()); BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "{JabRef Development Team}"); entry.setField(StandardField.TITLE, "JabRef Manual"); entry.setField(StandardField.YEAR, "2016"); @@ -209,11 +209,11 @@ public void testVonAuthor() throws IOException { layoutFormatterPreferences); BibDatabase database = new BibDatabase(); - Layout l = style.getReferenceFormat(BibtexEntryType.Article); + Layout l = style.getReferenceFormat(StandardEntryType.Article); l.setPostFormatter(new OOPreFormatter()); BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "Alpha von Beta"); entry.setField(StandardField.TITLE, "JabRef Manual"); entry.setField(StandardField.YEAR, "2016"); @@ -232,7 +232,7 @@ public void testInstitutionAuthorMarker() throws IOException { BibDatabase database = new BibDatabase(); BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "{JabRef Development Team}"); entry.setField(StandardField.TITLE, "JabRef Manual"); entry.setField(StandardField.YEAR, "2016"); @@ -252,7 +252,7 @@ public void testVonAuthorMarker() throws IOException { BibDatabase database = new BibDatabase(); BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "Alpha von Beta"); entry.setField(StandardField.TITLE, "JabRef Manual"); entry.setField(StandardField.YEAR, "2016"); @@ -272,7 +272,7 @@ public void testNullAuthorMarker() throws IOException { BibDatabase database = new BibDatabase(); BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); entry.setField(StandardField.YEAR, "2016"); database.insertEntry(entry); entries.add(entry); @@ -290,7 +290,7 @@ public void testNullYearMarker() throws IOException { BibDatabase database = new BibDatabase(); BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "Alpha von Beta"); database.insertEntry(entry); entries.add(entry); @@ -308,7 +308,7 @@ public void testEmptyEntryMarker() throws IOException { BibDatabase database = new BibDatabase(); BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); database.insertEntry(entry); entries.add(entry); entryDBMap.put(entry, database); @@ -504,7 +504,7 @@ public void testEmptyStringPropertyAndOxfordComma() throws URISyntaxException, I BibDatabase database = new BibDatabase(); BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "Alpha von Beta and Gamma Epsilon and Ypsilon Tau"); entry.setField(StandardField.TITLE, "JabRef Manual"); entry.setField(StandardField.YEAR, "2016"); diff --git a/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java b/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java index f4f8a427fcb..22b48a39759 100644 --- a/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java +++ b/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java @@ -6,7 +6,7 @@ import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -45,7 +45,7 @@ public void testGetDatabaseFromMatchesDatabaseWithEmptyEntries() { @Test public void testNoMatchesFromDatabaseWithArticleTypeEntry() { - BibEntry entry = new BibEntry(BibtexEntryType.Article); + BibEntry entry = new BibEntry(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "harrer"); database.insertEntry(entry); List matches = new DatabaseSearcher(new SearchQuery("whatever", true, true), database).getMatches(); @@ -54,7 +54,7 @@ public void testNoMatchesFromDatabaseWithArticleTypeEntry() { @Test public void testCorrectMatchFromDatabaseWithArticleTypeEntry() { - BibEntry entry = new BibEntry(BibtexEntryType.Article); + BibEntry entry = new BibEntry(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "harrer"); database.insertEntry(entry); List matches = new DatabaseSearcher(new SearchQuery("harrer", true, true), database).getMatches(); @@ -72,7 +72,7 @@ public void testNoMatchesFromEmptyDatabaseWithInvalidQuery() { @Test public void testCorrectMatchFromDatabaseWithIncollectionTypeEntry() { - BibEntry entry = new BibEntry(BibtexEntryType.InCollection); + BibEntry entry = new BibEntry(StandardEntryType.InCollection); entry.setField(StandardField.AUTHOR, "tonho"); database.insertEntry(entry); @@ -87,7 +87,7 @@ public void testNoMatchesFromDatabaseWithTwoEntries() { BibEntry entry = new BibEntry(); database.insertEntry(entry); - entry = new BibEntry(BibtexEntryType.InCollection); + entry = new BibEntry(StandardEntryType.InCollection); entry.setField(StandardField.AUTHOR, "tonho"); database.insertEntry(entry); @@ -99,7 +99,7 @@ public void testNoMatchesFromDatabaseWithTwoEntries() { @Test public void testNoMatchesFromDabaseWithIncollectionTypeEntry() { - BibEntry entry = new BibEntry(BibtexEntryType.InCollection); + BibEntry entry = new BibEntry(StandardEntryType.InCollection); entry.setField(StandardField.AUTHOR, "tonho"); database.insertEntry(entry); diff --git a/src/test/java/org/jabref/logic/search/SearchQueryTest.java b/src/test/java/org/jabref/logic/search/SearchQueryTest.java index 949fd81085b..d430eab0e3f 100644 --- a/src/test/java/org/jabref/logic/search/SearchQueryTest.java +++ b/src/test/java/org/jabref/logic/search/SearchQueryTest.java @@ -5,7 +5,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.Test; @@ -61,7 +61,7 @@ public void testGrammarSearchFullEntry() { @Test public void testSearchingForOpenBraketInBooktitle() { - BibEntry e = new BibEntry(BibtexEntryType.InProceedings); + BibEntry e = new BibEntry(StandardEntryType.InProceedings); e.setField(StandardField.BOOKTITLE, "Super Conference (SC)"); SearchQuery searchQuery = new SearchQuery("booktitle=\"(\"", false, false); @@ -70,7 +70,7 @@ public void testSearchingForOpenBraketInBooktitle() { @Test public void testSearchMatchesSingleKeywordNotPart() { - BibEntry e = new BibEntry(BibtexEntryType.InProceedings); + BibEntry e = new BibEntry(StandardEntryType.InProceedings); e.setField(StandardField.KEYWORDS, "banana, pineapple, orange"); SearchQuery searchQuery = new SearchQuery("anykeyword==apple", false, false); @@ -79,7 +79,7 @@ public void testSearchMatchesSingleKeywordNotPart() { @Test public void testSearchMatchesSingleKeyword() { - BibEntry e = new BibEntry(BibtexEntryType.InProceedings); + BibEntry e = new BibEntry(StandardEntryType.InProceedings); e.setField(StandardField.KEYWORDS, "banana, pineapple, orange"); SearchQuery searchQuery = new SearchQuery("anykeyword==pineapple", false, false); @@ -88,7 +88,7 @@ public void testSearchMatchesSingleKeyword() { @Test public void testSearchAllFields() { - BibEntry e = new BibEntry(BibtexEntryType.InProceedings); + BibEntry e = new BibEntry(StandardEntryType.InProceedings); e.setField(StandardField.TITLE, "Fruity features"); e.setField(StandardField.KEYWORDS, "banana, pineapple, orange"); @@ -98,7 +98,7 @@ public void testSearchAllFields() { @Test public void testSearchAllFieldsNotForSpecificField() { - BibEntry e = new BibEntry(BibtexEntryType.InProceedings); + BibEntry e = new BibEntry(StandardEntryType.InProceedings); e.setField(StandardField.TITLE, "Fruity features"); e.setField(StandardField.KEYWORDS, "banana, pineapple, orange"); @@ -108,7 +108,7 @@ public void testSearchAllFieldsNotForSpecificField() { @Test public void testSearchAllFieldsAndSpecificField() { - BibEntry e = new BibEntry(BibtexEntryType.InProceedings); + BibEntry e = new BibEntry(StandardEntryType.InProceedings); e.setField(StandardField.TITLE, "Fruity features"); e.setField(StandardField.KEYWORDS, "banana, pineapple, orange"); @@ -119,10 +119,10 @@ public void testSearchAllFieldsAndSpecificField() { @Test public void testIsMatch() { BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "asdf"); - assertFalse(new SearchQuery("qwer", true, true).isMatch(entry)); + assertFalse(new SearchQuery("BiblatexEntryType", true, true).isMatch(entry)); assertTrue(new SearchQuery("asdf", true, true).isMatch(entry)); assertTrue(new SearchQuery("author=asdf", true, true).isMatch(entry)); } @@ -180,7 +180,7 @@ public void testIsValidQueryWithNumbersAndEqualSignNotAsRegEx() { @Test public void isMatchedForNormalAndFieldBasedSearchMixed() { BibEntry entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "asdf"); entry.setField(StandardField.ABSTRACT, "text"); diff --git a/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java b/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java index 05d9286f23d..52006447666 100644 --- a/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java +++ b/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java @@ -18,7 +18,7 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.DatabaseTest; import org.junit.jupiter.api.AfterEach; @@ -104,7 +104,7 @@ void testUpdateEntry(DBMSType dbmsType, DBMSConnection dbmsConnection, DBMSProce dbmsProcessor.insertEntry(expectedEntry); - expectedEntry.setType(BibtexEntryType.Book); + expectedEntry.setType(StandardEntryType.Book); expectedEntry.setField(StandardField.AUTHOR, "Michael J and Hutchings"); expectedEntry.setField(new UnknownField("customField"), "custom value"); expectedEntry.clearField(StandardField.BOOKTITLE); @@ -284,7 +284,7 @@ private BibEntry getBibEntryExampleWithEmptyFields() { } private BibEntry getBibEntryExample() { - BibEntry bibEntry = new BibEntry(BibtexEntryType.InProceedings); + BibEntry bibEntry = new BibEntry(StandardEntryType.InProceedings); bibEntry.setField(StandardField.AUTHOR, "Wirthlin, Michael J and Hutchings, Brad L and Gilson, Kent L"); bibEntry.setField(StandardField.TITLE, "The nano processor: a low resource reconfigurable processor"); bibEntry.setField(StandardField.BOOKTITLE, "FPGAs for Custom Computing Machines, 1994. Proceedings. IEEE Workshop on"); diff --git a/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java b/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java index 4f048c971e6..2575e069719 100644 --- a/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java +++ b/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java @@ -24,7 +24,7 @@ import org.jabref.model.entry.event.EntryEventSource; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.metadata.MetaData; import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.testutils.category.DatabaseTest; @@ -178,7 +178,7 @@ public void testSynchronizeLocalDatabaseWithEntryUpdate() throws OfflineLockExce BibEntry modifiedBibEntry = getBibEntryExample(1); modifiedBibEntry.setField(new UnknownField("custom"), "custom value"); modifiedBibEntry.clearField(StandardField.TITLE); - modifiedBibEntry.setType(BibtexEntryType.Article); + modifiedBibEntry.setType(StandardEntryType.Article); dbmsProcessor.updateEntry(modifiedBibEntry); //testing point @@ -204,7 +204,7 @@ public void testApplyMetaData() { private BibEntry getBibEntryExample(int index) { BibEntry bibEntry = new BibEntry(); - bibEntry.setType(BibtexEntryType.Book); + bibEntry.setType(StandardEntryType.Book); bibEntry.setField(StandardField.AUTHOR, "Wirthlin, Michael J" + index); bibEntry.setField(StandardField.TITLE, "The nano processor" + index); bibEntry.getSharedBibEntryData().setSharedID(index); diff --git a/src/test/java/org/jabref/logic/shared/SynchronizationTestSimulator.java b/src/test/java/org/jabref/logic/shared/SynchronizationTestSimulator.java index 3cefd63d508..d694a697f7e 100644 --- a/src/test/java/org/jabref/logic/shared/SynchronizationTestSimulator.java +++ b/src/test/java/org/jabref/logic/shared/SynchronizationTestSimulator.java @@ -13,7 +13,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.testutils.category.DatabaseTest; @@ -163,7 +163,7 @@ public void simulateEntryChangeConflicts() { } private BibEntry getBibEntryExample(int index) { - BibEntry bibEntry = new BibEntry(BibtexEntryType.InProceedings); + BibEntry bibEntry = new BibEntry(StandardEntryType.InProceedings); bibEntry.setField(StandardField.AUTHOR, "Wirthlin, Michael J and Hutchings, Brad L and Gilson, Kent L " + index); bibEntry.setField(StandardField.TITLE, "The nano processor: a low resource reconfigurable processor " + index); bibEntry.setField(StandardField.BOOKTITLE, "FPGAs for Custom Computing Machines, 1994. Proceedings. IEEE Workshop on " + index); diff --git a/src/test/java/org/jabref/logic/texparser/TexBibEntriesResolverTest.java b/src/test/java/org/jabref/logic/texparser/TexBibEntriesResolverTest.java index d409488499d..6c5816b630f 100644 --- a/src/test/java/org/jabref/logic/texparser/TexBibEntriesResolverTest.java +++ b/src/test/java/org/jabref/logic/texparser/TexBibEntriesResolverTest.java @@ -8,7 +8,7 @@ import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.texparser.TexBibEntriesResolverResult; import org.jabref.model.texparser.TexParserResult; @@ -34,7 +34,7 @@ public class TexBibEntriesResolverTest { private void setUp() { database = new BibDatabase(); - BibEntry darwin = new BibEntry(BibtexEntryType.Book) + BibEntry darwin = new BibEntry(StandardEntryType.Book) .withCiteKey(DARWIN) .withField(StandardField.TITLE, "The descent of man, and selection in relation to sex") .withField(StandardField.PUBLISHER, "J. Murray") @@ -42,7 +42,7 @@ private void setUp() { .withField(StandardField.AUTHOR, "Darwin, Charles"); database.insertEntry(darwin); - BibEntry einstein = new BibEntry(BibtexEntryType.Book) + BibEntry einstein = new BibEntry(StandardEntryType.Book) .withCiteKey(EINSTEIN) .withField(StandardField.TITLE, "Relativity: The special and general theory") .withField(StandardField.PUBLISHER, "Penguin") @@ -50,7 +50,7 @@ private void setUp() { .withField(StandardField.AUTHOR, "Einstein, Albert"); database.insertEntry(einstein); - BibEntry newton = new BibEntry(BibtexEntryType.Book) + BibEntry newton = new BibEntry(StandardEntryType.Book) .withCiteKey(NEWTON) .withField(StandardField.TITLE, "The Principia: mathematical principles of natural philosophy") .withField(StandardField.PUBLISHER, "Univ of California Press") @@ -58,19 +58,19 @@ private void setUp() { .withField(StandardField.AUTHOR, "Newton, Isaac"); database.insertEntry(newton); - BibEntry einsteinA = new BibEntry(BibtexEntryType.Book) + BibEntry einsteinA = new BibEntry(StandardEntryType.Book) .withCiteKey(EINSTEIN_A) .withField(StandardField.CROSSREF, "Einstein1920") .withField(StandardField.PAGES, "22--23"); database.insertEntry(einsteinA); - BibEntry einsteinB = new BibEntry(BibtexEntryType.Book) + BibEntry einsteinB = new BibEntry(StandardEntryType.Book) .withCiteKey(EINSTEIN_B) .withField(StandardField.CROSSREF, "Einstein1921") .withField(StandardField.PAGES, "22--23"); database.insertEntry(einsteinB); - BibEntry einsteinC = new BibEntry(BibtexEntryType.Book) + BibEntry einsteinC = new BibEntry(StandardEntryType.Book) .withCiteKey(EINSTEIN_C) .withField(StandardField.CROSSREF, "Einstein1920") .withField(StandardField.PAGES, "25--33"); diff --git a/src/test/java/org/jabref/logic/texparser/TexParserTest.java b/src/test/java/org/jabref/logic/texparser/TexParserTest.java index c9a2b668b60..4bb0e614caa 100644 --- a/src/test/java/org/jabref/logic/texparser/TexParserTest.java +++ b/src/test/java/org/jabref/logic/texparser/TexParserTest.java @@ -8,7 +8,7 @@ import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.texparser.TexBibEntriesResolverResult; import org.jabref.model.texparser.TexParserResult; @@ -36,7 +36,7 @@ private void setUp() { database = new BibDatabase(); database2 = new BibDatabase(); - BibEntry darwin = new BibEntry(BibtexEntryType.Book) + BibEntry darwin = new BibEntry(StandardEntryType.Book) .withCiteKey(DARWIN) .withField(StandardField.TITLE, "The descent of man, and selection in relation to sex") .withField(StandardField.PUBLISHER, "J. Murray") @@ -44,7 +44,7 @@ private void setUp() { .withField(StandardField.AUTHOR, "Darwin, Charles"); database.insertEntry(darwin); - BibEntry einstein = new BibEntry(BibtexEntryType.Book) + BibEntry einstein = new BibEntry(StandardEntryType.Book) .withCiteKey(EINSTEIN) .withField(StandardField.TITLE, "Relativity: The special and general theory") .withField(StandardField.PUBLISHER, "Penguin") @@ -53,7 +53,7 @@ private void setUp() { database.insertEntry(einstein); database2.insertEntry(einstein); - BibEntry newton = new BibEntry(BibtexEntryType.Book) + BibEntry newton = new BibEntry(StandardEntryType.Book) .withCiteKey(NEWTON) .withField(StandardField.TITLE, "The Principia: mathematical principles of natural philosophy") .withField(StandardField.PUBLISHER, "Univ of California Press") @@ -61,19 +61,19 @@ private void setUp() { .withField(StandardField.AUTHOR, "Newton, Isaac"); database.insertEntry(newton); - BibEntry einsteinA = new BibEntry(BibtexEntryType.Book) + BibEntry einsteinA = new BibEntry(StandardEntryType.Book) .withCiteKey(EINSTEIN_A) .withField(StandardField.CROSSREF, "Einstein1920") .withField(StandardField.PAGES, "22--23"); database.insertEntry(einsteinA); - BibEntry einsteinB = new BibEntry(BibtexEntryType.Book) + BibEntry einsteinB = new BibEntry(StandardEntryType.Book) .withCiteKey(EINSTEIN_B) .withField(StandardField.CROSSREF, "Einstein1921") .withField(StandardField.PAGES, "22--23"); database.insertEntry(einsteinB); - BibEntry einsteinC = new BibEntry(BibtexEntryType.Book) + BibEntry einsteinC = new BibEntry(StandardEntryType.Book) .withCiteKey(EINSTEIN_C) .withField(StandardField.CROSSREF, "Einstein1920") .withField(StandardField.PAGES, "25--33"); diff --git a/src/test/java/org/jabref/logic/util/BracketedPatternTest.java b/src/test/java/org/jabref/logic/util/BracketedPatternTest.java index 9cf25aefe0f..5e2cd0511e9 100644 --- a/src/test/java/org/jabref/logic/util/BracketedPatternTest.java +++ b/src/test/java/org/jabref/logic/util/BracketedPatternTest.java @@ -5,7 +5,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibtexString; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,7 +28,7 @@ public void setUp() throws Exception { bibentry.setField(StandardField.PAGES, "213--216"); dbentry = new BibEntry(); - dbentry.setType(BibtexEntryType.Article); + dbentry.setType(StandardEntryType.Article); dbentry.setCiteKey("HipKro03"); dbentry.setField(StandardField.AUTHOR, "Eric von Hippel and Georg von Krogh"); dbentry.setField(StandardField.TITLE, "Open Source Software and the \"Private-Collective\" Innovation Model: Issues for Organization Science"); diff --git a/src/test/java/org/jabref/logic/util/io/CiteKeyBasedFileFinderTest.java b/src/test/java/org/jabref/logic/util/io/CiteKeyBasedFileFinderTest.java index 25349ba634e..a6678557fb4 100644 --- a/src/test/java/org/jabref/logic/util/io/CiteKeyBasedFileFinderTest.java +++ b/src/test/java/org/jabref/logic/util/io/CiteKeyBasedFileFinderTest.java @@ -8,7 +8,7 @@ import java.util.List; import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -27,7 +27,7 @@ class CiteKeyBasedFileFinderTest { @BeforeEach void setUp(@TempDir Path temporaryFolder) throws IOException { - entry = new BibEntry(BibtexEntryType.Article); + entry = new BibEntry(StandardEntryType.Article); entry.setCiteKey("HipKro03"); rootDir = temporaryFolder; diff --git a/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTests.java b/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTests.java index 5f6b6700e90..8110322183c 100644 --- a/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTests.java +++ b/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTests.java @@ -8,7 +8,7 @@ import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -26,7 +26,7 @@ public class RegExpBasedFileFinderTests { public void setUp() { entry = new BibEntry(); - entry.setType(BibtexEntryType.Article); + entry.setType(StandardEntryType.Article); entry.setCiteKey("HipKro03"); entry.setField(StandardField.AUTHOR, "Eric von Hippel and Georg von Krogh"); entry.setField(StandardField.TITLE, "Open Source Software and the \"Private-Collective\" Innovation Model: Issues for Organization Science"); @@ -47,7 +47,7 @@ public void setUp() { @Test public void testFindFiles() throws Exception { //given - BibEntry localEntry = new BibEntry(BibtexEntryType.Article); + BibEntry localEntry = new BibEntry(StandardEntryType.Article); localEntry.setCiteKey("pdfInDatabase"); localEntry.setField(StandardField.YEAR, "2001"); @@ -83,7 +83,7 @@ public void testYearAuthFirspageFindFiles() throws Exception { @Test public void testAuthorWithDiacritics() throws Exception { //given - BibEntry localEntry = new BibEntry(BibtexEntryType.Article); + BibEntry localEntry = new BibEntry(StandardEntryType.Article); localEntry.setCiteKey("Grazulis2017"); localEntry.setField(StandardField.YEAR, "2017"); localEntry.setField(StandardField.AUTHOR, "Gražulis, Saulius and O. Kitsune"); @@ -105,7 +105,7 @@ public void testAuthorWithDiacritics() throws Exception { @Test public void testFindFileInSubdirectory() throws Exception { //given - BibEntry localEntry = new BibEntry(BibtexEntryType.Article); + BibEntry localEntry = new BibEntry(StandardEntryType.Article); localEntry.setCiteKey("pdfInSubdirectory"); localEntry.setField(StandardField.YEAR, "2017"); @@ -125,7 +125,7 @@ public void testFindFileInSubdirectory() throws Exception { @Test public void testFindFileNonRecursive() throws Exception { //given - BibEntry localEntry = new BibEntry(BibtexEntryType.Article); + BibEntry localEntry = new BibEntry(StandardEntryType.Article); localEntry.setCiteKey("pdfInSubdirectory"); localEntry.setField(StandardField.YEAR, "2017"); diff --git a/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java b/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java index 2f9e42356ae..4374f76b69c 100644 --- a/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java +++ b/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java @@ -12,7 +12,7 @@ import org.jabref.model.entry.Month; import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDPage; @@ -32,7 +32,7 @@ class XmpUtilWriterTest { private XmpPreferences xmpPreferences; private void initBibEntries() { - olly2018 = new BibEntry(BibtexEntryType.Article); + olly2018 = new BibEntry(StandardEntryType.Article); olly2018.setCiteKey("Olly2018"); olly2018.setField(StandardField.AUTHOR, "Olly and Johannes"); olly2018.setField(StandardField.TITLE, "Stefan's palace"); @@ -54,7 +54,7 @@ private void initBibEntries() { olly2018.setField(StandardField.REVIEW, "review"); olly2018.setField(StandardField.URL, "https://www.olly2018.edu"); - toral2006 = new BibEntry(BibtexEntryType.InProceedings); + toral2006 = new BibEntry(StandardEntryType.InProceedings); toral2006.setField(StandardField.AUTHOR, "Toral, Antonio and Munoz, Rafael"); toral2006.setField(StandardField.TITLE, "A proposal to automatically build and maintain gazetteers for Named Entity Recognition by using Wikipedia"); toral2006.setField(StandardField.BOOKTITLE, "Proceedings of EACL"); @@ -63,7 +63,7 @@ private void initBibEntries() { toral2006.setField(InternalField.OWNER, "Ich"); toral2006.setField(StandardField.URL, "www.url.de"); - vapnik2000 = new BibEntry(BibtexEntryType.Book); + vapnik2000 = new BibEntry(StandardEntryType.Book); vapnik2000.setCiteKey("vapnik2000"); vapnik2000.setField(StandardField.TITLE, "The Nature of Statistical Learning Theory"); vapnik2000.setField(StandardField.PUBLISHER, "Springer Science + Business Media"); diff --git a/src/test/java/org/jabref/model/BibEntryTypeFactoryTest.java b/src/test/java/org/jabref/model/BibEntryTypeFactoryTest.java index d4669638996..9cfd2533521 100644 --- a/src/test/java/org/jabref/model/BibEntryTypeFactoryTest.java +++ b/src/test/java/org/jabref/model/BibEntryTypeFactoryTest.java @@ -12,10 +12,10 @@ import org.jabref.model.entry.field.FieldPriority; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.BiblatexEntryTypeDefinitions; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.BibtexEntryTypeDefinitions; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.IEEETranEntryTypeDefinitions; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.entry.types.UnknownEntryType; import org.junit.jupiter.api.BeforeEach; @@ -45,7 +45,7 @@ void setUp() { Collections.singleton(new BibField(StandardField.AUTHOR, FieldPriority.IMPORTANT)), Collections.emptySet()); overwrittenStandardType = new BibEntryType( - BibtexEntryType.Article, + StandardEntryType.Article, Collections.singleton(new BibField(StandardField.TITLE, FieldPriority.IMPORTANT)), Collections.emptySet()); entryTypesManager = new BibEntryTypesManager(); diff --git a/src/test/java/org/jabref/model/database/BibDatabaseModeDetectionTest.java b/src/test/java/org/jabref/model/database/BibDatabaseModeDetectionTest.java index f1c7754da91..92e001e3604 100644 --- a/src/test/java/org/jabref/model/database/BibDatabaseModeDetectionTest.java +++ b/src/test/java/org/jabref/model/database/BibDatabaseModeDetectionTest.java @@ -5,9 +5,8 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BiblatexEntryType; -import org.jabref.model.entry.types.BibtexEntryType; import org.jabref.model.entry.types.EntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.entry.types.UnknownEntryType; import org.junit.jupiter.api.Test; @@ -20,14 +19,14 @@ public class BibDatabaseModeDetectionTest { @Test public void detectBiblatex() { - Collection entries = Arrays.asList(new BibEntry(BiblatexEntryType.MvBook)); + Collection entries = Arrays.asList(new BibEntry(StandardEntryType.MvBook)); assertEquals(BibDatabaseMode.BIBLATEX, BibDatabaseModeDetection.inferMode(BibDatabases.createDatabase(entries))); } @Test public void detectUndistinguishableAsBibtex() { - BibEntry entry = new BibEntry(BibtexEntryType.Article); + BibEntry entry = new BibEntry(StandardEntryType.Article); entry.setField(StandardField.TITLE, "My cool paper"); Collection entries = Arrays.asList(entry); @@ -36,9 +35,9 @@ public void detectUndistinguishableAsBibtex() { @Test public void detectMixedModeAsBiblatex() { - BibEntry bibtex = new BibEntry(BibtexEntryType.Article); + BibEntry bibtex = new BibEntry(StandardEntryType.Article); bibtex.setField(StandardField.JOURNAL, "IEEE Trans. Services Computing"); - BibEntry biblatex = new BibEntry(BibtexEntryType.Article); + BibEntry biblatex = new BibEntry(StandardEntryType.Article); biblatex.setField(StandardField.TRANSLATOR, "Stefan Kolb"); Collection entries = Arrays.asList(bibtex, biblatex); @@ -56,8 +55,8 @@ public void detectUnknownTypeAsBibtex() { @Test public void ignoreUnknownTypesForBibtexDecision() { BibEntry custom = new BibEntry(UNKNOWN_TYPE); - BibEntry bibtex = new BibEntry(BibtexEntryType.Article); - BibEntry biblatex = new BibEntry(BibtexEntryType.Article); + BibEntry bibtex = new BibEntry(StandardEntryType.Article); + BibEntry biblatex = new BibEntry(StandardEntryType.Article); Collection entries = Arrays.asList(custom, bibtex, biblatex); assertEquals(BibDatabaseMode.BIBTEX, BibDatabaseModeDetection.inferMode(BibDatabases.createDatabase(entries))); @@ -66,8 +65,8 @@ public void ignoreUnknownTypesForBibtexDecision() { @Test public void ignoreUnknownTypesForBiblatexDecision() { BibEntry custom = new BibEntry(UNKNOWN_TYPE); - BibEntry bibtex = new BibEntry(BibtexEntryType.Article); - BibEntry biblatex = new BibEntry(BiblatexEntryType.MvBook); + BibEntry bibtex = new BibEntry(StandardEntryType.Article); + BibEntry biblatex = new BibEntry(StandardEntryType.MvBook); Collection entries = Arrays.asList(custom, bibtex, biblatex); assertEquals(BibDatabaseMode.BIBLATEX, BibDatabaseModeDetection.inferMode(BibDatabases.createDatabase(entries))); diff --git a/src/test/java/org/jabref/model/database/BibDatabaseTest.java b/src/test/java/org/jabref/model/database/BibDatabaseTest.java index 6dbacd3c946..a790027e58b 100644 --- a/src/test/java/org/jabref/model/database/BibDatabaseTest.java +++ b/src/test/java/org/jabref/model/database/BibDatabaseTest.java @@ -14,7 +14,7 @@ import org.jabref.model.entry.BibtexString; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.event.TestEventListener; import org.junit.jupiter.api.BeforeEach; @@ -327,9 +327,9 @@ public void getUsedStringsNoString() { @Test public void getEntriesSortedWithTwoEntries() { - BibEntry entryB = new BibEntry(BibtexEntryType.Article); + BibEntry entryB = new BibEntry(StandardEntryType.Article); entryB.setId("2"); - BibEntry entryA = new BibEntry(BibtexEntryType.Article); + BibEntry entryA = new BibEntry(StandardEntryType.Article); entryB.setId("1"); database.insertEntries(entryB, entryA); assertEquals(Arrays.asList(entryA, entryB), database.getEntriesSorted(Comparator.comparing(BibEntry::getId))); diff --git a/src/test/java/org/jabref/model/entry/BibEntryTests.java b/src/test/java/org/jabref/model/entry/BibEntryTests.java index 239cea9dd5a..a0e2ee64ad0 100644 --- a/src/test/java/org/jabref/model/entry/BibEntryTests.java +++ b/src/test/java/org/jabref/model/entry/BibEntryTests.java @@ -11,7 +11,7 @@ import org.jabref.model.entry.field.OrFields; import org.jabref.model.entry.field.SpecialField; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import com.google.common.collect.Sets; import org.junit.jupiter.api.BeforeEach; @@ -32,27 +32,27 @@ public class BibEntryTests { public void setUp() { // Default entry for most keyword and some type tests keywordEntry = new BibEntry(); - keywordEntry.setType(BibtexEntryType.Article); + keywordEntry.setType(StandardEntryType.Article); keywordEntry.setField(StandardField.KEYWORDS, "Foo, Bar"); keywordEntry.setChanged(false); // Empty entry for some tests emptyEntry = new BibEntry(); - emptyEntry.setType(BibtexEntryType.Article); + emptyEntry.setType(StandardEntryType.Article); emptyEntry.setChanged(false); } @Test public void testDefaultConstructor() { BibEntry entry = new BibEntry(); - assertEquals(BibtexEntryType.Misc, entry.getType()); + assertEquals(StandardEntryType.Misc, entry.getType()); assertNotNull(entry.getId()); assertFalse(entry.getField(StandardField.AUTHOR).isPresent()); } @Test public void allFieldsPresentDefault() { - BibEntry e = new BibEntry(BibtexEntryType.Article); + BibEntry e = new BibEntry(StandardEntryType.Article); e.setField(StandardField.AUTHOR, "abc"); e.setField(StandardField.TITLE, "abc"); e.setField(StandardField.JOURNAL, "abc"); @@ -68,7 +68,7 @@ public void allFieldsPresentDefault() { @Test public void allFieldsPresentOr() { - BibEntry e = new BibEntry(BibtexEntryType.Article); + BibEntry e = new BibEntry(StandardEntryType.Article); e.setField(StandardField.AUTHOR, "abc"); e.setField(StandardField.TITLE, "abc"); e.setField(StandardField.JOURNAL, "abc"); @@ -83,13 +83,13 @@ public void allFieldsPresentOr() { @Test public void isNullCiteKeyThrowsNPE() { - BibEntry e = new BibEntry(BibtexEntryType.Article); + BibEntry e = new BibEntry(StandardEntryType.Article); assertThrows(NullPointerException.class, () -> e.setCiteKey(null)); } @Test public void isEmptyCiteKey() { - BibEntry e = new BibEntry(BibtexEntryType.Article); + BibEntry e = new BibEntry(StandardEntryType.Article); assertFalse(e.hasCiteKey()); e.setCiteKey(""); diff --git a/src/test/java/org/jabref/model/entry/CanonicalBibEntryTest.java b/src/test/java/org/jabref/model/entry/CanonicalBibEntryTest.java index ec1ba39ece5..f4ce6967dfa 100644 --- a/src/test/java/org/jabref/model/entry/CanonicalBibEntryTest.java +++ b/src/test/java/org/jabref/model/entry/CanonicalBibEntryTest.java @@ -1,7 +1,7 @@ package org.jabref.model.entry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.Test; @@ -11,7 +11,7 @@ public class CanonicalBibEntryTest { @Test public void simpleCanonicalRepresentation() { - BibEntry e = new BibEntry(BibtexEntryType.Article); + BibEntry e = new BibEntry(StandardEntryType.Article); e.setCiteKey("key"); e.setField(StandardField.AUTHOR, "abc"); e.setField(StandardField.TITLE, "def"); @@ -23,7 +23,7 @@ public void simpleCanonicalRepresentation() { @Test public void canonicalRepresentationWithNewlines() { - BibEntry e = new BibEntry(BibtexEntryType.Article); + BibEntry e = new BibEntry(StandardEntryType.Article); e.setCiteKey("key"); e.setField(StandardField.ABSTRACT, "line 1\nline 2"); String canonicalRepresentation = CanonicalBibtexEntry.getCanonicalRepresentation(e); diff --git a/src/test/java/org/jabref/model/search/rules/ContainBasedSearchRuleTest.java b/src/test/java/org/jabref/model/search/rules/ContainBasedSearchRuleTest.java index 991a1057c27..b16ddb1337d 100644 --- a/src/test/java/org/jabref/model/search/rules/ContainBasedSearchRuleTest.java +++ b/src/test/java/org/jabref/model/search/rules/ContainBasedSearchRuleTest.java @@ -2,7 +2,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.BibtexEntryType; +import org.jabref.model.entry.types.StandardEntryType; import org.junit.jupiter.api.Test; @@ -44,7 +44,7 @@ public void testBasicSearchParsing() { } public BibEntry makeBibtexEntry() { - BibEntry e = new BibEntry(BibtexEntryType.InCollection); + BibEntry e = new BibEntry(StandardEntryType.InCollection); e.setField(StandardField.TITLE, "Marine finfish larviculture in Europe"); e.setCiteKey("shields01"); e.setField(StandardField.YEAR, "2001");