Search in sources :

Example 46 with Locale

use of java.util.Locale in project head by mifos.

the class HolidayServiceTest method setUp.

@Before
public void setUp() {
    holidayService = new HolidayServiceImpl(null, holidayDao, null, fiscalCalendarRules);
    locale = new Locale("en", "GB");
    dateFormat = computeDateFormat(locale);
    officeId = Short.valueOf("1");
}
Also used : Locale(java.util.Locale) Before(org.junit.Before)

Example 47 with Locale

use of java.util.Locale in project head by mifos.

the class CenterStatusChangeIntegrationTest method cleanDatabaseTables.

@Before
public void cleanDatabaseTables() throws Exception {
    databaseCleaner.clean();
    Locale locale = Localization.getInstance().getConfiguredLocale();
    AuditConfiguration.init(locale);
    existingUser = IntegrationTestObjectMother.testUser();
    existingLoanOfficer = IntegrationTestObjectMother.testUser();
    existingOffice = IntegrationTestObjectMother.sampleBranchOffice();
    existingMeeting = new MeetingBuilder().customerMeeting().weekly().every(1).startingToday().build();
    IntegrationTestObjectMother.saveMeeting(existingMeeting);
}
Also used : Locale(java.util.Locale) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) Before(org.junit.Before)

Example 48 with Locale

use of java.util.Locale in project head by mifos.

the class ClientCustActionStrutsTest method setUp.

@Before
public void setUp() throws Exception {
    userContext = TestObjectFactory.getContext();
    userContext.setPreferredLocale(new Locale("en", "GB"));
    request.getSession().setAttribute(Constants.USERCONTEXT, userContext);
    addRequestParameter("recordLoanOfficerId", "1");
    addRequestParameter("recordOfficeId", "1");
    request.getSession(false).setAttribute("ActivityContext", TestObjectFactory.getActivityContext());
    flowKey = createFlow(request, ClientCustAction.class);
    request.getSession().setAttribute(Constants.USERCONTEXT, userContext);
    EntityMasterData.getInstance().init();
    ClientRules.init();
    FieldConfig fieldConfig = FieldConfig.getInstance();
    fieldConfig.init();
    getActionServlet().getServletContext().setAttribute(Constants.FIELD_CONFIGURATION, fieldConfig.getEntityMandatoryFieldMap());
}
Also used : Locale(java.util.Locale) FieldConfig(org.mifos.framework.components.fieldConfiguration.util.helpers.FieldConfig) Before(org.junit.Before)

Example 49 with Locale

use of java.util.Locale in project head by mifos.

the class CustomerHelpersIntegrationTest method testCustomerRecentActivityView.

@Test
public void testCustomerRecentActivityView() throws Exception {
    java.sql.Date sampleDate = new java.sql.Date(System.currentTimeMillis());
    CustomerRecentActivityDto customerRecentActivityDto = new CustomerRecentActivityDto(sampleDate, "description", "1000", "mifos");
    customerRecentActivityDto.setLocale(new Locale("1"));
    Assert.assertEquals("date", sampleDate, customerRecentActivityDto.getActivityDate());
    Assert.assertEquals("description", customerRecentActivityDto.getDescription());
    Assert.assertEquals("1000", customerRecentActivityDto.getAmount());
    Assert.assertEquals("mifos", customerRecentActivityDto.getPostedBy());
    Assert.assertEquals("1", customerRecentActivityDto.getLocale().toString());
}
Also used : Locale(java.util.Locale) CustomerRecentActivityDto(org.mifos.dto.screen.CustomerRecentActivityDto) Test(org.junit.Test)

Example 50 with Locale

use of java.util.Locale in project head by mifos.

the class MifosDoubleConverterTest method xtestConvert_is_IS.

/**
     * Currently broken -- incomplete support for multiple locales for numeric input.
     */
@Ignore
public void xtestConvert_is_IS() {
    LocalizationConverter converter = new LocalizationConverter();
    converter.setCurrentLocale(new Locale("IS", "is"));
    Assert.assertEquals(new Double(2.0), mifosDoubleConverter.convert(String.class, "2,0"));
}
Also used : Locale(java.util.Locale) LocalizationConverter(org.mifos.framework.util.LocalizationConverter) Ignore(org.junit.Ignore)

Aggregations

Locale (java.util.Locale)5854 Test (org.junit.Test)902 HashMap (java.util.HashMap)548 GenericValue (org.apache.ofbiz.entity.GenericValue)504 ArrayList (java.util.ArrayList)486 Delegator (org.apache.ofbiz.entity.Delegator)484 GenericEntityException (org.apache.ofbiz.entity.GenericEntityException)398 IOException (java.io.IOException)313 LocalDispatcher (org.apache.ofbiz.service.LocalDispatcher)296 Date (java.util.Date)273 GenericServiceException (org.apache.ofbiz.service.GenericServiceException)271 Map (java.util.Map)244 BigDecimal (java.math.BigDecimal)214 SimpleDateFormat (java.text.SimpleDateFormat)198 ResourceBundle (java.util.ResourceBundle)197 File (java.io.File)166 LinkedList (java.util.LinkedList)158 ULocale (android.icu.util.ULocale)156 List (java.util.List)147 Test (org.junit.jupiter.api.Test)132