ProcessEngineRule initialization failed

@Rule ProcessEngineRule rule=new ProcessEngineRule() does n’t work and always creates troubles. I have used cfg.xml but no luck and strangely it says nothing on console as well and JUNIT fails as below.

cfg.xml

<?xml version="1.0" encoding="UTF-8"?>
	<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

	       xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd">
	

	    <bean id="processEngineConfiguration" class="org.camunda.bpm.extension.process_test_coverage.junit.rules.ProcessCoverageInMemProcessEngineConfiguration">
	

	        <property name="history" value="full" />
	        <property name="databaseSchemaUpdate" value="true" />
	        <property name="jobExecutorActivate" value="false" />
	       
	        <property name="idGenerator">
	            <bean class="org.camunda.bpm.engine.impl.persistence.StrongUuidGenerator"/>
	        </property>
	

	    </bean>
	</beans>

I’m facing a new issue everyday and not able to find solutions on forum as well. i humbly request the camunda to include pre-enrolled courses.it is becoming very tough day by day with these strange problems.

JUNIT:

@RunWith(SpringRunner.class)
public class HPath {

	
	
	@Rule
	ProcessEngineRule rule=new ProcessEngineRule();
	
	@Test
	@Deployment(resources= {"WorkFlow.bpmn"})
	public void testInit() {
		
		ProcessInstance instance=runtimeService().startProcessInstanceByKey("CsWorkFlow");
	    System.out.println(instance.getId());
	    assert(instance).isEnded();
	    }
}

NOTE: Initialization error does n’t appear when processenginerule is commented.

There are four different ways to run Camunda (embedded, shared, stand-alone and cluster) :

Few examples of unit tests using ProcessEngineRule:

Your question seems confusing (at least to me) as you seem to be mixing how you configure your process engine. Perhaps provide more details?

1 Like

@paulbors- Thanks for the reply. ProcessEngineRule with @Rule annotation should leave HTML files under a folder in target after running the tests. The above used XML file is used so i can use processenginerule but even after running those tests i can’t see any HTML files. This is the issue being faced.

Please let me know if any additional details are required.

I think you’re looking for this setup:

It’s working pretty well once setup right (follow that README.md and make sure you use ProcessCoverageInMemProcessEngineConfiguration which you seem to be doing). Make sure you check out that proejct and you get yours lined up to theirs (in terms of JUnit versions and other tech stack in your POM etc).