Package org.activiti.engine.identity

Examples of org.activiti.engine.identity.Group


      setHeight(270, UNITS_PIXELS);
    }
  }
 
  protected Group createGroup() {
    Group group = identityService.newGroup(form.getField("id").getValue().toString());
    group.setName(form.getField("name").getValue().toString());
    group.setType(form.getField("type").getValue().toString());
    identityService.saveGroup(group);
    return group;
  }
View Full Code Here


      assertTextPresent("userId and groupId cannot both be null", ae.getMessage());
    }
  }
 
  public void testAddCandidateGroupUnexistingTask() {
    Group group = identityService.newGroup("group");
    identityService.saveGroup(group);
    try {
      taskService.addCandidateGroup("unexistingTaskId", group.getId());
      fail("ActivitiException expected");
    } catch (ActivitiException ae) {
      assertTextPresent("Cannot find task with id unexistingTaskId", ae.getMessage());
    }
    identityService.deleteGroup(group.getId());
  }
View Full Code Here

    identityService.deleteUser(user.getId());
  }

  public void testUpdateGroup() {
    Group group = identityService.newGroup("sales");
    group.setName("Sales");
    identityService.saveGroup(group);

    group = identityService.createGroupQuery().groupId("sales").singleResult();
    group.setName("Updated");
    identityService.saveGroup(group);

    group = identityService.createGroupQuery().groupId("sales").singleResult();
    assertEquals("Updated", group.getName());

    identityService.deleteGroup(group.getId());
  }
View Full Code Here

    User user = identityService.createUserQuery().userId("unexistinguser").singleResult();
    assertNull(user);
  }

  public void findGroupByUnexistingId() {
    Group group = identityService.createGroupQuery().groupId("unexistinggroup").singleResult();
    assertNull(group);
  }
View Full Code Here

   
    identityService.deleteUser(johndoe.getId());
  }
 
  public void testCreateMembershipUnexistingUser() {
    Group sales = identityService.newGroup("sales");
    identityService.saveGroup(sales);
   
    try {
      identityService.createMembership("unexistinguser", sales.getId());
      fail("Expected exception");
    } catch(RuntimeException re) {
      // Exception expected
    }
   
    identityService.deleteGroup(sales.getId());
  }
View Full Code Here

   
    identityService.deleteGroup(sales.getId());
  }
 
  public void testCreateMembershipAlreadyExisting() {
    Group sales = identityService.newGroup("sales");
    identityService.saveGroup(sales);
    User johndoe = identityService.newUser("johndoe");
    identityService.saveUser(johndoe);
   
    // Create the membership
    identityService.createMembership(johndoe.getId(), sales.getId());
   
    try {
      identityService.createMembership(johndoe.getId(), sales.getId());     
    } catch(RuntimeException re) {
     // Expected exception, membership already exists
    }
   
    identityService.deleteGroup(sales.getId());
    identityService.deleteUser(johndoe.getId());
  }
View Full Code Here

      assertTextPresent("groupId is null", ae.getMessage());
    }
  }

  public void testDeleteMembership() {
    Group sales = identityService.newGroup("sales");
    identityService.saveGroup(sales);

    User johndoe = identityService.newUser("johndoe");
    identityService.saveUser(johndoe);
    // Add membership
    identityService.createMembership(johndoe.getId(), sales.getId());

    List<Group> groups = identityService.createGroupQuery().groupMember(johndoe.getId()).list();
    assertTrue(groups.size() == 1);
    assertEquals("sales", groups.get(0).getId());

    // Delete the membership and check members of sales group
    identityService.deleteMembership(johndoe.getId(), sales.getId());
    groups = identityService.createGroupQuery().groupMember(johndoe.getId()).list();
    assertTrue(groups.size() == 0);

    identityService.deleteGroup("sales");
    identityService.deleteUser("johndoe");
View Full Code Here

    identityService.deleteGroup("sales");
    identityService.deleteUser("johndoe");
  }
 
  public void testDeleteMembershipWhenUserIsNoMember() {
    Group sales = identityService.newGroup("sales");
    identityService.saveGroup(sales);

    User johndoe = identityService.newUser("johndoe");
    identityService.saveUser(johndoe);
   
    // Delete the membership when the user is no member
    identityService.deleteMembership(johndoe.getId(), sales.getId());
   
    identityService.deleteGroup("sales");
    identityService.deleteUser("johndoe");
  }
View Full Code Here

    identityService.deleteMembership(johndoe.getId(), "unexistinggroup");
    identityService.deleteUser(johndoe.getId());
  }
 
  public void testDeleteMembershipUnexistingUser() {
    Group sales = identityService.newGroup("sales");
    identityService.saveGroup(sales);
    // No exception should be thrown when user doesn't exist
    identityService.deleteMembership("unexistinguser", sales.getId());
    identityService.deleteGroup(sales.getId());
  }
View Full Code Here

   
    identityService.deleteUser(user.getId());
  }
 
  public void testGroupOptimisticLockingException() {
    Group group = identityService.newGroup("group");
    identityService.saveGroup(group);
   
    Group group1 = identityService.createGroupQuery().singleResult();
    Group group2 = identityService.createGroupQuery().singleResult();
   
    group1.setName("name one");
    identityService.saveGroup(group1);

    try {
     
      group2.setName("name two");
      identityService.saveGroup(group2);
     
      fail("Expected an exception");
    } catch (ActivitiOptimisticLockingException e) {
      // Expected an exception
View Full Code Here

TOP

Related Classes of org.activiti.engine.identity.Group

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.