New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for JUnit Jupiter in the flowable-engine #1227
Conversation
…3 / 4 to Junit Jupiter * Move used assertions from TestCase into AbstractTestCase (which is no longer extending TestCase) in order not to migrate all tests * Add CleanTest annotation which instructs the internal extensions to clean all deployments of a test * Add EnsureCleanDb annotation which instructs the internal extensions to perform an assertion for a clean DB and drop and create if it wasn't clean * Add InternalFlowableExtension - a basis for other internal extensions that offers the following possibilities: * Perform a deployment when @deployment is present before each test method * Validate history data after each test * Delete history jobs and deployment after each test * Assert and ensure clean db after each test (or after all test if TestInstance.Lifecycle#PER_CLASS is used) * Support for injecting the ProcessEngine, ProcessEngine services, ProcessEngineConfiguration and the id of the deployment done via @deployment int tests and test lifecycle methods * Add LoggingExtension - an extension which performs the test logging for the Flowable tests * Add PluggableFlowableExtension - an extension which creates a default ProcessEngine and caches it for all tests * Add ResourceFlowableExtension - an extension that starts a new ProcessEngine from a configured resource before each test (needs to be used with @RegisterExtensions) * Add InternalFlowableSpringExtension - an extension that uses SpringExtension to get the ProcessEngine from the Spring ApplicationContext * Adapt TestHelper to user test class, method and the Deployment anotation * Add DeploymentId annotation for injecting the id of a deployment in a test method or test lifecycle methods * Do not use @deployment in ProcessDefinitionEventsService (reason: the listener is required during the deployment) * Use EnabledOnOs for the ShellTaskTest (Should result in 2 ignored tests on each machine) * Remove empty test from StandardAgendaFailingTest and disable endless loop test * Adapt LDAPTestCase to close the ApacheDSContainer after all tests * Modules migrated to use JUnit Jupiter * flowable-camel * flowable-crystalball (partially) * flowable-cxf * flowable-dmn-spring-configurator * flowable-engine * flowable-form-spring-configurator * flowable-groovy-script-static-engine * flowable-http * flowable-ldap-configurator * flowable-spring Modules that have not been migrated will be done in subsequent commits
…flowable-spring modules * Add FlowableExtension - an extension that creates a default Flowable Engine by using flowable.cfg.xml as a resource * Add FlowableSpringExtension - an extension that uses SpringExtension to get the process engine and pass it to the FlowableExtension * Add FlowableTestHelper - a container for the Flowable extension that has the ProcessEngine and helper methods that can be used within tests * Add FlowableTest - an annotation that can be used instead of @ExtendWith(FlowableExtension.class) * Enhance TestHelper to be able to register mocks directly from the MockServiceTask and NoOpServiceTasks annotations * Add support for using the MockServiceTask#id
…nital process validator
…ocess engine is started
Hi @filiphr |
Hey @lamtrhieu thanks for your interested in the PR. The PR is actually already done in the smallest possible pieces (See the multiple commits). However, due to the scope of the PR (migrating the entire testing framework and test of the flowable-engine) there are more than 2000 tests that are affected by this change. Have a look at all files which are not ending on |
…owable5-test module The flowable5 tests should continue running on the old JUnit 3 infrastructure
@filiphr This change looks wrong in
I think it should be |
You are completely right @dbmalkovsky. Thanks a lot for letting us know. I have just fixed that in b65bfb5. |
Migrate flowable-engine and other dependent modules tests from JUnit 3 / 4 to Junit Jupiter
TestCase
intoAbstractTestCase
(which is no longer extendingTestCase
) in order not to migrate all tests@CleanTest
annotation which instructs the internal extensions to clean all deployments of a test@EnsureCleanDb
annotation which instructs the internal extensions to perform an assertion for a clean DB and drop and create if it wasn't cleanInternalFlowableExtension
- a basis for other internal extensions that offers the following possibilities:@Deployment
is present before each test methodTestInstance.Lifecycle#PER_CLASS
is used)and the id of the deployment done via
@Deployment
int tests and test lifecycle methodsLoggingExtension
- an extension which performs the test logging for the Flowable testsPluggableFlowableExtension
- an extension which creates a default ProcessEngine and caches it for all testsResourceFlowableExtension
- an extension that starts a new ProcessEngine from a configured resourcebefore each test (needs to be used with
@RegisterExtensions
)InternalFlowableSpringExtension
- an extension that usesSpringExtension
to get the ProcessEngine from the Spring ApplicationContextTestHelper
to user test class, method and theDeployment
annotation@DeploymentId
annotation for injecting the id of a deployment in a test method or test lifecycle methods@Deployment
in ProcessDefinitionEventsService (reason: the listener is required during the deployment)@EnabledOnOs
for the ShellTaskTest (Should result in 2 ignored tests on each machine)LDAPTestCase
to close theApacheDSContainer
after all testsModules that have not been migrated will be done in subsequent commits.
I have weird tests failing locally, let's see what Travis says