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:com.exxeta.iss.sonar.esql.test.CheckListTest.java
/** * Enforces that each check has test, name and description. *//*from www . j av a 2 s . c o m*/ @Test public void test() { List<Class> checks = CheckList.getChecks(); for (Class cls : checks) { String testName = '/' + cls.getName().replace('.', '/') + "Test.class"; assertThat(getClass().getResource(testName)) .overridingErrorMessage("No test for " + cls.getSimpleName()).isNotNull(); } ResourceBundle resourceBundle = ResourceBundle.getBundle("org.sonar.l10n.esql", Locale.ENGLISH); Set<String> keys = Sets.newHashSet(); ActiveRules activeRules = (new ActiveRulesBuilder()).build(); CheckFactory checkFactory = new CheckFactory(activeRules); Collection<Rule> rules = checkFactory.<Rule>create("repositoryKey") .addAnnotatedChecks(CheckList.getChecks()).all(); for (Rule rule : rules) { assertThat(keys).as("Duplicate key " + rule.getKey()).excludes(rule.getKey()); keys.add(rule.getKey()); resourceBundle.getString("rule." + CheckList.REPOSITORY_KEY + "." + rule.getKey() + ".name"); assertThat(getClass().getResource("/org/sonar/l10n/esql/rules/esql/" + rule.getKey() + ".html")) .overridingErrorMessage("No description for " + rule.getKey()).isNotNull(); assertThat(rule.getDescription()) .overridingErrorMessage("Description of " + rule.getKey() + " should be in separate file") .isNull(); for (RuleParam param : rule.getParams()) { resourceBundle.getString( "rule." + CheckList.REPOSITORY_KEY + "." + rule.getKey() + ".param." + param.getKey()); assertThat(param.getDescription()).overridingErrorMessage("Description for param " + param.getKey() + " of " + rule.getKey() + " should be in separate file").isEmpty(); } } }
From source file:com.otz.plugin.transport.funnel.controller.StreamsController.java
@CrossOrigin @RequestMapping(path = "/component/{id}/streams/{name}/stages/{stageId}/status/{status}", method = RequestMethod.PUT) @ResponseBody//w w w. j av a2 s . c o m public ResponseEntity<Stage> getStreams(@PathVariable(value = "id") String id, @PathVariable(value = "name") String name, @PathVariable(value = "stageId") String stageId, @PathVariable(value = "status") StageStatus status) { Stage updatedStage = funnelService.updateStageAsync(id, name, stageId, status) .flatMap(stage -> funnelService .triggerAsync(id, name, stageId, status, new HashMap<>(), Locale.ENGLISH) .flatMap(stage1 -> Observable.just(stage))) .toBlocking().first(); ; return new ResponseEntity(updatedStage, HttpStatus.OK); }
From source file:net.sf.dynamicreports.test.jasper.chart.LayeredBarChartTest.java
@Override protected void configureReport(JasperReportBuilder rb) { TextColumnBuilder<String> column1; TextColumnBuilder<Integer> column2; Locale.setDefault(Locale.ENGLISH); rb.columns(column1 = col.column("Column1", "field1", String.class), column2 = col.column("Column2", "field2", Integer.class)) .summary(//from w ww . java 2 s . c om cht.layeredBarChart().customizers(new ChartCustomizer()).setCategory(column1) .series(cht.serie(column2)).setShowLabels(true).setShowTickLabels(false) .setShowTickMarks(false), cht.layeredBarChart().setCategory(column1).series(cht.serie(column2)) .setCategoryAxisFormat(cht.axisFormat().setLabel("category") .setLabelColor(Color.BLUE).setLabelFont(stl.fontArialBold()) .setTickLabelFont(stl.fontArial().setItalic(true)) .setTickLabelColor(Color.CYAN).setTickLabelRotation(45d) .setLineColor(Color.LIGHT_GRAY)), cht.layeredBarChart().setCategory(column1).series(cht.serie(column2)) .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))); }
From source file:net.sourceforge.subsonic.i18n.SubsonicLocaleResolver.java
private Locale doResolveLocale(HttpServletRequest request) { Locale locale = null;/*from www .j ava2 s . c om*/ // Look for user-specific locale. String username = securityService.getCurrentUsername(request); if (username != null) { UserSettings userSettings = settingsService.getUserSettings(username); if (userSettings != null) { locale = userSettings.getLocale(); } } if (locale != null && localeExists(locale)) { return locale; } // Return system locale. locale = settingsService.getLocale(); return localeExists(locale) ? locale : Locale.ENGLISH; }
From source file:sample.config.MockDataConfig.java
@Bean public Message createMessage() { Calendar created = Calendar.getInstance(Locale.ENGLISH); // we need to clear out the milliseconds since we are not interested in being that precise created.set(Calendar.MILLISECOND, 0); created.getTime().setTime(1397672456000L); Message message = new Message(); message.setCreated(created);//ww w.j a v a 2 s .c om message.setId(123L); message.setSummary("Spring Rocks"); message.setText("In case you didn't know, Spring Rocks!"); return message; }
From source file:de.perdian.commons.lang.conversion.impl.converters.TestStringToNumberConverter.java
@Test public void testConvertWithPatternAndLocaleEN() { StringToNumberConverter converter = new StringToNumberConverter("0.0", new SimpleLocaleContext(Locale.ENGLISH)); Assert.assertEquals(2.2d, converter.convert("2.2").doubleValue(), 0); }
From source file:org.browsexml.timesheetjob.web.SimpleWebApplicationContext.java
public void refresh() throws BeansException { MutablePropertyValues pvs = new MutablePropertyValues(); pvs.addPropertyValue(new PropertyValue("commandClass", "org.springframework.beans.TestBean")); pvs.addPropertyValue(new PropertyValue("formView", "form")); //registerSingleton("/form.do", HoursWorkedFormController.class, pvs); //registerSingleton("/locale.do", LocaleChecker.class); //registerPrototype("/throwaway.do", TestThrowawayController.class); addMessage("test", Locale.ENGLISH, "test message"); addMessage("test", Locale.CANADA, "Canadian & test message"); addMessage("testArgs", Locale.ENGLISH, "test {0} message {1}"); addMessage("testArgsFormat", Locale.ENGLISH, "test {0} message {1,number,#.##} X"); registerSingleton(UiApplicationContextUtils.THEME_SOURCE_BEAN_NAME, DummyThemeSource.class); super.refresh(); }
From source file:cn.org.once.cstack.utils.CheckUtils.java
/** * To validate if port is free or occupied. * * @param port/* w w w. j a va2s . co m*/ * @param application * @throws CheckException */ public static void isPortFree(String port, Application application) throws CheckException { Long numberOfThisPort = application.getPortsToOpen().stream() .filter(t -> t.getPort().equals(Integer.parseInt(port))).count(); if (numberOfThisPort != 0) { String messageTranslated = messageSource.getMessage("port.already.used", null, Locale.ENGLISH); throw new CheckException(messageTranslated + " : " + port); } }
From source file:com.tesora.dve.charset.NativeCollationCatalogImpl.java
@Override public NativeCollation findCollationByName(String collationName) { return collationsByName.get(collationName.toUpperCase(Locale.ENGLISH)); }
From source file:kr.co.generic.wifianalyzer.wifi.ChannelAvailableAdapter.java
@NonNull @Override/*from w w w. ja va2s.c om*/ public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { View view = convertView; if (view == null) { LayoutInflater layoutInflater = MainContext.INSTANCE.getMainActivity().getLayoutInflater(); view = layoutInflater.inflate(kr.co.generic.wifianalyzer.R.layout.channel_available_details, parent, false); } WiFiChannelCountry wiFiChannelCountry = getItem(position); ((TextView) view.findViewById(kr.co.generic.wifianalyzer.R.id.channel_available_country)) .setText(wiFiChannelCountry.getCountryCode() + " - " + wiFiChannelCountry.getCountryName()); ((TextView) view.findViewById(kr.co.generic.wifianalyzer.R.id.channel_available_title_ghz_2)) .setText(String.format(Locale.ENGLISH, "%s : ", WiFiBand.GHZ2.getBand())); ((TextView) view.findViewById(kr.co.generic.wifianalyzer.R.id.channel_available_ghz_2)) .setText(StringUtils.join(wiFiChannelCountry.getChannelsGHZ2().toArray(), ",")); ((TextView) view.findViewById(kr.co.generic.wifianalyzer.R.id.channel_available_title_ghz_5)) .setText(String.format(Locale.ENGLISH, "%s : ", WiFiBand.GHZ5.getBand())); ((TextView) view.findViewById(kr.co.generic.wifianalyzer.R.id.channel_available_ghz_5)) .setText(StringUtils.join(wiFiChannelCountry.getChannelsGHZ5().toArray(), ",")); return view; }