//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Deployment public void testSignalStartEventInEventSubProcess() public virtual void testSignalStartEventInEventSubProcess() { // given ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("signalStartEventInEventSubProcess"); // check if execution exists ExecutionQuery executionQuery = runtimeService.createExecutionQuery().processInstanceId(processInstance.Id); assertEquals(1, executionQuery.count()); // check if user task exists TaskQuery taskQuery = taskService.createTaskQuery().processInstanceId(processInstance.Id); assertEquals(1, taskQuery.count()); // when runtimeService.signalEventReceived("alert-foo"); // then assertEquals(true, DummyServiceTask.wasExecuted); // check if user task doesn't exist because signal start event is interrupting taskQuery = taskService.createTaskQuery().processInstanceId(processInstance.Id); assertEquals(0, taskQuery.count()); // check if execution doesn't exist because signal start event is interrupting executionQuery = runtimeService.createExecutionQuery().processInstanceId(processInstance.Id); assertEquals(0, executionQuery.count()); }
public virtual IList <ExecutionDto> queryExecutions(ExecutionQueryDto queryDto, int?firstResult, int?maxResults) { ProcessEngine engine = ProcessEngine; queryDto.ObjectMapper = ObjectMapper; ExecutionQuery query = queryDto.toQuery(engine); IList <Execution> matchingExecutions; if (firstResult != null || maxResults != null) { matchingExecutions = executePaginatedQuery(query, firstResult, maxResults); } else { matchingExecutions = query.list(); } IList <ExecutionDto> executionResults = new List <ExecutionDto>(); foreach (Execution execution in matchingExecutions) { ExecutionDto resultExecution = ExecutionDto.fromExecution(execution); executionResults.Add(resultExecution); } return(executionResults); }
public void TestSqlServerAliases() { CustomerTableMetadata c = new CustomerTableMetadata(); QueryCriteria qc = new QueryCriteria(c); qc.Add(CriteriaOperator.Equality, c.TableFields[0], 47); qc.Add(CriteriaOperator.Or, c.TableFields[1]); qc.Add(CriteriaOperator.Equality, c.TableFields[0], 48); qc.Add(CriteriaOperator.Between, c.TableFields[0], 48, 70); qc.Add(CriteriaOperator.Like, c.TableFields[1], "blah"); qc.Add(CriteriaOperator.Not, c.TableFields[0], 48); qc.Add(CriteriaOperator.IsNull, c.TableFields[0]); qc.Add(CriteriaOperator.OrderBy, c.TableFields[1], "asc"); qc.Add(CriteriaOperator.OrderBy, c.TableFields[0], "desc"); //aliases qc.AddAlias("Age", "AAAAAAAg"); qc.AddAlias("Name", "Numele_bahhhhhhhhhhhhhh"); IQueryCriteriaGenerator ss = DataFactory.InitializeQueryCriteriaGenerator(DatabaseServer.SqlServer); ExecutionQuery s = ss.GenerateSelect(qc); Console.WriteLine(s.Query); DataSet ds = psqlserver.GetDataSet(qc); Assert.IsTrue(ds != null); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Deployment @Test public void testNonInterruptingSignalStartEventInEventSubProcess() public virtual void testNonInterruptingSignalStartEventInEventSubProcess() { // start process instance ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("nonInterruptingSignalStartEventInEventSubProcess"); // check if execution exists ExecutionQuery executionQuery = runtimeService.createExecutionQuery().processInstanceId(processInstance.Id); assertEquals(1, executionQuery.count()); // check if user task exists TaskQuery taskQuery = taskService.createTaskQuery().processInstanceId(processInstance.Id); assertEquals(1, taskQuery.count()); // send non interrupting signal to event sub process runtimeService.signalEventReceived("alert"); assertEquals(true, DummyServiceTask.wasExecuted); // check if user task still exists because signal start event is non interrupting taskQuery = taskService.createTaskQuery().processInstanceId(processInstance.Id); assertEquals(1, taskQuery.count()); // check if execution still exists because signal start event is non interrupting executionQuery = runtimeService.createExecutionQuery().processInstanceId(processInstance.Id); assertEquals(1, executionQuery.count()); }
public void TestExecuteDataReaderXmlForSqlServer2000() { ExecutionQuery exec = new ExecutionQuery("SELECT * FROM First FOR XML Auto", null); XmlReader xr = ExecutionEngine.ExecuteXmlReader(SharedData.sqlserver, exec); Assert.IsTrue(xr != null); }
public void TestExecuteDataReaderStringQuery() { ExecutionQuery exec = new ExecutionQuery("SELECT * FROM Categories", null); IDataReader iread = dal.ExecuteReader(exec, CommandBehavior.Default); Assert.IsTrue(iread != null); }
public void TestSelectPostgreWithTableName() { CategoryPersistentObject cpo = new CategoryPersistentObject(DatabaseServer.PostgreSql, SharedData.sqlserver, this.ctg); ExecutionQuery query = SqlGenerator.GenerateSelectQuery(DatabaseServer.PostgreSql, ctg.TableName, ctg.TableFields[0], ctg.TableFields[1]); Console.WriteLine(query); Assert.IsTrue(query.Query != string.Empty); }
public virtual void testQueryNoAuthenticatedTenants() { identityService.setAuthentication("user", null, null); ExecutionQuery query = runtimeService.createExecutionQuery(); assertThat(query.count(), @is(1L)); }
public void TestSelectSqlServerByAllFields() { CategoryPersistentObject cpo = new CategoryPersistentObject(DatabaseServer.SqlServer, SharedData.sqlserver, this.ctg); ExecutionQuery query = SqlGenerator.GenerateSelectQuery(DatabaseServer.SqlServer, ctg, false); Console.WriteLine(query); Assert.IsTrue(query.Query != string.Empty); }
public void TestSelectSqlServerByFieldsParametersAndTableMetadata() { CategoryPersistentObject cpo = new CategoryPersistentObject(DatabaseServer.SqlServer, SharedData.sqlserver, this.ctg); ExecutionQuery query = SqlGenerator.GenerateSelectQuery(DatabaseServer.SqlServer, ctg, ctg.TableFields[1]); Console.WriteLine(query); Assert.IsTrue(query.Query != string.Empty); }
public void TestSelectPostgreByPrimaryKey() { CategoryPersistentObject cpo = new CategoryPersistentObject(DatabaseServer.PostgreSql, SharedData.sqlserver, this.ctg); ExecutionQuery query = SqlGenerator.GenerateSelectQuery(DatabaseServer.PostgreSql, ctg, true); Console.WriteLine(query); Assert.IsTrue(query.Query != string.Empty); }
public void TestExecuteNonQueryStringQuery() { ExecutionQuery exec = new ExecutionQuery("INSERT INTO First VALUES('bwhahahhahaha')", null); int x = dal.ExecuteNonQuery(exec); Assert.IsTrue(x > 0); }
private ExecutionQuery setUpMockExecutionQuery(IList <Execution> mockedExecutions) { ExecutionQuery sampleExecutionQuery = mock(typeof(ExecutionQuery)); when(sampleExecutionQuery.list()).thenReturn(mockedExecutions); when(sampleExecutionQuery.count()).thenReturn((long)mockedExecutions.Count); when(processEngine.RuntimeService.createExecutionQuery()).thenReturn(sampleExecutionQuery); return(sampleExecutionQuery); }
public void TestExecuteScalarStringQuery() { ExecutionQuery exc = new ExecutionQuery("SELECT Count(CategoryID) FROM Categories", null); object x = dal.ExecuteScalar(exc); Assert.IsTrue(x != null); }
public void TestExecuteDataSetStringQuery() { ExecutionQuery exec = new ExecutionQuery("SELECT * FROM Customer", null); DataSet ds = dal.ExecuteDataSet(exec); Console.WriteLine("cust " + ds.Tables[0].Rows.Count); Assert.IsTrue(ds != null); }
public virtual void testQueryDisabledTenantCheck() { processEngineConfiguration.TenantCheckEnabled = false; identityService.setAuthentication("user", null, null); ExecutionQuery query = runtimeService.createExecutionQuery(); assertThat(query.count(), @is(3L)); }
public void TestExecuteNonQueryStringQuery() { ExecutionQuery xc = new ExecutionQuery("INSERT INTO First VALUES('bwhahahhahaha')", null); int x = ExecutionEngine.ExecuteNonQuery(DatabaseServer.SqlServer, SharedData.sqlserver, xc); Assert.IsTrue(x > 0); }
public void TestInsertPostgreSqlOverload1() { this.ctg.CategoryName = "Blossom"; this.ctg.Description = "muhahahhaha"; ExecutionQuery s = SqlGenerator.GenerateInsertQuery(DatabaseServer.PostgreSql, this.ctg); Assert.IsTrue(s.Query != null); }
public void TestDeletePostgreSqlOverload3() { CategoryTableMetadata ab = new CategoryTableMetadata(); ab.CategoryName = "Seafood"; ExecutionQuery s = SqlGenerator.GenerateDeleteQuery(DatabaseServer.PostgreSql, ab, false); Assert.IsTrue(s.Query != string.Empty); }
public virtual void testQueryByTenantId() { ExecutionQuery query = runtimeService.createExecutionQuery().tenantIdIn(TENANT_ONE); assertThat(query.count(), @is(1L)); query = runtimeService.createExecutionQuery().tenantIdIn(TENANT_TWO); assertThat(query.count(), @is(1L)); }
private void createExecutionMock() { Execution mockExecution = MockProvider.createMockExecution(); ExecutionQuery mockExecutionQuery = mock(typeof(ExecutionQuery)); when(mockExecutionQuery.processInstanceId(eq(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID))).thenReturn(mockExecutionQuery); when(mockExecutionQuery.singleResult()).thenReturn(mockExecution); when(mockRuntimeService.createExecutionQuery()).thenReturn(mockExecutionQuery); }
public void TestSelectSqlServerByDatabaseFieldsAndPrimaryKeyCondition() { CategoryPersistentObject cpo = new CategoryPersistentObject(DatabaseServer.SqlServer, SharedData.sqlserver, this.ctg); DatabaseField[] ff = new DatabaseField[] { this.ctg.TableFields[0] }; ExecutionQuery query = SqlGenerator.GenerateSelectQuery(DatabaseServer.SqlServer, ctg.TableName, ff, true); Console.WriteLine(query); Assert.IsTrue(query.Query != string.Empty); }
public void TestExecuteNonQueryGetLastGeneratedId() { object x = null; ExecutionQuery exec = new ExecutionQuery("INSERT INTO First values ('buhahhaha')", null); int z = dal.ExecuteNonQuery(exec, "First", "Id", ref x); Assert.IsTrue(z > 0 && x != null); }
public void TestDeleteMySqlOverload1() { CategoryTableMetadata ab = new CategoryTableMetadata(); ab.CategoryName = "Seafood"; ExecutionQuery s = SqlGenerator.GenerateDeleteQuery(DatabaseServer.MySQL, ab.TableName, ab.GetField("CategoryName")); Assert.IsTrue(s.Query != string.Empty); }
public void TestDeleteAccessOverload2() { CategoryTableMetadata ab = new CategoryTableMetadata(); ab.CategoryName = "Seafood"; ExecutionQuery s = SqlGenerator.GenerateDeleteQuery(DatabaseServer.Access, ab, true); Assert.IsTrue(s.Query != string.Empty); }
public void TestSelectAccessWithQuerySelect() { CategoryPersistentObject cpo = new CategoryPersistentObject(DatabaseServer.Access, SharedData.sqlserver, this.ctg); QueryCriteria qc = new QueryCriteria(this.ctg); ExecutionQuery query = SqlGenerator.GenerateSelectQuery(DatabaseServer.Access, ctg); Console.WriteLine(query); Assert.IsTrue(query.Query != string.Empty); }
public virtual void testQueryAuthenticatedTenants() { identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO)); ExecutionQuery query = runtimeService.createExecutionQuery(); assertThat(query.count(), @is(3L)); assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L)); assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(1L)); assertThat(query.withoutTenantId().count(), @is(1L)); }
public void TestSelectAccessByDatabaseFieldsAndWithCondtitionalDatabaseDields() { CategoryPersistentObject cpo = new CategoryPersistentObject(DatabaseServer.Access, SharedData.sqlserver, this.ctg); DatabaseField[] ff = new DatabaseField[] { this.ctg.TableFields[0] }; ExecutionQuery query = SqlGenerator.GenerateSelectQuery(DatabaseServer.Access, ctg.TableName, ff, ctg.TableFields[1]); Console.WriteLine(query); Assert.IsTrue(query.Query != string.Empty); }
public void TestPostgreSqlMax() { QueryCriteria qc = new QueryCriteria(first.TableName, first.TableFields[0]); qc.Add(CriteriaOperator.Max, first.TableFields[0]); IQueryCriteriaGenerator iq = DataFactory.InitializeQueryCriteriaGenerator(DatabaseServer.PostgreSql); ExecutionQuery s = iq.GenerateSelect(qc); Console.WriteLine(s.Query); Assert.IsTrue(s.Query != null); }
public void TestUpdatePostgreSqlByConditionalFields() { CategoryTableMetadata ab = new CategoryTableMetadata(); ab.CategoryID = 8; ab.CategoryName = "Seafood"; ab.Description = "MARius"; //ab.Picture = b; ExecutionQuery s = SqlGenerator.GenerateUpdateQuery(DatabaseServer.PostgreSql, ab.TableName, false, ab.GetPrimaryKeyField(), ab.TableFields); Assert.IsTrue(s.Query != string.Empty); }