[jBPM] - jBPM JUnit tests are failing
by Michael Wagner
Michael Wagner [http://community.jboss.org/people/michael.wagner] created the discussion
"jBPM JUnit tests are failing"
To view the discussion, visit: http://community.jboss.org/message/616326#616326
--------------------------------------------------------------
Hi,
I have downloaded the junit tests from:
http://sourceforge.net/projects/jbpm/files/jBPM%205/jbpm-5.1.0.Final/jbpm... http://sourceforge.net/projects/jbpm/files/jBPM%205/jbpm-5.1.0.Final/jbpm...
First: big thank you for providing so many unit tests! Makes is absolutly clear how to use the api.
Running JBPM2UnitTests.java gives me always one failure in testTimerStart:
junit.framework.AssertionFailedError: expected:<5> but was:<4>
"Correcting" the value to 4 gives a failure in testTimerStartCron:
junit.framework.AssertionFailedError: expected:<5> but was:<6>
"Correcting" the value here to 6 gives no more failures any more.
public void testTimerStartCron() throws Exception {
KnowledgeBase kbase = createKnowledgeBase("BPMN2-TimerStartCron.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(500);
for (int i = 0; i < 5; i++) {
ksession.fireAllRules();
Thread.sleep(1000);
}
assertEquals(6, list.size());
}
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);
}
assertEquals(4, list.size());
}
Besides that I cannot understand the values by reading the code: what I definitively do not understand is: how can somebody write tests depending on a "Thread.sleep"? Are there no events one could wait for? This gives a situation which is not deterministic! This is because time is not processor time.
Please tell me how the junit tests in these cases could be re-written in a deterministic way.
We are in an automotive area and cannot affort to run software which can not be testet in a deterministic way.
Michael
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/616326#616326]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 9 months
[jBPM] - URGENT: JBPM 5.1 Final Release with jboss-5.1 - Seam Configuration
by priyakpandey
priyakpandey [http://community.jboss.org/people/priyakpandey] created the discussion
"URGENT: JBPM 5.1 Final Release with jboss-5.1 - Seam Configuration"
To view the discussion, visit: http://community.jboss.org/message/616269#616269
--------------------------------------------------------------
Hi,
Can i configure JBPM 5.1 to use Seam with JBOSS Application server for login?
I need this feature because my classes which needs to be accessed from Service Task uses Seam.
As soon as i put following in web.xml of gwt-console-server.war (for testing purpose I am using DB authentication. i have not yet configured SeamLoginModule because of following errors)
<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Seam Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
I get following exception in the server.log as well as on the jbpm-console. Can this be configured? If it is possible then can i get some help as how to do this?
This is critical for me as my next client release needs this. Any help would be appreciated.
2011-07-19 21:29:40,624 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/gwt-console-server].[Resteasy]] (http-localhost%2F127.0.0.1-8080-7) Servlet.service() for servlet Resteasy threw exception
org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException
at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:319)
at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:230)
at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:206)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:360)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at org.jboss.bpm.console.server.UserMgmtFacade.getRolesForJAASPrincipal(UserMgmtFacade.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)
at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)
at org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
... 50 more
2011-07-19 21:29:40,625 TRACE [org.jboss.security.SecurityAssociation] (http-localhost%2F127.0.0.1-8080-7) clear, server=true
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/616269#616269]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 9 months
[jBPM] - jbpm5 pesist setGlobal getGlobal problem
by okey9 zeng
okey9 zeng [http://community.jboss.org/people/okey9] created the discussion
"jbpm5 pesist setGlobal getGlobal problem"
To view the discussion, visit: http://community.jboss.org/message/616249#616249
--------------------------------------------------------------
Hi:
i have global value problem...
i use the method of setGlobal in Persistence ,
for example:
1. ksession = (CommandBasedStatefulKnowledgeSession)JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);
2. ksession.setGlobal("testkey","testValue");
3. ksession.startProcess(processId);
4. ksession.dispose();
then i use
ksession = (CommandBasedStatefulKnowledgeSession)JPAKnowledgeService.loadStatefulKnowledgeSession(ksessionId,kbase, config, env);
get the ksession again,
then ksession.getGlobal("testkey") is null,
why? and how do use the globalValue in Persistence..
thanks for u !
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/616249#616249]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 9 months