Package speculoos

Examples of speculoos.Personne


   */
  public void test01Modify() throws MapperException {
    ctxmock.expects(once()).method("modifyAttributes").with(same(cn),
        modopCheck01());
    /* input */
    Personne input = new Personne();
    input.setName("Naquin");
    input.setSurname("Thierry");
    /* operations */

    this.mods = new ModificationsVariables(output);
    mods.modifyAttribute("name", new VariableString("${self.name}"));
    mods.modifyAttribute("surname", new VariableString("${self.surname}"));
View Full Code Here


   */
  public void test05Delete() throws MapperException {
    ctxmock.expects(once()).method("modifyAttributes").with(same(cn),
        modopCheck05());
    /* input */
    Personne input = new Personne();
    input.setName("Naquin");
    input.setSurname("Thierry");
    /* operations */
    this.mods = new ModificationsVariables(output);
    mods.deleteAttribute("nom complet", new VariableString(
        "${self.name} ${self.surname}"));
    sm.setOperations(mods);
View Full Code Here

  public void test06InvalidAttrException() {
    ctxmock.expects(once()).method("modifyAttributes").with(same(cn),
        modopCheck05()).will(
        throwException(new InvalidAttributesException()));
    /* input */
    Personne input = new Personne();
    input.setName("Naquin");
    input.setSurname("Thierry");
    /* operations */
    this.mods = new ModificationsVariables(output);
    mods.deleteAttribute("nom complet", new VariableString(
        "${self.name} ${self.surname}"));
    sm.setOperations(mods);
View Full Code Here

  /**
   * Error catching with root name.
   *
   */
  public void test08RootNameError() {
    Personne input = new Personne();
    input.setName("Naquin");
    input.setSurname("Thierry");
    Map lenv = new HashMap();
    lenv.put("scope", "2");
    npmock.reset();
    npmock.expects(once()).method("parse").with(
        eq("cn=toto,ou=Personnes,o=canam")).will(
View Full Code Here

   *
   */
  public void test10DefaultModifications() throws MapperException {
    ctxmock.expects(once()).method("modifyAttributes").with(same(cn),
        modopCheck10());
    Personne input = new Personne();
    input.setName("Naquin");
    input.setSurname("Thierry");
    input.setChildNumber(3);
    input.setSites(null);
    sm.setOutput(Personne.class,output);
    sm.modify(input, env);
  }
View Full Code Here

   *
   */
  public void test11DefaultModificationsWithMultiple() throws MapperException {
    ctxmock.expects(once()).method("modifyAttributes").with(same(cn),
        modopCheck11());
    Personne input = new Personne();
    input.setName("Naquin");
    input.setSurname(null);
    List l = new ArrayList();
    l.add("thiery");
    l.add("franois");
    l.add("robert");
    input.setSites(l);
    sm.setOutput(Personne.class,output);
    sm.modify(input, env);
  }
View Full Code Here

  public void test01Base() throws MapperException, InvalidNameException {
    /* populate input */
    Map input = new HashMap();
    input.put("nom", "NA*");
    /* construct results */
    Personne p = new Personne();
    List l = new ArrayList();
    l.add("t123456");
    l.add("t234567");
    l.add("t345678");
    p.setSites( l);
    List r = new ArrayList();
    r.add(p);
    leftmock.expects(once()).method("search").with(eq(input), ANYTHING)
        .will(returnValue(r));
    l = new ArrayList();
View Full Code Here

      InvalidNameException {
    /* populate input */
    Map input = new HashMap();
    input.put("nom", "NA*");
    /* construct results */
    Personne p = new Personne();
    List l = new ArrayList();
    l.add("t123456");
    l.add("t234567");
    l.add("t345678");
    p.setSites( l);
    List r = new ArrayList();
    r.add(p);
    p = new Personne();
    p.getSites().add("t345678");
    r.add(p);
    p = new Personne();
    p.getSites().add("t456789");
    r.add(p);
    leftmock.expects(once()).method("search").with(eq(input), ANYTHING)
        .will(returnValue(r));
    /* return values for second mapper */
    l = new ArrayList();
View Full Code Here

   * @throws MapperException
   * @throws InvalidNameException
   */
  public void test01OneResult() throws MapperException, InvalidNameException {
    /* populate input */
    Personne input = new Personne();
    input.setName("NAQUIN");
    input.setSurname("thiery");
    NamingEnumeration enu = _answer01();
    ctxmock.expects(once()).method("search").with(eq(cn),
        eq("fullName=NAQUIN thiery"), ANYTHING).will(returnValue(enu));
    List ret = (List) sm.map(input, null);
    assertEquals("Return list should contain one element", 1, ret.size());
View Full Code Here

   * @throws MapperException
   *
   */
  public void test02NoResult() throws MapperException {
    /* populate input */
    Personne input = new Personne();
    input.setName("NAQUIN");
    input.setSurname("thiery");
    NamingEnumeration enu = new ListEnum(new ArrayList());
    ctxmock.expects(once()).method("search").with(eq(cn),
        eq("fullName=NAQUIN thiery"), ANYTHING).will(returnValue(enu));
    List ret = sm.search(input, null);
    assertEquals("Return list should contain zero element", 0, ret.size());
View Full Code Here

TOP

Related Classes of speculoos.Personne

Copyright © 2018 www.massapicom. 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.