Buggy code:
public class ErrorEventSubProcessTest extends PluggableProcessEngineTestCase { @ Deployment public void testEventSubprocessTakesPrecedence ( ) { } @ Deployment public void testErrorCodeTakesPrecedence ( ) { } @ Deployment public void testCatchErrorInEmbeddedSubProcess ( ) { } @ Deployment public void testCatchErrorThrownByScriptTaskInEmbeddedSubProcess ( ) { } @ Deployment public void testCatchErrorThrownByScriptTaskInEmbeddedSubProcessWithErrorCode ( ) { } @ Deployment public void testCatchErrorThrownByScriptTaskInTopLevelProcess ( ) { } @ Deployment public void testCatchErrorThrownByScriptTaskInsideSubProcessInTopLevelProcess ( ) { } @ Deployment ( resources = { "org//camunda//bpm//engine//test//bpmn//event//error//ErrorEventSubProcessTest.testThrowErrorInScriptTaskInsideCallActivitiCatchInTopLevelProcess.bpmn20.xml" , "org//camunda//bpm//engine//test//bpmn//event//error//BoundaryErrorEventTest.testCatchErrorThrownByJavaDelegateOnCallActivity-child.bpmn20.xml" } ) public void testThrowErrorInScriptTaskInsideCallActivitiCatchInTopLevelProcess ( ) { } @ Deployment ( resources = { "org//camunda//bpm//engine//test//bpmn//event//error//ErrorEventSubProcessTest.testCatchErrorThrownByAbstractBpmnActivityBehavior.bpmn20.xml" } ) public void testCatchExceptionThrownByExecuteOfAbstractBpmnActivityBehavior ( ) { } @ Deployment ( resources = { "org//camunda//bpm//engine//test//bpmn//event//error//ErrorEventSubProcessTest.testCatchErrorThrownByAbstractBpmnActivityBehavior.bpmn20.xml" } ) public void testCatchErrorThrownByExecuteOfAbstractBpmnActivityBehavior ( ) { } @ Deployment ( resources = { "org//camunda//bpm//engine//test//bpmn//event//error//ErrorEventSubProcessTest.testCatchErrorThrownByAbstractBpmnActivityBehavior.bpmn20.xml" } ) public void testCatchExceptionThrownBySignalOfAbstractBpmnActivityBehavior ( ) { } @ Deployment ( resources = { "org//camunda//bpm//engine//test//bpmn//event//error//ErrorEventSubProcessTest.testCatchErrorThrownByAbstractBpmnActivityBehavior.bpmn20.xml" } ) public void testCatchErrorThrownBySignalOfAbstractBpmnActivityBehavior ( ) { } @ Deployment ( resources = { "org//camunda//bpm//engine//test//bpmn//event//error//ErrorEventSubProcessTest.testCatchErrorThrownByDelegateExpression.bpmn20.xml" } ) public void testCatchExceptionThrownByExecuteOfDelegateExpression ( ) { } @ Deployment ( resources = { "org//camunda//bpm//engine//test//bpmn//event//error//ErrorEventSubProcessTest.testCatchErrorThrownByDelegateExpression.bpmn20.xml" } ) public void testCatchErrorThrownByExecuteOfDelegateExpression ( ) { } @ Deployment ( resources = { "org//camunda//bpm//engine//test//bpmn//event//error//ErrorEventSubProcessTest.testCatchErrorThrownByDelegateExpression.bpmn20.xml" } ) public void testCatchExceptionThrownBySignalOfDelegateExpression ( ) { } @ Deployment ( resources = { "org//camunda//bpm//engine//test//bpmn//event//error//ErrorEventSubProcessTest.testCatchErrorThrownByDelegateExpression.bpmn20.xml" } ) public void testCatchErrorThrownBySignalOfDelegateExpression ( ) { } private void assertThatErrorHasBeenCaught ( String procId ) { } @ Deployment public void testCatchErrorEventSubprocessSetErrorCodeVariable ( ) { } @ Deployment ( resources = { "org//camunda//bpm//engine//test//bpmn//event//error//ThrowErrorProcess.bpmn" , "org//camunda//bpm//engine//test//bpmn//event//error//ErrorEventSubProcessTest.testCatchErrorFromCallActivitySetsErrorVariable.bpmn" } ) public void testCatchErrorFromCallActivitySetsErrorVariable ( ) { } <START_BUG> @ Deployment ( resources = { "org//camunda//bpm//engine//test//bpmn//event//error//ErrorEventSubProcessTest.testCatchBpmnErrorFromJavaDelegateInsideCallActivitySetsErrorVariable.bpmn" , "org//camunda//bpm//engine//test//bpmn//callActivity//subProcessWithThrownError.bpmn" } ) <END_BUG> public void testCatchBpmnErrorFromJavaDelegateInsideCallActivitySetsErrorVariable ( ) { runtimeService . startProcessInstanceByKey ( "Process_1" ) ; Task task = taskService . createTaskQuery ( ) . singleResult ( ) ; taskService . complete ( task . getId ( ) ) ; String variableName = "errorCode" ; Object errorCode = "errorCode" ; VariableInstance errorVariable = runtimeService . createVariableInstanceQuery ( ) . variableName ( variableName ) . singleResult ( ) ; assertThat ( errorVariable . getValue ( ) , is ( errorCode ) ) ; } }

Fix:
@ Deployment ( resources = { "org//camunda//bpm//engine//test//bpmn//event//error//ErrorEventSubProcessTest.testCatchBpmnErrorFromJavaDelegateInsideCallActivitySetsErrorVariable.bpmn" , "org//camunda//bpm//engine//test//bpmn//callactivity//subProcessWithThrownError.bpmn" } )