コード例 #1
0
  @Deployment(resources = {"org/activiti/engine/test/api/oneTaskProcess.bpmn20.xml"})
  public void testGetResourceAsStreamUnexistingDeployment() {

    try {
      repositoryService.getResourceAsStream(
          "unexistingdeployment", "org/activiti/engine/test/api/unexistingProcess.bpmn.xml");
      fail("ActivitiException expected");
    } catch (ActivitiObjectNotFoundException ae) {
      assertTextPresent("deployment does not exist", ae.getMessage());
      assertEquals(org.activiti.engine.repository.Deployment.class, ae.getObjectClass());
    }
  }
コード例 #2
0
  @Deployment(resources = {"org/activiti/engine/test/api/oneTaskProcess.bpmn20.xml"})
  public void testGetResourceAsStreamUnexistingResourceInExistingDeployment() {
    // Get hold of the deployment id
    org.activiti.engine.repository.Deployment deployment =
        repositoryService.createDeploymentQuery().singleResult();

    try {
      repositoryService.getResourceAsStream(
          deployment.getId(), "org/activiti/engine/test/api/unexistingProcess.bpmn.xml");
      fail("ActivitiException expected");
    } catch (ActivitiObjectNotFoundException ae) {
      assertTextPresent("no resource found with name", ae.getMessage());
      assertEquals(InputStream.class, ae.getObjectClass());
    }
  }