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:ch.ralscha.extdirectspring.provider.RemoteProviderStoreModifySingle.java
@ExtDirectMethod(value = ExtDirectMethodType.STORE_MODIFY) public Row create2(Row row, HttpServletResponse response, HttpServletRequest request, HttpSession session, Locale locale) {/*from w w w . ja v a2s .c om*/ assertThat(response).isNotNull(); assertThat(request).isNotNull(); assertThat(session).isNotNull(); assertThat(locale).isEqualTo(Locale.ENGLISH); return row; }
From source file:org.openmrs.web.controller.concept.ConceptStopWordFormControllerTest.java
/** * @see {@link ConceptStopWordFormController#handleSubmission(HttpSession, ConceptStopWordFormBackingObject, org.springframework.validation.BindingResult) *//* w w w.ja v a2s .co m*/ @Test @Verifies(value = "should add new ConceptStopWord", method = "handleSubmission(HttpSession, ConceptStopWordFormBackingObject, BindingResult)") public void handleSubmission_shouldAddNewConceptStopWord() throws Exception { ConceptStopWordFormController controller = (ConceptStopWordFormController) applicationContext .getBean("conceptStopWordFormController"); HttpSession mockSession = new MockHttpSession(); mockSession.setAttribute("value", "As"); BindException errors = new BindException(new ConceptStopWord("As", Locale.ENGLISH), "value"); controller.handleSubmission(mockSession, new ConceptStopWord("As", Locale.ENGLISH), errors); Assert.assertEquals("ConceptStopWord.saved", mockSession.getAttribute(WebConstants.OPENMRS_MSG_ATTR)); Assert.assertNull(mockSession.getAttribute(WebConstants.OPENMRS_ERROR_ATTR)); }
From source file:cn.org.once.cstack.utils.CheckUtils.java
/** * Valid a field input with a max size./*from w w w. j a v a 2s . co m*/ * * @param field * @param message * @param size * @throws CheckException */ public static void validateInputSizeMax(String field, String message, int size) throws CheckException { if (field == null || field.trim().length() == 0 /* || "undefined".equals(field) */ || field.length() > size) { String messageTranslated = messageSource.getMessage(message, null, Locale.ENGLISH); throw new CheckException(messageTranslated + " : " + field); } }
From source file:com.chalmers.feedlr.model.TwitterItem.java
/** * Sets the timestamp of a Ttwitter Item. * //from w w w. j av a 2 s . c o m * @param timestamp * the time the Twitter item was created */ @JsonProperty("created_at") public void setTimestamp(String timestamp) { // Converts from the format to dateformat. SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZZZ yyyy", Locale.ENGLISH); dateFormat.setLenient(false); Date created = null; try { created = dateFormat.parse(timestamp); } catch (Exception e) { Log.e(getClass().getName(), e.getMessage()); } SimpleDateFormat d = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); this.timestamp = d.format(created); }
From source file:com.yanzhenjie.andserver.util.HttpRequestParser.java
/** * Split http params.//w ww.jav a 2 s .co m * * @param content target content. * @param lowerCaseNames Whether to put all keys are converted to lowercase. * @return parameter key-value pairs. */ public static Map<String, String> splitHttpParams(String content, boolean lowerCaseNames) { Map<String, String> paramMap = new HashMap<String, String>(); StringTokenizer tokenizer = new StringTokenizer(content, "&"); while (tokenizer.hasMoreElements()) { String keyValue = tokenizer.nextToken(); int index = keyValue.indexOf("="); if (index > 0) { String key = keyValue.substring(0, index); if (lowerCaseNames) key = key.toLowerCase(Locale.ENGLISH); paramMap.put(key, keyValue.substring(index + 1)); } } return paramMap; }
From source file:net.sf.dynamicreports.test.jasper.chart.ThermometerChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { Locale.setDefault(Locale.ENGLISH); rb.setLocale(Locale.ENGLISH).summary(cht.thermometerChart().setValue(field("field1", Integer.class)) .setDataRangeLowExpression(3).setDataRangeHighExpression(30).setValueColor(Color.BLUE) .setValueMask("#,###.0").setValueFont(stl.fontArial()).setValueLocation(ValueLocation.BULB) .setMercuryColor(Color.LIGHT_GRAY).setLowDataRangeLowExpression(8).setLowDataRangeHighExpression(10) .setMediumDataRangeLowExpression(18).setMediumDataRangeHighExpression(20) .setHighDataRangeLowExpression(28).setHighDataRangeHighExpression(30), cht.thermometerChart().setValue(field("field1", Integer.class))); }
From source file:net.sf.dynamicreports.test.jasper.chart.MeterChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { Locale.setDefault(Locale.ENGLISH); rb.setLocale(Locale.ENGLISH).summary(cht.meterChart().setValue(field("field1", Integer.class)) .setDataRangeLowExpression(3).setDataRangeHighExpression(30).setValueColor(Color.BLUE) .setValueMask("#,###.0").setValueFont(stl.fontArial()).setShape(MeterShape.CIRCLE) .setMeterAngle(270).setUnits("units").setTickInterval(3d).setMeterBackgroundColor(Color.LIGHT_GRAY) .setNeedleColor(Color.CYAN).setTickColor(Color.MAGENTA).setTickLabelFont(stl.fontCourierNew()) .intervals(/*from www . j a v a2 s . c o m*/ cht.meterInterval().setLabel("red").setAlpha(0.8).setBackgroundColor(Color.RED) .setDataRangeLowExpression(25).setDataRangeHighExpression(30), cht.meterInterval().setLabel("yellow").setAlpha(0.5).setBackgroundColor(Color.YELLOW) .setDataRangeLowExpression(20).setDataRangeHighExpression(25)), cht.meterChart().setValue(5).setShape(MeterShape.DIAL)); }
From source file:ch.ralscha.extdirectspring.provider.RemoteProviderMetadata.java
@ExtDirectMethod(value = ExtDirectMethodType.STORE_READ, group = "metadata") public ExtDirectStoreResult<Row> method1(ExtDirectStoreReadRequest request, Locale locale, @RequestParam(value = "id") int id, @MetadataParam(value = "mp") String mp) { assertThat(id).isEqualTo(10);/*from w w w . jav a 2 s . com*/ assertThat(locale).isEqualTo(Locale.ENGLISH); assertThat(request.getParams().size()).isEqualTo(1); assertThat(request.getParams()).contains(entry("id", 10)); return RemoteProviderStoreRead.createExtDirectStoreResult(request, ":" + id + ";" + mp + ";" + locale); }
From source file:jfractus.app.Main.java
private static void parseSize(String sizeStr, Dimension dim) throws ArgumentParseException, BadValueOfArgumentException { Scanner scanner = new Scanner(sizeStr); scanner.useLocale(Locale.ENGLISH); scanner.useDelimiter("x"); int outWidth = 0, outHeight = 0; try {//from www .j a va2 s . c o m outWidth = scanner.nextInt(); outHeight = scanner.nextInt(); if (outWidth < 0 || outHeight < 0) throw new BadValueOfArgumentException("Bad value of argument"); } catch (InputMismatchException e) { throw new ArgumentParseException("Command line parse exception"); } catch (NoSuchElementException e) { throw new ArgumentParseException("Command line parse exception"); } if (scanner.hasNext()) throw new ArgumentParseException("Command line parse exception"); dim.setSize(outWidth, outHeight); }