Search in sources :

Example 26 with DeploymentQuery

use of org.activiti.engine.repository.DeploymentQuery in project Activiti by Activiti.

the class SpringAutoDeployTest method testNoRedeploymentForSpringContainerRestart.

public void testNoRedeploymentForSpringContainerRestart() throws Exception {
    createAppContext(CTX_PATH);
    DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
    assertThat(deploymentQuery.count()).isEqualTo(1);
    ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery();
    assertThat(processDefinitionQuery.count()).isEqualTo(3);
    // Creating a new app context with same resources doesn't lead to more
    // deployments
    new ClassPathXmlApplicationContext(CTX_NO_DROP_PATH);
    assertThat(deploymentQuery.count()).isEqualTo(1);
    assertThat(processDefinitionQuery.count()).isEqualTo(3);
}
Also used : DeploymentQuery(org.activiti.engine.repository.DeploymentQuery) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ProcessDefinitionQuery(org.activiti.engine.repository.ProcessDefinitionQuery)

Example 27 with DeploymentQuery

use of org.activiti.engine.repository.DeploymentQuery in project Activiti by Activiti.

the class DeploymentQueryEscapeClauseTest method testQueryByProcessDefinitionKeyLike.

public void testQueryByProcessDefinitionKeyLike() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().processDefinitionKeyLike("%\\_%");
    assertThat(query.list()).hasSize(1);
    assertThat(query.count()).isEqualTo(1);
}
Also used : DeploymentQuery(org.activiti.engine.repository.DeploymentQuery)

Example 28 with DeploymentQuery

use of org.activiti.engine.repository.DeploymentQuery in project Activiti by Activiti.

the class DeploymentQueryEscapeClauseTest method testQueryByNameLike.

public void testQueryByNameLike() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentNameLike("%\\%%");
    assertThat(query.singleResult().getName()).isEqualTo("one%");
    assertThat(query.list()).hasSize(1);
    assertThat(query.count()).isEqualTo(1);
    query = repositoryService.createDeploymentQuery().deploymentNameLike("%\\_%");
    assertThat(query.singleResult().getName()).isEqualTo("two_");
    assertThat(query.list()).hasSize(1);
    assertThat(query.count()).isEqualTo(1);
}
Also used : DeploymentQuery(org.activiti.engine.repository.DeploymentQuery)

Aggregations

DeploymentQuery (org.activiti.engine.repository.DeploymentQuery)28 Deployment (org.activiti.engine.repository.Deployment)8 BPMNDeployment (org.wso2.carbon.bpmn.core.mgt.model.BPMNDeployment)6 ArrayList (java.util.ArrayList)5 ActivitiException (org.activiti.engine.ActivitiException)3 ActivitiIllegalArgumentException (org.activiti.engine.ActivitiIllegalArgumentException)3 ProcessEngine (org.activiti.engine.ProcessEngine)3 ProcessDefinitionQuery (org.activiti.engine.repository.ProcessDefinitionQuery)3 HashSet (java.util.HashSet)2 RepositoryService (org.activiti.engine.RepositoryService)2 ProcessDefinition (org.activiti.engine.repository.ProcessDefinition)2 PermissionDeniedException (org.alfresco.rest.framework.core.exceptions.PermissionDeniedException)2 Deployment (org.alfresco.rest.workflow.api.model.Deployment)2 BPMNProcess (org.wso2.carbon.bpmn.core.mgt.model.BPMNProcess)2 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 DataResponse (org.activiti.rest.common.api.DataResponse)1