Search in sources :

Example 6 with DbGroup

use of org.ovirt.engine.core.common.businessentities.aaa.DbGroup in project ovirt-engine by oVirt.

the class DbGroupDaoTest method testSave.

/**
 * Ensures that saving a ad_group works as expected.
 */
@Test
public void testSave() {
    dao.save(newGroup);
    DbGroup result = dao.getByName(newGroup.getName());
    assertEquals(newGroup, result);
}
Also used : DbGroup(org.ovirt.engine.core.common.businessentities.aaa.DbGroup) Test(org.junit.Test)

Example 7 with DbGroup

use of org.ovirt.engine.core.common.businessentities.aaa.DbGroup in project ovirt-engine by oVirt.

the class DbGroupDaoTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    dao = dbFacade.getDbGroupDao();
    // create some test data
    newGroup = new DbGroup();
    newGroup.setId(Guid.newGuid());
    newGroup.setExternalId("0");
    newGroup.setDomain("domain");
    newGroup.setName("name");
    newGroup.setNamespace("*");
    existingGroup = dao.get(new Guid("b399944a-81ab-4ec5-8266-e19ba7c3c9d1"));
}
Also used : DbGroup(org.ovirt.engine.core.common.businessentities.aaa.DbGroup) Guid(org.ovirt.engine.core.compat.Guid) Before(org.junit.Before)

Example 8 with DbGroup

use of org.ovirt.engine.core.common.businessentities.aaa.DbGroup in project ovirt-engine by oVirt.

the class DbGroupDaoTest method testUpdate.

/**
 * Ensures that updating a ad_group works as expected.
 */
@Test
public void testUpdate() {
    existingGroup.setName(existingGroup.getName().toUpperCase());
    existingGroup.setDomain(existingGroup.getDomain().toUpperCase());
    dao.update(existingGroup);
    DbGroup result = dao.get(existingGroup.getId());
    assertNotNull(result);
    assertEquals(existingGroup, result);
}
Also used : DbGroup(org.ovirt.engine.core.common.businessentities.aaa.DbGroup) Test(org.junit.Test)

Example 9 with DbGroup

use of org.ovirt.engine.core.common.businessentities.aaa.DbGroup in project ovirt-engine by oVirt.

the class DbGroupDaoTest method testRemove.

/**
 * Ensures that removing a ad_group works as expected.
 */
@Test
public void testRemove() {
    dao.remove(existingGroup.getId());
    DbGroup result = dao.get(existingGroup.getId());
    assertNull(result);
}
Also used : DbGroup(org.ovirt.engine.core.common.businessentities.aaa.DbGroup) Test(org.junit.Test)

Example 10 with DbGroup

use of org.ovirt.engine.core.common.businessentities.aaa.DbGroup in project ovirt-engine by oVirt.

the class DbGroupDaoTest method testGetWithInvalidId.

/**
 * Ensures that if the id is invalid then no group is returned.
 */
@Test
public void testGetWithInvalidId() {
    DbGroup result = dao.get(Guid.newGuid());
    assertNull(result);
}
Also used : DbGroup(org.ovirt.engine.core.common.businessentities.aaa.DbGroup) Test(org.junit.Test)

Aggregations

DbGroup (org.ovirt.engine.core.common.businessentities.aaa.DbGroup)34 Test (org.junit.Test)13 DbUser (org.ovirt.engine.core.common.businessentities.aaa.DbUser)10 Guid (org.ovirt.engine.core.compat.Guid)9 ArrayList (java.util.ArrayList)6 Group (org.ovirt.engine.api.model.Group)6 DirectoryGroup (org.ovirt.engine.core.aaa.DirectoryGroup)6 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)5 PermissionsOperationsParameters (org.ovirt.engine.core.common.action.PermissionsOperationsParameters)5 Permission (org.ovirt.engine.core.common.businessentities.Permission)5 Response (javax.ws.rs.core.Response)3 Domain (org.ovirt.engine.api.model.Domain)3 AbstractBackendCollectionResourceTest (org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResourceTest)3 Role (org.ovirt.engine.core.common.businessentities.Role)3 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)3 AdElementListModel (org.ovirt.engine.ui.uicommonweb.models.users.AdElementListModel)3 Collection (java.util.Collection)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ExtMap (org.ovirt.engine.api.extensions.ExtMap)2