Deployed models are cached during unit tests [message #1703291] |
Thu, 30 July 2015 07:05  |
Eclipse User |
|
|
|
I am using Stardust 2.1.1, and currently I am writing unit tests with JUnit, Spring and an in-memory Derby database. I would like to create a clean state for each of the unit tests, so I create and initialize the database before every test method and drop it after method executions. I also dispose of the Spring application context and initialize it between test methods with the @DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) annotation.
My problem is that despite dropping the database and reinitializing the Spring context after every test method my previously deployed models are still cached and I get an authorization-related exception:
org.eclipse.stardust.common.error.AccessForbiddenException: AUTHx01000 - The user 'motu' does not have the permission 'model.deployProcessModel'.
at org.eclipse.stardust.engine.core.runtime.utils.Authorization2.checkPermission(Authorization2.java:332) ~[carnot-engine-2.1.1.jar:2.1.1]
at org.eclipse.stardust.engine.core.runtime.beans.interceptors.GuardingInterceptor.invoke(GuardingInterceptor.java:52) ~[carnot-engine-2.1.1.jar:2.1.1]
at org.eclipse.stardust.engine.core.runtime.interceptor.MethodInvocationImpl.proceed(MethodInvocationImpl.java:130) [carnot-engine-2.1.1.jar:2.1.1]
at org.eclipse.stardust.engine.core.runtime.beans.interceptors.AbstractLoginInterceptor.performCall(AbstractLoginInterceptor.java:201) ~[carnot-engine-2.1.1.jar:2.1.1]
at org.eclipse.stardust.engine.core.runtime.beans.interceptors.AbstractLoginInterceptor.invoke(AbstractLoginInterceptor.java:131) ~[carnot-engine-2.1.1.jar:2.1.1]
at org.eclipse.stardust.engine.api.spring.SpringBeanLoginInterceptor.invoke(SpringBeanLoginInterceptor.java:79) ~[carnot-spring-2.1.1.jar:2.1.1]
at org.eclipse.stardust.engine.core.runtime.interceptor.MethodInvocationImpl.proceed(MethodInvocationImpl.java:130) [carnot-engine-2.1.1.jar:2.1.1]
at org.eclipse.stardust.engine.api.spring.SpringSessionInterceptor.doWithDataSource(SpringSessionInterceptor.java:142) ~[carnot-spring-2.1.1.jar:2.1.1]
at org.eclipse.stardust.engine.api.spring.SpringSessionInterceptor.access$000(SpringSessionInterceptor.java:48) ~[carnot-spring-2.1.1.jar:2.1.1]
at org.eclipse.stardust.engine.api.spring.SpringSessionInterceptor$1.doInConnection(SpringSessionInterceptor.java:87) ~[carnot-spring-2.1.1.jar:2.1.1]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:350) ~[spring-jdbc-4.1.6.RELEASE.jar:4.1.6.RELEASE]
...
I looked into the code and found out that the ModelManagerBean and ModelMananagerBeanPartition classes cache my test model. I set the Infinity.Engine.Caching property to false in my carnot.properties as per the online documentation but the model is still getting cached.
What is the proper way to disable caching in Stardust or how can I ensure that it disposes of everything that is cached?
Thank you.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.46927 seconds