Skip to content

Commit

Permalink
Fix class name of "CanonicalBibEntry"
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Nov 9, 2019
1 parent 568ccda commit 3dae81c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/model/entry/BibEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ public Object clone() {
*/
@Override
public String toString() {
return CanonicalBibtexEntry.getCanonicalRepresentation(this);
return CanonicalBibEntry.getCanonicalRepresentation(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import org.jabref.model.entry.field.Field;
import org.jabref.model.entry.field.InternalField;

public class CanonicalBibtexEntry {
public class CanonicalBibEntry {

private CanonicalBibtexEntry() {
private CanonicalBibEntry() {
}

/**
Expand Down
17 changes: 13 additions & 4 deletions src/test/java/org/jabref/model/entry/CanonicalBibEntryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.*;

public class CanonicalBibEntryTest {
class CanonicalBibEntryTest {

@Test
void canonicalRepresentationIsCorrectForStringMonth() {
BibEntry entry = new BibEntry();
entry.setMonth(Month.MAY);
assertEquals("@misc{,\n" +
" month = {#may#}\n" +
"}", CanonicalBibEntry.getCanonicalRepresentation(entry));
}

@Test
public void simpleCanonicalRepresentation() {
Expand All @@ -16,7 +25,7 @@ public void simpleCanonicalRepresentation() {
e.setField(StandardField.AUTHOR, "abc");
e.setField(StandardField.TITLE, "def");
e.setField(StandardField.JOURNAL, "hij");
String canonicalRepresentation = CanonicalBibtexEntry.getCanonicalRepresentation(e);
String canonicalRepresentation = CanonicalBibEntry.getCanonicalRepresentation(e);
assertEquals("@article{key,\n author = {abc},\n journal = {hij},\n title = {def}\n}",
canonicalRepresentation);
}
Expand All @@ -26,7 +35,7 @@ public void canonicalRepresentationWithNewlines() {
BibEntry e = new BibEntry(StandardEntryType.Article);
e.setCiteKey("key");
e.setField(StandardField.ABSTRACT, "line 1\nline 2");
String canonicalRepresentation = CanonicalBibtexEntry.getCanonicalRepresentation(e);
String canonicalRepresentation = CanonicalBibEntry.getCanonicalRepresentation(e);
assertEquals("@article{key,\n abstract = {line 1\nline 2}\n}", canonicalRepresentation);
}
}
17 changes: 0 additions & 17 deletions src/test/java/org/jabref/model/entry/CanonicalBibtexEntryTest.java

This file was deleted.

0 comments on commit 3dae81c

Please sign in to comment.