Package net.sf.jabref.export.layout.format.plugin

Examples of net.sf.jabref.export.layout.format.plugin.NameFormat.format()


  public void testFormatStringStringBibtexEntry() {
   
    NameFormat l = new NameFormat();
   
    assertEquals("Doe", l.format("Joe Doe", "1@*@{ll}", null));   
   
    assertEquals("moremoremoremore", l.format("Joe Doe and Mary Jane and Bruce Bar and Arthur Kay",
      "1@*@{ll}@@2@1..1@{ff}{ll}@2..2@ and {ff}{last}@@*@*@more", null));
   
    assertEquals("Doe", l.format("Joe Doe",
View Full Code Here


   
    NameFormat l = new NameFormat();
   
    assertEquals("Doe", l.format("Joe Doe", "1@*@{ll}", null));   
   
    assertEquals("moremoremoremore", l.format("Joe Doe and Mary Jane and Bruce Bar and Arthur Kay",
      "1@*@{ll}@@2@1..1@{ff}{ll}@2..2@ and {ff}{last}@@*@*@more", null));
   
    assertEquals("Doe", l.format("Joe Doe",
      "1@*@{ll}@@2@1..1@{ff}{ll}@2..2@ and {ff}{last}@@*@*@more", null));
 
View Full Code Here

    assertEquals("Doe", l.format("Joe Doe", "1@*@{ll}", null));   
   
    assertEquals("moremoremoremore", l.format("Joe Doe and Mary Jane and Bruce Bar and Arthur Kay",
      "1@*@{ll}@@2@1..1@{ff}{ll}@2..2@ and {ff}{last}@@*@*@more", null));
   
    assertEquals("Doe", l.format("Joe Doe",
      "1@*@{ll}@@2@1..1@{ff}{ll}@2..2@ and {ff}{last}@@*@*@more", null));
 
    assertEquals("JoeDoe and MaryJ", l.format("Joe Doe and Mary Jane",
      "1@*@{ll}@@2@1..1@{ff}{ll}@2..2@ and {ff}{l}@@*@*@more", null));

View Full Code Here

      "1@*@{ll}@@2@1..1@{ff}{ll}@2..2@ and {ff}{last}@@*@*@more", null));
   
    assertEquals("Doe", l.format("Joe Doe",
      "1@*@{ll}@@2@1..1@{ff}{ll}@2..2@ and {ff}{last}@@*@*@more", null));
 
    assertEquals("JoeDoe and MaryJ", l.format("Joe Doe and Mary Jane",
      "1@*@{ll}@@2@1..1@{ff}{ll}@2..2@ and {ff}{l}@@*@*@more", null));

    assertEquals("Doe, Joe and Jane, M. and Kamp, J.~A.", l.format("Joe Doe and Mary Jane and John Arthur van Kamp",
      "1@*@{ll}, {ff}@@*@1@{ll}, {ff}@2..-1@ and {ll}, {f}.", null));
 
View Full Code Here

      "1@*@{ll}@@2@1..1@{ff}{ll}@2..2@ and {ff}{last}@@*@*@more", null));
 
    assertEquals("JoeDoe and MaryJ", l.format("Joe Doe and Mary Jane",
      "1@*@{ll}@@2@1..1@{ff}{ll}@2..2@ and {ff}{l}@@*@*@more", null));

    assertEquals("Doe, Joe and Jane, M. and Kamp, J.~A.", l.format("Joe Doe and Mary Jane and John Arthur van Kamp",
      "1@*@{ll}, {ff}@@*@1@{ll}, {ff}@2..-1@ and {ll}, {f}.", null));
 
    assertEquals("Doe Joe and Jane, M. and Kamp, J.~A.", l.format("Joe Doe and Mary Jane and John Arthur van Kamp",
      "1@*@{ll}, {ff}@@*@1@{ll} {ff}@2..-1@ and {ll}, {f}.", null));
   
View Full Code Here

      "1@*@{ll}@@2@1..1@{ff}{ll}@2..2@ and {ff}{l}@@*@*@more", null));

    assertEquals("Doe, Joe and Jane, M. and Kamp, J.~A.", l.format("Joe Doe and Mary Jane and John Arthur van Kamp",
      "1@*@{ll}, {ff}@@*@1@{ll}, {ff}@2..-1@ and {ll}, {f}.", null));
 
    assertEquals("Doe Joe and Jane, M. and Kamp, J.~A.", l.format("Joe Doe and Mary Jane and John Arthur van Kamp",
      "1@*@{ll}, {ff}@@*@1@{ll} {ff}@2..-1@ and {ll}, {f}.", null));
   
  }
 
  public void testFormat() {
View Full Code Here

  public void testFormat() {

    NameFormat a = new NameFormat();

    // Empty case
    assertEquals("", a.format(""));

    String formatString = "1@1@{vv }{ll}{ ff}@@2@1@{vv }{ll}{ ff}@2@ and {vv }{ll}{, ff}@@*@1@{vv }{ll}{ ff}@2..-2@, {vv }{ll}{, ff}@-1@ and {vv }{ll}{, ff}";
   
    // Single Names
    assertEquals("Vandekamp Mary~Ann", a.format("Mary Ann Vandekamp", formatString, null));
View Full Code Here

    assertEquals("", a.format(""));

    String formatString = "1@1@{vv }{ll}{ ff}@@2@1@{vv }{ll}{ ff}@2@ and {vv }{ll}{, ff}@@*@1@{vv }{ll}{ ff}@2..-2@, {vv }{ll}{, ff}@-1@ and {vv }{ll}{, ff}";
   
    // Single Names
    assertEquals("Vandekamp Mary~Ann", a.format("Mary Ann Vandekamp", formatString, null));

    // Two names
    assertEquals("von Neumann John and Black~Brown, Peter", a
      .format("John von Neumann and Black Brown, Peter",formatString, null));

View Full Code Here

   
    // Single Names
    assertEquals("Vandekamp Mary~Ann", a.format("Mary Ann Vandekamp", formatString, null));

    // Two names
    assertEquals("von Neumann John and Black~Brown, Peter", a
      .format("John von Neumann and Black Brown, Peter",formatString, null));

    // Three names
    assertEquals("von Neumann John, Smith, John and Black~Brown, Peter", a
      .format("von Neumann, John and Smith, John and Black Brown, Peter", formatString, null));
View Full Code Here

    // Two names
    assertEquals("von Neumann John and Black~Brown, Peter", a
      .format("John von Neumann and Black Brown, Peter",formatString, null));

    // Three names
    assertEquals("von Neumann John, Smith, John and Black~Brown, Peter", a
      .format("von Neumann, John and Smith, John and Black Brown, Peter", formatString, null));

    assertEquals("von Neumann John, Smith, John and Black~Brown, Peter", a
      .format("John von Neumann and John Smith and Black Brown, Peter", formatString, null));
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.