public void testDeployAppReusingExistingEngine() {

    // register existing process engine with BPM platform
    RuntimeContainerDelegate runtimeContainerDelegate = RuntimeContainerDelegate.INSTANCE.get();
    runtimeContainerDelegate.registerProcessEngine(processEngine);

    TestApplicationReusingExistingEngine processApplication =
        new TestApplicationReusingExistingEngine();
    processApplication.deploy();

    assertEquals(1, repositoryService.createDeploymentQuery().count());

    processApplication.undeploy();

    assertEquals(0, repositoryService.createDeploymentQuery().count());

    // unregister process engine
    runtimeContainerDelegate.unregisterProcessEngine(processEngine);
  }
 public void tearDown() {
   if (defaultEngineRegistered) {
     runtimeContainerDelegate.unregisterProcessEngine(processEngine);
   }
 }
 public void registerProcessEngine() {
   runtimeContainerDelegate.registerProcessEngine(processEngine);
   defaultEngineRegistered = true;
 }