[jboss-dev-forums] [jBPM Development] - Re: jBPM JUnit tests are failing

Michael Wagner do-not-reply at jboss.com
Wed Jul 20 09:03:03 EDT 2011


Michael Wagner [http://community.jboss.org/people/michael.wagner] created the discussion

"Re: jBPM JUnit tests are failing"

To view the discussion, visit: http://community.jboss.org/message/616392#616392

--------------------------------------------------------------
Just getting more confused. If I increase the "sleep", the "list" increases, too:

    public void testTimerStart() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-TimerStart.bpmn2");
          StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
          final List list = new ArrayList();
          ksession.addEventListener(new DefaultProcessEventListener() {
               public void afterProcessStarted(ProcessStartedEvent event) {
                    list.add(event.getProcessInstance().getId());
               }
          });
          Thread.sleep(250);
          assertEquals(0, list.size());
        for (int i = 0; i < 5; i++) {
             ksession.fireAllRules();
             Thread.sleep(500);
        }
        // the longer the time is the more process instances are in "list"
            Thread.sleep(3500);
        assertEquals(5, list.size());
    }
 



junit.framework.AssertionFailedError: expected:<5> but was:<9>
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/616392#616392]

Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2035]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20110720/fe59cb69/attachment.html 


More information about the jboss-dev-forums mailing list