// Updating the bpmn20 file should lead to a new deployment when restarting the Spring container //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void testResourceRedeploymentAfterProcessDefinitionChange() throws Exception public virtual void testResourceRedeploymentAfterProcessDefinitionChange() { // given BpmnModelInstance model1 = Bpmn.createExecutableProcess("model1").startEvent("oldId").endEvent().done(); BpmnModelInstance model2 = Bpmn.createExecutableProcess("model1").startEvent("newId").endEvent().done(); BpmnModelInstance model3 = Bpmn.createExecutableProcess("model2").startEvent().endEvent().done(); DynamicResourceProducer.addResource("a.bpmn", model1); DynamicResourceProducer.addResource("b.bpmn", model3); createAppContext(CTX_DYNAMIC_DEPLOY_PATH); assertEquals(1, repositoryService.createDeploymentQuery().count()); ((AbstractXmlApplicationContext)applicationContext).destroy(); // when DynamicResourceProducer.clearResources(); DynamicResourceProducer.addResource("a.bpmn", model2); DynamicResourceProducer.addResource("b.bpmn", model3); applicationContext = new ClassPathXmlApplicationContext(CTX_DYNAMIC_DEPLOY_PATH); repositoryService = (RepositoryService)applicationContext.getBean("repositoryService"); // then // Assertions come AFTER the file write! Otherwise the process file is messed up if the assertions fail. assertEquals(2, repositoryService.createDeploymentQuery().count()); assertEquals(4, repositoryService.createProcessDefinitionQuery().count()); }
// when deployChangeOnly=true, new deployment should be created only for the changed resources //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void testDeployChangeOnly() throws Exception public virtual void testDeployChangeOnly() { // given BpmnModelInstance model1 = Bpmn.createExecutableProcess("model1").startEvent("oldId").endEvent().done(); BpmnModelInstance model2 = Bpmn.createExecutableProcess("model1").startEvent("newId").endEvent().done(); BpmnModelInstance model3 = Bpmn.createExecutableProcess("model2").startEvent().endEvent().done(); DynamicResourceProducer.addResource("a.bpmn", model1); DynamicResourceProducer.addResource("b.bpmn", model3); createAppContext(CTX_DEPLOY_CHANGE_ONLY_PATH); // assume assertEquals(1, repositoryService.createDeploymentQuery().count()); // when ((AbstractXmlApplicationContext)applicationContext).destroy(); DynamicResourceProducer.clearResources(); DynamicResourceProducer.addResource("a.bpmn", model2); DynamicResourceProducer.addResource("b.bpmn", model3); applicationContext = new ClassPathXmlApplicationContext(CTX_DEPLOY_CHANGE_ONLY_PATH); repositoryService = (RepositoryService)applicationContext.getBean("repositoryService"); // then assertEquals(2, repositoryService.createDeploymentQuery().count()); assertEquals(3, repositoryService.createProcessDefinitionQuery().count()); }