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);
}
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"));
}
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);
}
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);
}
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);
}
Aggregations