use of org.mifos.application.master.business.LookUpEntity in project head by mifos.
the class ReportsCategoryActionStrutsTest method insertActivityForTest.
public ActivityEntity insertActivityForTest(short activityId) throws PersistenceException {
LookUpValueEntity anLookUp = new LookUpValueEntity();
LookUpEntity lookUpEntity = legacyMasterDao.getPersistentObject(LookUpEntity.class, Short.valueOf((short) LookUpEntity.ACTIVITY));
anLookUp.setLookUpEntity(lookUpEntity);
ActivityEntity parent = legacyMasterDao.getPersistentObject(ActivityEntity.class, (short) 13);
ActivityEntity activityEntity = new ActivityEntity(activityId, parent, anLookUp);
legacyRolesPermissionsDao.createOrUpdate(anLookUp);
legacyRolesPermissionsDao.createOrUpdate(activityEntity);
return activityEntity;
}
use of org.mifos.application.master.business.LookUpEntity in project head by mifos.
the class AddActivityIntegrationTest method testStartFromSystemWithAddedLookupValues.
@Ignore
@Test
public void testStartFromSystemWithAddedLookupValues() throws Exception {
for (int i = 0; i < 10; ++i) {
LookUpValueEntity entity = new LookUpValueEntity();
entity.setLookUpName("test look up value " + i);
LookUpEntity lookUpEntity = new LookUpEntity();
lookUpEntity.setEntityId((short) 87);
entity.setLookUpEntity(lookUpEntity);
session.save(entity);
}
upgradeAndCheck();
}
use of org.mifos.application.master.business.LookUpEntity in project head by mifos.
the class ApplicationConfigurationDaoHibernateIntegrationTest method shouldDoX.
@Test
public void shouldDoX() {
LookUpEntity entity = applicationConfigurationDao.findLookupValueByEntityType(ConfigurationConstants.CLIENT);
assertThat(entity, is(notNullValue()));
}
use of org.mifos.application.master.business.LookUpEntity in project head by mifos.
the class ApplicationConfigurationPersistenceIntegrationTest method testGetLookupEntities.
/*
* Check that we can can retrieve LookupEntities and enforce the conventions: LookupEntity names cannot contain
* whitespace LookupEntities should not have more than 1 label
*/
@Test
public void testGetLookupEntities() {
List<LookUpEntity> entities = applicationConfigurationDao.findLookupEntities();
Assert.assertNotNull(entities);
// Enforce that no entity names contain whitespace
for (LookUpEntity entity : entities) {
Assert.assertEquals(StringUtils.deleteWhitespace(entity.getEntityType()), entity.getEntityType());
Set<LookUpLabelEntity> labels = entity.getLookUpLabels();
// Enforce that each entity has 0 or 1 labels and not more
Assert.assertTrue(labels.size() <= 1);
for (LookUpLabelEntity label : labels) {
// if (entity.getEntityType().equals("Client")) {
// Assert.assertEquals("Client", label.getLabelText());
// }
}
}
}
Aggregations