Package net.sf.jabref.export.layout

Examples of net.sf.jabref.export.layout.LayoutFormatter.format()


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

    assertEquals("John von Neumann, John Smith, and Peter Black Brown", a
      .format("John von Neumann and John Smith and Black Brown, Peter"));
  }


}
View Full Code Here


   */
  public void testFormat() {
    LayoutFormatter a = new AuthorAndsReplacer();

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

    // Single Names don't change
    assertEquals("Someone, Van Something", a.format("Someone, Van Something"));

    // Two names just an &
View Full Code Here

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

    // Single Names don't change
    assertEquals("Someone, Van Something", a.format("Someone, Van Something"));

    // Two names just an &
    assertEquals("John Smith & Black Brown, Peter", a
      .format("John Smith and Black Brown, Peter"));
View Full Code Here

    // Single Names don't change
    assertEquals("Someone, Van Something", a.format("Someone, Van Something"));

    // Two names just an &
    assertEquals("John Smith & Black Brown, Peter", a
      .format("John Smith and Black Brown, Peter"));

    // Three names put a comma:
    assertEquals("von Neumann, John; Smith, John & Black Brown, Peter", a
      .format("von Neumann, John and Smith, John and Black Brown, Peter"));
View Full Code Here

    // Two names just an &
    assertEquals("John Smith & Black Brown, Peter", a
      .format("John Smith and Black Brown, Peter"));

    // Three names put a comma:
    assertEquals("von Neumann, John; Smith, John & Black Brown, Peter", a
      .format("von Neumann, John and Smith, John and Black Brown, Peter"));

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

    // Three names put a comma:
    assertEquals("von Neumann, John; Smith, John & Black Brown, Peter", a
      .format("von Neumann, John and Smith, John and Black Brown, Peter"));

    assertEquals("John von Neumann; John Smith & Peter Black Brown", a
      .format("John von Neumann and John Smith and Peter Black Brown"));
  }

}
View Full Code Here

  public void testComposite() {

    {
      LayoutFormatter f = new CompositeFormat();
      assertEquals("No Change", f.format("No Change"));
    }
    {
      LayoutFormatter f = new CompositeFormat(new LayoutFormatter[]{new LayoutFormatter(){

        public String format(String fieldText) {
View Full Code Here

          return "B" + fieldText;
        }
       
      }});
     
      assertEquals("BAff", f.format("f"));
    }
   
    {
      LayoutFormatter f = new CompositeFormat(new AuthorOrgSci(),
        new NoSpaceBetweenAbbreviations());
View Full Code Here

      LayoutFormatter f = new CompositeFormat(new AuthorOrgSci(),
        new NoSpaceBetweenAbbreviations());
      LayoutFormatter first = new AuthorOrgSci();
      LayoutFormatter second = new NoSpaceBetweenAbbreviations();
     
      assertEquals(second.format(first.format("John Flynn and Sabine Gartska")), f.format("John Flynn and Sabine Gartska"));
      assertEquals(second.format(first.format("Sa Makridakis and Sa Ca Wheelwright and Va Ea McGee")), f.format("Sa Makridakis and Sa Ca Wheelwright and Va Ea McGee"));
    }
  }

}
View Full Code Here

        new NoSpaceBetweenAbbreviations());
      LayoutFormatter first = new AuthorOrgSci();
      LayoutFormatter second = new NoSpaceBetweenAbbreviations();
     
      assertEquals(second.format(first.format("John Flynn and Sabine Gartska")), f.format("John Flynn and Sabine Gartska"));
      assertEquals(second.format(first.format("Sa Makridakis and Sa Ca Wheelwright and Va Ea McGee")), f.format("Sa Makridakis and Sa Ca Wheelwright and Va Ea McGee"));
    }
  }

}
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.