[jboss-user] [JBoss Seam] - Re: UnitTesting and jBPM pageflow

stu2 do-not-reply at jboss.com
Fri Jun 22 14:51:28 EDT 2007


It's definitely possible, but I don't know how to make it pretty.  Here's an example from one of my tests:

            log.info("Begin testing initial mapping");
  |             setViewId(MappingViewId.APPLICABLE_FIELDS.id);
  |             invokeMethod("#{catalogMapping.beginForInitialMapping()}");
  |             
  |             Pageflow pageFlow = Pageflow.instance();
  |             assert pageFlow.getNode().getName().equals(MappingViewId.APPLICABLE_FIELDS.node)
  |                 : "found " + pageFlow.getNode().getName();
  |             log.info("current view-id is #0, nodename is #1", pageFlow.getPageViewId(), pageFlow.getNode().getName());
  |             pageFlow.navigate(getFacesContext(), "continue");
  |             assert pageFlow.getNode().getName().equals(MappingViewId.SELECT_FILE.node)
  |             : "found " + pageFlow.getNode().getName();
  |             setViewId(MappingViewId.SELECT_FILE.id);
  |             log.info("current view-id is #0, nodename is #1", pageFlow.getPageViewId(), pageFlow.getNode().getName());
  |             
  |             setValue("#{catalogMapping.uploadFileInputStream}", new ByteArrayInputStream(CsvData.SMALL.getBytes()));
  |             setValue("#{catalogMapping.uploadFileName}", "master.csv");
  | 
  |             // Verify that the merchant is there
  |             Merchant merchant = (Merchant) lookup("merchant");
  |             assert merchant != null: "no merchant!";
  |             
  |             pageFlow.navigate(getFacesContext(), "submit");
  |             // the #{catalogMapping.initForInitialMapping()} should now take place in the pageflow
  | 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056987#4056987

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056987



More information about the jboss-user mailing list