Search in sources :

Example 6 with TableMetaData

use of org.activiti.engine.management.TableMetaData in project Activiti by Activiti.

the class ManagementServiceTest method testGetTableMetaData.

public void testGetTableMetaData() {
    String tablePrefix = processEngineConfiguration.getDatabaseTablePrefix();
    TableMetaData tableMetaData = managementService.getTableMetaData(tablePrefix + "ACT_RU_TASK");
    assertThat(tableMetaData.getColumnTypes()).hasSize(tableMetaData.getColumnNames().size());
    assertThat(tableMetaData.getColumnNames()).hasSize(22);
    int assigneeIndex = tableMetaData.getColumnNames().indexOf("ASSIGNEE_");
    int createTimeIndex = tableMetaData.getColumnNames().indexOf("CREATE_TIME_");
    assertThat(assigneeIndex).isGreaterThanOrEqualTo(0);
    assertThat(createTimeIndex).isGreaterThanOrEqualTo(0);
    assertThat(tableMetaData.getColumnTypes().get(assigneeIndex)).isIn("VARCHAR", "NVARCHAR2", "nvarchar", "NVARCHAR");
    assertThat(tableMetaData.getColumnTypes().get(createTimeIndex)).isIn("TIMESTAMP", "TIMESTAMP(6)", "datetime", "DATETIME");
}
Also used : TableMetaData(org.activiti.engine.management.TableMetaData)

Aggregations

TableMetaData (org.activiti.engine.management.TableMetaData)6 DatabaseMetaData (java.sql.DatabaseMetaData)2 ResultSet (java.sql.ResultSet)2 SQLException (java.sql.SQLException)2 ActivitiException (org.activiti.engine.ActivitiException)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 Label (com.vaadin.ui.Label)1 Table (com.vaadin.ui.Table)1 LazyLoadingContainer (org.activiti.explorer.data.LazyLoadingContainer)1 LazyLoadingQuery (org.activiti.explorer.data.LazyLoadingQuery)1 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)1 HttpGet (org.apache.http.client.methods.HttpGet)1