List of usage examples for java.util Locale ENGLISH
Locale ENGLISH
To view the source code for java.util Locale ENGLISH.
Click Source Link
From source file:org.openmrs.module.event.EventActivatorTest.java
/** * @see {@link EventActivator#started()} *///from w ww . j a v a 2 s . c om @Test @NotTransactional @Verifies(value = "should create subscriptions for all subscribable event listeners", method = "started()") public void started_shouldCreateSubscriptionsForAllSubscribableEventListeners() throws Exception { ConceptService cs = Context.getConceptService(); Concept concept = cs.getConcept(3); cs.saveConcept(concept); Concept concept2 = new Concept(); ConceptName name2 = new ConceptName("Name2", Locale.ENGLISH); concept2.addName(name2); cs.saveConcept(concept2); cs.purgeConcept(concept2); // sanity check listener.waitForEvents(); Assert.assertEquals(0, listener.getCreatedCount()); Assert.assertEquals(0, listener.getUpdatedCount()); Assert.assertEquals(0, listener.getDeletedCount()); listener.setExpectedEventsCount(2); new EventActivator().started(); concept.setVersion("new version"); cs.saveConcept(concept); cs.saveConcept(concept); Concept concept3 = new Concept(); ConceptName name3 = new ConceptName("Name3", Locale.ENGLISH); concept3.addName(name3); cs.saveConcept(concept3); cs.purgeConcept(concept3); listener.waitForEvents(); Assert.assertEquals(1, listener.getCreatedCount()); Assert.assertEquals(2, listener.getUpdatedCount()); Assert.assertEquals(0, listener.getDeletedCount()); }
From source file:org.apache.droids.protocol.http.HttpContentEntity.java
public HttpContentEntity(HttpEntity entity, long maxlen) throws IOException { super();/*from ww w. j a v a 2 s .co m*/ if (entity.isRepeatable()) { this.entity = entity; } else { this.entity = new DroidHttpEntity(entity, maxlen); } String mimeType = null; String charset = null; Header header = entity.getContentType(); if (header != null) { HeaderElement[] helems = header.getElements(); if (helems != null && helems.length > 0) { HeaderElement helem = helems[0]; mimeType = helem.getName(); NameValuePair nvp = helem.getParameterByName("charset"); if (nvp != null) { charset = nvp.getValue(); } } } if (mimeType != null) { this.mimeType = mimeType.toLowerCase(Locale.ENGLISH); } else { this.mimeType = "binary/octet-stream"; } if (charset != null) { this.charset = charset; } else { if (this.mimeType.startsWith("text/")) { this.charset = HTTP.ISO_8859_1; } else { this.charset = null; } } }
From source file:net.sf.dynamicreports.test.jasper.chart.ValueChartDataTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<String> column1; TextColumnBuilder<Integer> column2; TextColumnBuilder<Integer> column3; Locale.setDefault(Locale.ENGLISH); rb.setPageFormat(PageType.A2, PageOrientation.PORTRAIT) .setTemplate(template().setChartValuePattern("#,##0.#").setChartPercentValuePattern("#,##0.###")) .columns(column1 = col.column("Column1", "field1", String.class), column2 = col.column("Column2", "field2", Integer.class), column3 = col.column("Column3", "field3", Integer.class)) .summary(//www . j av a 2s . co m cmp.horizontalList(cht.barChart().setShowValues(true).setShowPercentages(true) .setPercentValuePattern("#,##0.##").setCategory(column1) .series(cht.serie(column2), cht.serie(column3)), cht.bar3DChart().setShowValues(true).setShowPercentages(true).setCategory(column1) .series(cht.serie(column2), cht.serie(column3)), cht.barChart().setShowValues(true).setValuePattern("#,##0.##").setCategory(column1) .series(cht.serie(column2), cht.serie(column3)), cht.bar3DChart().setShowValues(true).setCategory(column1).series(cht.serie(column2), cht.serie(column3))), cmp.horizontalList( cht.pieChart().setShowValues(true).setValuePattern("#,##0.##") .setShowPercentages(true).setPercentValuePattern("#,##0.##").setKey(column1) .series(cht.serie(column2)), cht.pieChart().setShowValues(true).setShowPercentages(true).setKey(column1) .series(cht.serie(column2)))); }
From source file:it.uniud.ailab.dcore.annotation.annotators.StopwordSimpleFilterAnnotator.java
/** * A stopword filter annotator, that removes Grams from the blackboard * that start with forbidden words.//from w w w .j a va2 s. co m */ public StopwordSimpleFilterAnnotator() { stopwordsPath = new HashMap<>(); stopwords = new HashSet<>(); stopwordsPath.put(Locale.ENGLISH, getClass().getClassLoader().getResource("ailab/stopwords/generic.txt").getFile()); stopwordsPath.put(Locale.ITALIAN, getClass().getClassLoader().getResource("ailab/stopwords/generic.txt").getFile()); }
From source file:com.igormaznitsa.jhexed.swing.editor.ui.Utils.java
public static String color2html(final Color c, final boolean alpha) { final String ac = Integer.toHexString(c.getAlpha()).toUpperCase(Locale.ENGLISH); final String rc = Integer.toHexString(c.getRed()).toUpperCase(Locale.ENGLISH); final String gc = Integer.toHexString(c.getGreen()).toUpperCase(Locale.ENGLISH); final String bc = Integer.toHexString(c.getBlue()).toUpperCase(Locale.ENGLISH); final StringBuilder result = new StringBuilder(7); result.append('#'); if (alpha) {//from w w w.j av a2 s . co m if (ac.length() == 1) { result.append('0'); } result.append(ac); } if (rc.length() == 1) { result.append('0'); } result.append(rc); if (gc.length() == 1) { result.append('0'); } result.append(gc); if (bc.length() == 1) { result.append('0'); } result.append(bc); return result.toString(); }
From source file:de.brendamour.jpasskit.signing.PKPassTemplateInMemoryTest.java
@Test public void addFile_asStream_withLocale() throws IOException { ByteArrayInputStream stream = new ByteArrayInputStream("Hello".getBytes()); pkPassTemplateInMemory.addFile(PKPassTemplateInMemory.PK_BACKGROUND, Locale.ENGLISH, stream); Map<String, InputStream> files = pkPassTemplateInMemory.getFiles(); Assert.assertEquals(files.size(), 1); Assert.assertEquals(files.get("en.lproj/" + PKPassTemplateInMemory.PK_BACKGROUND), stream); }
From source file:com.puppycrawl.tools.checkstyle.api.LocalizedMessageTest.java
@Test public void testMessageInEnglish() { LocalizedMessage localizedMessage = createSampleLocalizedMessage(); LocalizedMessage.setLocale(Locale.ENGLISH); assertEquals("Empty statement.", localizedMessage.getMessage()); }
From source file:fi.helsinki.opintoni.service.StudyAttainmentServiceTest.java
@Test public void thatStudyAttainmentsByStudentNumberAreReturned() throws IOException { defaultStudentRequestChain().attainments(); int limitStudyAttainments = 1; List<StudyAttainmentDto> studyAttainments = studyAttainmentService .getStudyAttainments(TestConstants.STUDENT_NUMBER, limitStudyAttainments, Locale.ENGLISH); assertThat(studyAttainments.size()).isEqualTo(limitStudyAttainments); StudyAttainmentDto studyAttainmentDto = Iterables.getOnlyElement(studyAttainments); assertStudyAttainmentDto(studyAttainmentDto); }
From source file:net.sf.dynamicreports.test.jasper.chart.TimeSeriesChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<Date> column1; TextColumnBuilder<Timestamp> column2; TextColumnBuilder<Integer> column3; Locale.setDefault(Locale.ENGLISH); rb.columns(column1 = col.column("Column1", "field1", Date.class), column2 = col.column("Column2", "field2", Timestamp.class), column3 = col.column("Column3", "field3", Integer.class)) .summary(//from w w w . j av a 2 s . c o m cht.timeSeriesChart().setTimePeriod(column1).series(cht.serie(column3)) .setTimePeriodType(TimePeriod.DAY).setShowShapes(false).setShowLines(false), cht.timeSeriesChart().setTimePeriod(column1).series(cht.serie(column3)) .setTimeAxisFormat(cht.axisFormat().setLabel("time").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setLineColor(Color.LIGHT_GRAY) .setVerticalTickLabels(true)), cht.timeSeriesChart().setTimePeriod(column2).series(cht.serie(column3)) .setValueAxisFormat(cht.axisFormat().setLabel("value").setLabelColor(Color.BLUE) .setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelMask("#,##0.00") .setLineColor(Color.LIGHT_GRAY).setRangeMinValueExpression(1) .setRangeMaxValueExpression(15).setVerticalTickLabels(true))); }
From source file:com.sudoku.data.model.User.java
public static User buildFromAvroUser(com.sudoku.comm.generated.User user) { User resultUser = new User(); DateFormat df = new SimpleDateFormat("dd/MM/yyyy", Locale.ENGLISH); resultUser.pseudo = user.getPseudo(); resultUser.profilePicturePath = user.getProfilePicturePath(); resultUser.ipAddress = user.getIpAddress(); resultUser.salt = user.getSalt();/* w ww .j av a 2s. c o m*/ try { resultUser.birthDate = df.parse(user.getBirthDate()); resultUser.createDate = df.parse(user.getCreateDate()); resultUser.updateDate = df.parse(user.getUpdateDate()); } catch (ParseException ex) { LOGGER.error(ex.toString()); } resultUser.contactCategories = new LinkedList<>(); // NEED TO SERIALIZE THIS BUT NOT TRANSFER IT return resultUser; }