Search in sources :

Example 11 with LookUpEntity

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;
}
Also used : ActivityEntity(org.mifos.security.rolesandpermission.business.ActivityEntity) LookUpEntity(org.mifos.application.master.business.LookUpEntity) LookUpValueEntity(org.mifos.application.master.business.LookUpValueEntity)

Example 12 with LookUpEntity

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();
}
Also used : LookUpEntity(org.mifos.application.master.business.LookUpEntity) LookUpValueEntity(org.mifos.application.master.business.LookUpValueEntity) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 13 with LookUpEntity

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()));
}
Also used : LookUpEntity(org.mifos.application.master.business.LookUpEntity) Test(org.junit.Test)

Example 14 with LookUpEntity

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());
        //                }
        }
    }
}
Also used : LookUpEntity(org.mifos.application.master.business.LookUpEntity) LookUpLabelEntity(org.mifos.application.master.business.LookUpLabelEntity) Test(org.junit.Test)

Aggregations

LookUpEntity (org.mifos.application.master.business.LookUpEntity)14 LookUpValueEntity (org.mifos.application.master.business.LookUpValueEntity)8 Test (org.junit.Test)5 MessageLookup (org.mifos.application.master.MessageLookup)3 LookUpLabelEntity (org.mifos.application.master.business.LookUpLabelEntity)3 ActivityEntity (org.mifos.security.rolesandpermission.business.ActivityEntity)3 Session (org.hibernate.Session)2 LookUpValueLocaleEntity (org.mifos.application.master.business.LookUpValueLocaleEntity)2 HashMap (java.util.HashMap)1 Ignore (org.junit.Ignore)1 GracePeriodTypeEntity (org.mifos.accounts.productdefinition.business.GracePeriodTypeEntity)1 MifosRuntimeException (org.mifos.core.MifosRuntimeException)1 OfficeLevelEntity (org.mifos.customers.office.business.OfficeLevelEntity)1 RoleBO (org.mifos.security.rolesandpermission.business.RoleBO)1 BusinessRuleException (org.mifos.service.BusinessRuleException)1