Package org.camunda.bpm.engine.repository

Examples of org.camunda.bpm.engine.repository.DeploymentQuery


  }

  private void createDeploymentMock() {
    Deployment mockDeployment = MockProvider.createMockDeployment();

    DeploymentQuery deploymentQueryMock = mock(DeploymentQuery.class);
    when(deploymentQueryMock.deploymentId(anyString())).thenReturn(deploymentQueryMock);
    when(deploymentQueryMock.singleResult()).thenReturn(mockDeployment);

    when(mockRepoService.createDeploymentQuery()).thenReturn(deploymentQueryMock);
  }
View Full Code Here


  public void setUpRuntimeData() {
    mockedQuery = setUpMockDeploymentQuery(MockProvider.createMockDeployments());
  }

  private DeploymentQuery setUpMockDeploymentQuery(List<Deployment> mockedDeployments) {
    DeploymentQuery sampleDeploymentQuery = mock(DeploymentQuery.class);
    when(sampleDeploymentQuery.list()).thenReturn(mockedDeployments);
    when(sampleDeploymentQuery.count()).thenReturn((long) mockedDeployments.size());
    when(processEngine.getRepositoryService().createDeploymentQuery()).thenReturn(sampleDeploymentQuery);
    return sampleDeploymentQuery;
  }
View Full Code Here

        .deploy()
        .getId();

    // there should be one deployment
    RepositoryService repositoryService = engine.getRepositoryService();
    DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();

    assertEquals(1, deploymentQuery.count());

    // there should be one case definition
    CaseDefinitionQuery query = engine.getRepositoryService().createCaseDefinitionQuery();
    assertEquals(1, query.count());
View Full Code Here

        .createProcessDefinitionQuery()
        .latestVersion()
        .processDefinitionKey(processKey)
        .singleResult();   
   
    DeploymentQuery deploymentQuery = repositoryService
        .createDeploymentQuery()
        .deploymentId(processDefinition.getDeploymentId());
   
    Assert.assertEquals(expectedDeploymentName, deploymentQuery.singleResult().getName());
   
  }
View Full Code Here

        .createProcessDefinitionQuery()
        .latestVersion()
        .processDefinitionKey(processKey)
        .singleResult();   
   
    DeploymentQuery deploymentQuery = repositoryService
        .createDeploymentQuery()
        .deploymentId(processDefinition.getDeploymentId());
   
    Assert.assertEquals(expectedDeploymentName, deploymentQuery.singleResult().getName());
   
  }
View Full Code Here

        .createProcessDefinitionQuery()
        .latestVersion()
        .processDefinitionKey(processKey)
        .singleResult();   
   
    DeploymentQuery deploymentQuery = repositoryService
        .createDeploymentQuery()
        .deploymentId(processDefinition.getDeploymentId());
   
    Assert.assertEquals(expectedDeploymentName, deploymentQuery.singleResult().getName());
   
  }
View Full Code Here

        .createProcessDefinitionQuery()
        .latestVersion()
        .processDefinitionKey(processKey)
        .singleResult();   
   
    DeploymentQuery deploymentQuery = repositoryService
        .createDeploymentQuery()
        .deploymentId(processDefinition.getDeploymentId());
   
    Assert.assertEquals(expectedDeploymentName, deploymentQuery.singleResult().getName());
   
  }
View Full Code Here

        .createProcessDefinitionQuery()
        .latestVersion()
        .processDefinitionKey(processKey)
        .singleResult();   
   
    DeploymentQuery deploymentQuery = repositoryService
        .createDeploymentQuery()
        .deploymentId(processDefinition.getDeploymentId());
   
    Assert.assertEquals(expectedDeploymentName, deploymentQuery.singleResult().getName());
   
  }
View Full Code Here

    repositoryService.deleteDeployment(deploymentOneId, true);
    repositoryService.deleteDeployment(deploymentTwoId, true);
  }

  public void testQueryNoCriteria() {
    DeploymentQuery query = repositoryService.createDeploymentQuery();
    assertEquals(2, query.list().size());
    assertEquals(2, query.count());

    try {
      query.singleResult();
      fail();
    } catch (ProcessEngineException e) {}
  }
View Full Code Here

      fail();
    } catch (ProcessEngineException e) {}
  }

  public void testQueryByDeploymentId() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentId(deploymentOneId);
    assertNotNull(query.singleResult());
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
  }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.repository.DeploymentQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.