You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ca...@ocean7.com on 2006/01/24 21:47:11 UTC

unit testing

Hi everyone,

many thanks for all who produce the framework.

for our current project we move to version 4. among many other
improvements, the input validation seems much cleaner now,
so we want to use it.

implemented our custom ValidationDelegate. no problem here. next, 
we want a message block above the form, implemented somehow 
like this:

public void submitForm(IRequestCycle cycle) {

  List errormsgs = new ArrayList();
  IValidationDelegate delegate = (IValidationDelegate) getBeans().getBean("delegate");
  if (delegate.getHasErrors()) {
    List ftlst = delegate.getFieldTracking();
    for (int i = 0; i < ftlst.size(); i++) {
      IFieldTracking ft = (IFieldTracking) ftlst.get(i);
      if (ft.isInError()) {
        errormsgs.add(ft.getErrorRenderer().toString());
      }
    }
  }
  ...
}

this causes a problem with the unit testing. the 'Creator' creates 
the class but the 'getBeans()' method doesn't seem to exist and i 
surely don't know howto set the IBeanProvider and even less
howto maybe prepare and set the 'IValidationDelegate'.

any ideas?

Thanks,
Carst
-- 
Carsten Heinrigs
Ocean-7 Development
Tel: 212 533-8460



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org