Exemple #1
0
        // 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());
        }
Exemple #2
0
        // 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());
        }
Exemple #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void tearDown() throws Exception
        protected internal virtual void tearDown()
        {
            DynamicResourceProducer.clearResources();
            removeAllDeployments();
            this.applicationContext = null;
            this.repositoryService  = null;
            base.tearDown();
        }