Skip to content

Commit

Permalink
Removed last Globals in logic tests and introduced architecture test (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
oscargus authored and koppor committed Sep 13, 2016
1 parent d8ec439 commit 2f73d74
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/test/java/net/sf/jabref/ArchitectureTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class ArchitectureTests {
public static final String PACKAGE_NET_SF_JABREF_GUI = "net.sf.jabref.gui";
public static final String PACKAGE_NET_SF_JABREF_LOGIC = "net.sf.jabref.logic";
public static final String PACKAGE_NET_SF_JABREF_MODEL = "net.sf.jabref.model";
public static final String CLASS_NET_SF_JABREF_GLOBALS = "net.sf.jabref.Globals";

private final String firstPackage;
private final String secondPackage;
Expand All @@ -38,11 +39,13 @@ public static Iterable<Object[]> data() {
{PACKAGE_NET_SF_JABREF_LOGIC, PACKAGE_JAVA_AWT},
{PACKAGE_NET_SF_JABREF_LOGIC, PACKAGE_JAVAX_SWING},
{PACKAGE_NET_SF_JABREF_LOGIC, PACKAGE_NET_SF_JABREF_GUI},
{PACKAGE_NET_SF_JABREF_LOGIC, CLASS_NET_SF_JABREF_GLOBALS},

{PACKAGE_NET_SF_JABREF_MODEL, PACKAGE_JAVA_AWT},
{PACKAGE_NET_SF_JABREF_MODEL, PACKAGE_JAVAX_SWING},
{PACKAGE_NET_SF_JABREF_MODEL, PACKAGE_NET_SF_JABREF_GUI},
{PACKAGE_NET_SF_JABREF_MODEL, PACKAGE_NET_SF_JABREF_LOGIC}
{PACKAGE_NET_SF_JABREF_MODEL, PACKAGE_NET_SF_JABREF_LOGIC},
{PACKAGE_NET_SF_JABREF_MODEL, CLASS_NET_SF_JABREF_GLOBALS}
}
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.Optional;

import net.sf.jabref.BibDatabaseContext;
import net.sf.jabref.Globals;
import net.sf.jabref.MetaData;
import net.sf.jabref.logic.exporter.FieldFormatterCleanups;
import net.sf.jabref.logic.formatter.bibtexfields.HtmlToLatexFormatter;
Expand Down Expand Up @@ -49,11 +48,6 @@ public class CleanupWorkerTest {

@Before
public void setUp() throws IOException {
// Needed for ExternalFileTypes
if (Globals.prefs == null) {
Globals.prefs = JabRefPreferences.getInstance();
}

pdfFolder = bibFolder.newFolder();

MetaData metaData = new MetaData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import java.io.IOException;
import java.util.Optional;

import net.sf.jabref.Globals;
import net.sf.jabref.logic.importer.FetcherException;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.model.entry.BibLatexEntryTypes;
import net.sf.jabref.preferences.JabRefPreferences;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -20,7 +20,7 @@ public class IsbnFetcherTest {

@Before
public void setUp() {
fetcher = new IsbnFetcher(Globals.prefs.getImportFormatPreferences ());
fetcher = new IsbnFetcher(JabRefPreferences.getInstance().getImportFormatPreferences());

bibEntry = new BibEntry();
bibEntry.setType(BibLatexEntryTypes.BOOK);
Expand Down

0 comments on commit 2f73d74

Please sign in to comment.