//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldFailWhenActivatingUsingNullId() public virtual void shouldFailWhenActivatingUsingNullId() { try { managementService.activateBatchById(null); fail("Exception expected"); } catch (BadUserRequestException e) { assertThat(e.Message, CoreMatchers.containsString("batch id is null")); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void shouldFailToInsertTooLargeKeyAndValue(RawBytes key, RawBytes value) throws java.io.IOException private void ShouldFailToInsertTooLargeKeyAndValue(RawBytes key, RawBytes value) { Initialize(); try { Insert(key, value); } catch (System.ArgumentException e) { assertThat(e.Message, CoreMatchers.containsString("Index key-value size it to large. Please see index documentation for limitations.")); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldFailWhenActivatingUsingUnknownId() public virtual void shouldFailWhenActivatingUsingUnknownId() { try { managementService.activateBatchById("unknown"); fail("Exception expected"); } catch (BadUserRequestException e) { assertThat(e.Message, CoreMatchers.containsString("Batch for id 'unknown' cannot be found")); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void cannotCreateMigrationPlanBetweenDifferentTenants() public virtual void cannotCreateMigrationPlanBetweenDifferentTenants() { // given ProcessDefinition tenant1Definition = testHelper.deployForTenantAndGetDefinition(TENANT_ONE, ProcessModels.ONE_TASK_PROCESS); ProcessDefinition tenant2Definition = testHelper.deployForTenantAndGetDefinition(TENANT_TWO, ProcessModels.ONE_TASK_PROCESS); // when try { engineRule.RuntimeService.createMigrationPlan(tenant1Definition.Id, tenant2Definition.Id).mapEqualActivities().build(); Assert.fail("exception expected"); } catch (ProcessEngineException e) { // then Assert.assertThat(e.Message, CoreMatchers.containsString("Cannot migrate process instances between processes of different tenants ('tenant1' != 'tenant2')")); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void cannotMigrateInstanceWithoutTenantIdToDifferentTenant() public virtual void cannotMigrateInstanceWithoutTenantIdToDifferentTenant() { // given ProcessDefinition sourceDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS); ProcessDefinition targetDefinition = testHelper.deployForTenantAndGetDefinition(TENANT_ONE, ProcessModels.ONE_TASK_PROCESS); ProcessInstance processInstance = engineRule.RuntimeService.startProcessInstanceById(sourceDefinition.Id); MigrationPlan migrationPlan = engineRule.RuntimeService.createMigrationPlan(sourceDefinition.Id, targetDefinition.Id).mapEqualActivities().build(); // when try { engineRule.RuntimeService.newMigration(migrationPlan).processInstanceIds(Arrays.asList(processInstance.Id)).execute(); Assert.fail("exception expected"); } catch (ProcessEngineException e) { Assert.assertThat(e.Message, CoreMatchers.containsString("Cannot migrate process instance '" + processInstance.Id + "' without tenant to a process definition with a tenant ('tenant1')")); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void cannotMigrateInstanceWithoutTenantIdToDifferentTenant() public virtual void cannotMigrateInstanceWithoutTenantIdToDifferentTenant() { // given ProcessDefinition sourceDefinition = defaultTestRule.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS); ProcessDefinition targetDefinition = defaultTestRule.deployForTenantAndGetDefinition(TENANT_ONE, ProcessModels.ONE_TASK_PROCESS); ProcessInstance processInstance = defaultEngineRule.RuntimeService.startProcessInstanceById(sourceDefinition.Id); MigrationPlan migrationPlan = defaultEngineRule.RuntimeService.createMigrationPlan(sourceDefinition.Id, targetDefinition.Id).mapEqualActivities().build(); Batch batch = defaultEngineRule.RuntimeService.newMigration(migrationPlan).processInstanceIds(Arrays.asList(processInstance.Id)).executeAsync(); batchHelper.executeSeedJob(batch); // when batchHelper.executeJobs(batch); // then Job migrationJob = batchHelper.getExecutionJobs(batch)[0]; Assert.assertThat(migrationJob.ExceptionMessage, CoreMatchers.containsString("Cannot migrate process instance '" + processInstance.Id + "' without tenant to a process definition with a tenant ('tenant1')")); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void cannotMigrateInstanceBetweenDifferentTenants() public virtual void cannotMigrateInstanceBetweenDifferentTenants() { // given ProcessDefinition sharedDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS); ProcessDefinition tenantDefinition = testHelper.deployForTenantAndGetDefinition(TENANT_TWO, ProcessModels.ONE_TASK_PROCESS); ProcessInstance processInstance = startInstanceForTenant(sharedDefinition, TENANT_ONE); MigrationPlan migrationPlan = engineRule.RuntimeService.createMigrationPlan(sharedDefinition.Id, tenantDefinition.Id).mapEqualActivities().build(); // when try { engineRule.RuntimeService.newMigration(migrationPlan).processInstanceIds(Arrays.asList(processInstance.Id)).execute(); Assert.fail("exception expected"); } catch (ProcessEngineException e) { Assert.assertThat(e.Message, CoreMatchers.containsString("Cannot migrate process instance '" + processInstance.Id + "' " + "to a process definition of a different tenant ('tenant1' != 'tenant2')")); } // then Assert.assertNotNull(migrationPlan); }
/* This is somewhat difficult to test since dropping an index while it's populating forces it to be cancelled * first (and also awaiting cancellation to complete). So this is a best-effort to have the timing as close * as possible. If this proves to be flaky, remove it right away. */ //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldBeAbleToDropIndexWhileItIsPopulating() public virtual void ShouldBeAbleToDropIndexWhileItIsPopulating() { // GIVEN StartDb(); DoubleLatch populationCompletionLatch = _provider.installPopulationJobCompletionLatch(); IndexDefinition index = CreateIndex(); populationCompletionLatch.WaitForAllToStart(); // await population job to start // WHEN DropIndex(index, populationCompletionLatch); // THEN assertThat(getIndexes(_db, _myLabel), inTx(_db, hasSize(0))); try { getIndexState(_db, index); fail("This index should have been deleted"); } catch (NotFoundException e) { assertThat(e.Message, CoreMatchers.containsString(_myLabel.name())); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldNotBeAbleToParsePointsWithConflictingDuplicateFields() internal virtual void ShouldNotBeAbleToParsePointsWithConflictingDuplicateFields() { assertThat(AssertCannotParse("{latitude: 2.0, longitude: 1.0, latitude: 3.0}").Message, CoreMatchers.containsString("Duplicate field")); assertThat(AssertCannotParse("{latitude: 2.0, longitude: 1.0, latitude: 3.0}").Message, CoreMatchers.containsString("Duplicate field")); assertThat(AssertCannotParse("{crs: 'cartesian', x: 2.0, x: 1.0, y: 3}").Message, CoreMatchers.containsString("Duplicate field")); assertThat(AssertCannotParse("{crs: 'invalid crs', x: 1.0, y: 3, crs: 'cartesian'}").Message, CoreMatchers.containsString("Duplicate field")); }