Package speculoos

Examples of speculoos.Personne


    }
  }

  public void test16MultipleValues() throws MapperException {
    /* populate input */
    Personne input = new Personne();
    input.setName("*");
    input.setSurname("thiery");
    NamingEnumeration enu = _answer16();
    ctxmock.expects(once()).method("search").with(eq(cn),
        eq("fullName=* thiery"), ANYTHING).will(returnValue(enu));
    List ret = sm.search(input, null);
    assertEquals("Return list should contain two elements", 2, ret.size());
View Full Code Here


        .getSites().get(0));
    /* close */
  }

  public void test17ImplicitFilter() throws MapperException {
    Personne input = new Personne();
    input.setName("NAQUIN");
    input.setSurname("thiery");
    sm.getInputChain().addMapper(new FilterFromInput(output));
    NamingEnumeration enu = _answer01();
    ctxmock.expects(once()).method("search").with(eq(cn),
        eq("(&(name=NAQUIN)(surname=thiery))"), ANYTHING).will(
        returnValue(enu));
View Full Code Here

  public void test18ImplicitFilterWithCollection() throws MapperException {
    List l = new ArrayList();
    l.add("alain");
    l.add("bernard");
    l.add("clment");
    Personne input = new Personne();
    input.setSites(l);
    input.setName("NAQUIN");
    input.setSurname("thiery");
    sm.getInputChain().addMapper(new FilterFromInput(output));
    NamingEnumeration enu = _answer01();
    ctxmock.expects(once()).method("search").with(eq(cn),
        eq("(&(name=NAQUIN)(sites=alain)(sites=bernard)(sites=clment)(surname=thiery))"), ANYTHING)
        .will(returnValue(enu));
View Full Code Here

   *
   */
  public void test02DeleteMap() throws MapperException {
    ctxmock.expects(once()).method("destroySubcontext").with(same(cn));
    /* input */
    Personne input = new Personne();
    /* operations */
    ami.map(input, env);
  }
View Full Code Here

    this.mapper = new AttributesFromInput(output);
    this.date = new Date();
  }

  public void test01SingleValues() throws MapperException {
    Personne p = new Personne();
    p.setName("toto");
    p.setSurname("tutu");
    p.setChildNumber(2);
    p.setDateOfBirth(date);
    p.setGender("M");
    p.setLogin("ut061111");
    Object o = mapper.map(p,null);
    System.err.println(o);
    Constraint ctr = addOpCheck01();
    StringBuffer sb = new StringBuffer();
    ctr.describeTo(sb);
View Full Code Here

      src.add("search1", smi);
    src.start(genv);
    /* check environnement is passed to mapper */
    SearchMapperImpl sm = (SearchMapperImpl) src.create("search1", genv);
    /* populate input */
    Personne input = new Personne();
    input.setName("NAQUIN");
    input.setSurname("thiery");
    Map h = new HashMap();
    h.put("name","name");
    h.put("surname","surname");
    sm.setOutput(Personne.class,h);
    sm.map(input, null);
View Full Code Here

      src.add("search1", smi);
    src.start(genv);
    /* check environnement is passed to mapper */
    SearchMapperImpl sm = (SearchMapperImpl) src.create("search1", genv);
    /* populate input */
    Personne input = new Personne();
    input.setName("NAQUIN");
    input.setSurname("thiery");
    Map h = new HashMap();
    h.put("name","name");
    h.put("surname","surname");
    sm.setOutput(Personne.class,h);
    sm.map(input, null);
    src.release(sm);
    try {
      input.setSurname("thiery");
      sm.map(input, null);
      fail("Map should fail after  releases");
    } catch (Exception e) {
    }
  }
View Full Code Here

   */
  public void test01Add() throws MapperException {
    ctxmock.expects(once()).method("createSubcontext").with(same(cn),
        addOpCheck01());
    /* input */
    Personne input = new Personne();
    input.setLogin("ut061111");
    input.setSurname("Rod");
    input.setName("Johnson");
    /* operations */
    ami.add(input, env);
  }
View Full Code Here

  public void test03MultipleValues() throws MapperException {
    ctxmock.expects(once()).method("createSubcontext").with(same(cn),
        addOpCheck02());
    /* input */
    /* input */
    Personne input = new Personne();
    input.setLogin("ut061111");
    input.setSurname("Rod");
    input.setName("Johnson");
    List l = new ArrayList();
    l.add("site1");
    l.add("site2");
    l.add("site3");
    input.setSites(l);
    /* operations */
    ami.map(input, env);
  }
View Full Code Here

  public void test06InvalidAttrException() {
    ctxmock.expects(once()).method("createSubcontext").with(same(cn),
        addOpCheck01()).will(
        throwException(new NamingException()));
    /* input */
    Personne input = new Personne();
    input.setLogin("ut061111");
    input.setSurname("Rod");
    input.setName("Johnson");
    /* operations */
    try {
      ami.add(input, env);
      fail("should have thrown MapperException");
    } catch (MapperException e) {
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.