//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void definitionTwoPreviousDeploymentUnregisterSecondPA() public virtual void definitionTwoPreviousDeploymentUnregisterSecondPA() { // given // first deployment MyEmbeddedProcessApplication application1 = new MyEmbeddedProcessApplication(this); Deployment deployment1 = repositoryService.createDeployment(application1.Reference).name(DEPLOYMENT_NAME).addClasspathResource(resource1).deploy(); // second deployment MyEmbeddedProcessApplication application2 = new MyEmbeddedProcessApplication(this); Deployment deployment2 = repositoryService.createDeployment(application2.Reference).name(DEPLOYMENT_NAME).addClasspathResource(resource1).deploy(); // second deployment Deployment deployment3 = repositoryService.createDeployment().name(DEPLOYMENT_NAME).addDeploymentResources(deployment1.Id).deploy(); assertEquals(3, testProvider.countDefinitionsByKey(definitionKey1)); // when managementService.unregisterProcessApplication(deployment2.Id, true); testProvider.createInstanceByDefinitionKey(definitionKey1); // then assertTrue(application1.Called); assertFalse(application2.Called); deleteDeployments(deployment1, deployment2, deployment3); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void definitionOnePreviousDeploymentWithPA() public virtual void definitionOnePreviousDeploymentWithPA() { // given MyEmbeddedProcessApplication application = new MyEmbeddedProcessApplication(this); // first deployment Deployment deployment1 = repositoryService.createDeployment(application.Reference).name(DEPLOYMENT_NAME).addClasspathResource(resource1).deploy(); // second deployment Deployment deployment2 = repositoryService.createDeployment().name(DEPLOYMENT_NAME).addDeploymentResources(deployment1.Id).deploy(); assertEquals(2, testProvider.countDefinitionsByKey(definitionKey1)); // when testProvider.createInstanceByDefinitionKey(definitionKey1); // then assertTrue(application.Called); deleteDeployments(deployment1, deployment2); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void definitionTwoPreviousDeploymentsWithDifferentPA() public virtual void definitionTwoPreviousDeploymentsWithDifferentPA() { // given // first deployment MyEmbeddedProcessApplication application1 = new MyEmbeddedProcessApplication(this); Deployment deployment1 = repositoryService.createDeployment(application1.Reference).name(DEPLOYMENT_NAME).addClasspathResource(resource1).addClasspathResource(resource2).deploy(); // second deployment MyEmbeddedProcessApplication application2 = new MyEmbeddedProcessApplication(this); Deployment deployment2 = repositoryService.createDeployment(application2.Reference).name(DEPLOYMENT_NAME).addClasspathResource(resource1).deploy(); // third deployment Deployment deployment3 = repositoryService.createDeployment().name(DEPLOYMENT_NAME).addDeploymentResources(deployment1.Id).deploy(); assertEquals(3, testProvider.countDefinitionsByKey(definitionKey1)); assertEquals(2, testProvider.countDefinitionsByKey(definitionKey2)); // when (1) testProvider.createInstanceByDefinitionKey(definitionKey1); // then (1) assertFalse(application1.Called); assertTrue(application2.Called); // reset flag application2.Called = false; // when (2) testProvider.createInstanceByDefinitionKey(definitionKey2); // then (2) assertTrue(application1.Called); assertFalse(application2.Called); deleteDeployments(deployment1, deployment2, deployment3); }