Package org.activiti.engine.repository

Examples of org.activiti.engine.repository.ModelQuery


    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
  }
 
  public void testQueryByVersion() {
    ModelQuery query = repositoryService.createModelQuery().modelVersion(1);
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
  }
View Full Code Here


    assertEquals(1, repositoryService.createModelQuery().notDeployed().count());
    assertEquals(1, repositoryService.createModelQuery().count());
  }
 
  public void testByInvalidDeploymentId() {
    ModelQuery query = repositoryService.createModelQuery().deploymentId("invalid");
    assertNull(query.singleResult());
    assertEquals(0, query.count());
  }
View Full Code Here

    assertNull(query.singleResult());
    assertEquals(0, query.count());
  }
 
  public void testNotDeployed() {
    ModelQuery query = repositoryService.createModelQuery().notDeployed();
    assertEquals(1, query.count());
    assertEquals(1, query.list().size());
  }
View Full Code Here

    assertEquals(1, query.count());
    assertEquals(1, query.list().size());
  }
 
  public void testOrderBy() {
    ModelQuery query = repositoryService.createModelQuery();
    assertEquals(1, query.orderByCreateTime().asc().count());
    assertEquals(1, query.orderByLastUpdateTime().asc().count());
    assertEquals(1, query.orderByModelCategory().asc().count());
    assertEquals(1, query.orderByModelId().desc().count());
    assertEquals(1, query.orderByModelName().desc().count());
    assertEquals(1, query.orderByModelVersion().desc().count());
    assertEquals(1, query.orderByModelKey().desc().count());
  }
View Full Code Here

    assertEquals(1, query.orderByModelVersion().desc().count());
    assertEquals(1, query.orderByModelKey().desc().count());
  }
 
  public void testByLatestVersion() {
    ModelQuery query = repositoryService.createModelQuery().latestVersion().modelKey("someKey");
    Model model = query.singleResult();
    assertNotNull(model);
   
    // Add a new version of the model
    Model newVersion = repositoryService.newModel();
    newVersion.setName("my model");
    newVersion.setKey("someKey");
    newVersion.setCategory("test");
    newVersion.setVersion(model.getVersion() + 1);
    repositoryService.saveModel(newVersion);
   
    // Verify query
    model = query.singleResult();
    assertNotNull(model);
    assertTrue(model.getVersion() == 2);
   
    // Cleanup
    repositoryService.deleteModel(model.getId());
View Full Code Here

    super.tearDown();
    repositoryService.deleteModel(modelOneId);
  }
 
  public void testModelProperties() {
    ModelQuery query = repositoryService.createModelQuery();
    Model model = query.singleResult();
    assertNotNull(model.getId());
    assertNotNull(model.getCategory());
    assertNotNull(model.getKey());
    assertNotNull(model.getName());
    assertNotNull(model.getVersion());
View Full Code Here

    assertNotNull(model.getCreateTime());
    assertNotNull(model.getLastUpdateTime());
  }
 
  public void testQueryNoCriteria() {
    ModelQuery query = repositoryService.createModelQuery();
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
  }
View Full Code Here

    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
  }
 
  public void testQueryByName() throws Exception {
    ModelQuery query = repositoryService.createModelQuery().modelName("my model");
    Model model = query.singleResult();
    assertNotNull(model);
    assertEquals("bytes", new String(repositoryService.getModelEditorSource(model.getId()), "utf-8"));
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
  }
View Full Code Here

    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
  }
 
  public void testQueryByInvalidName() {
    ModelQuery query = repositoryService.createModelQuery().modelName("invalid");
    assertNull(query.singleResult());
    assertEquals(0, query.list().size());
    assertEquals(0, query.count());
  }
View Full Code Here

TOP

Related Classes of org.activiti.engine.repository.ModelQuery

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.