-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes based on comments and a few more tests
- Loading branch information
Showing
10 changed files
with
248 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/test/java/net/sf/jabref/exporter/layout/format/AuthorFirstFirstCommasTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (C) 2015 Jabref-Team | ||
* | ||
* All programs in this directory and subdirectories are published under the GNU | ||
* General Public License as described below. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free Software | ||
* Foundation; either version 2 of the License, or (at your option) any later | ||
* version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
* Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* Further information about the GNU GPL is available at: | ||
* http://www.gnu.org/copyleft/gpl.ja.html | ||
* | ||
*/ | ||
package net.sf.jabref.exporter.layout.format; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class AuthorFirstFirstCommasTest { | ||
|
||
/** | ||
* Test method for | ||
* {@link net.sf.jabref.exporter.layout.format.AuthorLF_FF#format(java.lang.String)}. | ||
*/ | ||
@Test | ||
public void testFormat() { | ||
Assert.assertEquals("John von Neumann, John Smith and Peter Black Brown, Jr", | ||
new AuthorFirstFirstCommas() | ||
.format("von Neumann,,John and John Smith and Black Brown, Jr, Peter")); | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
src/test/java/net/sf/jabref/exporter/layout/format/AuthorFirstFirstTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/test/java/net/sf/jabref/exporter/layout/format/AuthorLF_FFAbbrTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (C) 2015 Jabref-Team | ||
* | ||
* All programs in this directory and subdirectories are published under the GNU | ||
* General Public License as described below. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free Software | ||
* Foundation; either version 2 of the License, or (at your option) any later | ||
* version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
* Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* Further information about the GNU GPL is available at: | ||
* http://www.gnu.org/copyleft/gpl.ja.html | ||
* | ||
*/ | ||
package net.sf.jabref.exporter.layout.format; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class AuthorLF_FFAbbrTest { | ||
|
||
/** | ||
* Test method for | ||
* {@link net.sf.jabref.exporter.layout.format.AuthorLF_FF#format(java.lang.String)}. | ||
*/ | ||
@Test | ||
public void testFormat() { | ||
Assert.assertEquals("von Neumann, J. and J. Smith and P. Black Brown, Jr", | ||
new AuthorLF_FFAbbr() | ||
.format("von Neumann,,John and John Smith and Black Brown, Jr, Peter")); | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
src/test/java/net/sf/jabref/exporter/layout/format/AuthorLF_FFTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (C) 2015 Jabref-Team | ||
* | ||
* All programs in this directory and subdirectories are published under the GNU | ||
* General Public License as described below. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free Software | ||
* Foundation; either version 2 of the License, or (at your option) any later | ||
* version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
* Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* Further information about the GNU GPL is available at: | ||
* http://www.gnu.org/copyleft/gpl.ja.html | ||
* | ||
*/ | ||
package net.sf.jabref.exporter.layout.format; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class AuthorLF_FFTest { | ||
|
||
/** | ||
* Test method for | ||
* {@link net.sf.jabref.exporter.layout.format.AuthorLF_FF#format(java.lang.String)}. | ||
*/ | ||
@Test | ||
public void testFormat() { | ||
Assert.assertEquals("von Neumann, John and John Smith and Peter Black Brown, Jr", | ||
new AuthorLF_FF() | ||
.format("von Neumann,,John and John Smith and Black Brown, Jr, Peter")); | ||
} | ||
|
||
} |
51 changes: 51 additions & 0 deletions
51
src/test/java/net/sf/jabref/exporter/layout/format/AuthorNatBibTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (C) 2015 Jabref-Team | ||
* | ||
* All programs in this directory and subdirectories are published under the GNU | ||
* General Public License as described below. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free Software | ||
* Foundation; either version 2 of the License, or (at your option) any later | ||
* version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
* Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* Further information about the GNU GPL is available at: | ||
* http://www.gnu.org/copyleft/gpl.ja.html | ||
* | ||
*/ | ||
package net.sf.jabref.exporter.layout.format; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class AuthorNatBibTest { | ||
|
||
/** | ||
* Test method for | ||
* {@link net.sf.jabref.exporter.layout.format.AuthorLF_FF#format(java.lang.String)}. | ||
*/ | ||
@Test | ||
public void testFormatThreeAuthors() { | ||
Assert.assertEquals("von Neumann et al.", | ||
new AuthorNatBib().format("von Neumann,,John and John Smith and Black Brown, Jr, Peter")); | ||
} | ||
|
||
/** | ||
* Test method for | ||
* {@link net.sf.jabref.exporter.layout.format.AuthorLF_FF#format(java.lang.String)}. | ||
*/ | ||
@Test | ||
public void testFormatTwoAuthors() { | ||
Assert.assertEquals("von Neumann and Smith", new AuthorNatBib().format("von Neumann,,John and John Smith")); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/test/java/net/sf/jabref/exporter/layout/format/FormatCharsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (C) 2015 Jabref-Team | ||
* | ||
* All programs in this directory and subdirectories are published under the GNU | ||
* General Public License as described below. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free Software | ||
* Foundation; either version 2 of the License, or (at your option) any later | ||
* version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
* Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* Further information about the GNU GPL is available at: | ||
* http://www.gnu.org/copyleft/gpl.ja.html | ||
* | ||
*/ | ||
|
||
package net.sf.jabref.exporter.layout.format; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import org.junit.Test; | ||
|
||
|
||
public class FormatCharsTest { | ||
|
||
@Test | ||
public void testPlainFormat() { | ||
assertEquals("aaa", new FormatChars().format("aaa")); | ||
} | ||
|
||
@Test | ||
public void testFormatUmlaut() { | ||
assertEquals("ä", new FormatChars().format("{\\\"{a}}")); | ||
assertEquals("Ä", new FormatChars().format("{\\\"{A}}")); | ||
} | ||
|
||
@Test | ||
public void testFormatStripLatexCommands() { | ||
assertEquals("-", new FormatChars().format("\\mbox{-}")); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters