Package org.activiti.engine.repository

Examples of org.activiti.engine.repository.ModelQuery


    assertEquals(0, query.list().size());
    assertEquals(0, query.count());
  }
 
  public void testQueryByCategory() {
    ModelQuery query = repositoryService.createModelQuery().modelCategory("test");
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
  }
View Full Code Here


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

    assertEquals(0, query.list().size());
    assertEquals(0, query.count());
  }
 
  public void testQueryByCategoryLike() {
    ModelQuery query = repositoryService.createModelQuery().modelCategoryLike("%te%");
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
  }
View Full Code Here

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

    assertEquals(0, query.list().size());
    assertEquals(0, query.count());
  }
 
  public void testQueryByCategoryNotEquals() {
    ModelQuery query = repositoryService.createModelQuery().modelCategoryNotEquals("aap");
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
  }
View Full Code Here

    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

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.