Example usage for java.util Locale ENGLISH

List of usage examples for java.util Locale ENGLISH

Introduction

In this page you can find the example usage for java.util Locale ENGLISH.

Prototype

Locale ENGLISH

To view the source code for java.util Locale ENGLISH.

Click Source Link

Document

Useful constant for language.

Usage

From source file:com.nike.cerberus.validation.IamPrincipalPermissionsValidator.java

private String buildKey(IamPrincipalPermission iamRolePermission) {
    StringBuilder stringBuilder = new StringBuilder();

    stringBuilder.append(StringUtils.lowerCase(iamRolePermission.getIamPrincipalArn(), Locale.ENGLISH));

    return stringBuilder.toString();
}

From source file:trader.LoginUI.java

@Override
protected void init(VaadinRequest request) {

    setLocale(Locale.ENGLISH);

    FormLayout loginForm = new FormLayout();
    loginForm.setSizeUndefined();//from  ww  w  .j  av a 2  s.  c  om

    loginForm.addComponent(userName = new TextField("Username"));
    loginForm.addComponent(passwordField = new PasswordField("Password"));
    loginForm.addComponent(rememberMe = new CheckBox("Remember me"));
    loginForm.addComponent(login = new Button("Login"));
    login.addStyleName(ValoTheme.BUTTON_PRIMARY);
    login.setDisableOnClick(true);
    login.setClickShortcut(ShortcutAction.KeyCode.ENTER);
    login.addClickListener(new Button.ClickListener() {
        /**
        * 
        */
        private static final long serialVersionUID = 7813011112417170727L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            login();
        }
    });

    VerticalLayout loginLayout = new VerticalLayout();
    loginLayout.setSpacing(true);
    loginLayout.setSizeUndefined();

    if (request.getParameter("logout") != null) {
        loggedOutLabel = new Label("You have been logged out!");
        loggedOutLabel.addStyleName(ValoTheme.LABEL_SUCCESS);
        loggedOutLabel.setSizeUndefined();
        loginLayout.addComponent(loggedOutLabel);
        loginLayout.setComponentAlignment(loggedOutLabel, Alignment.BOTTOM_CENTER);
    }

    loginLayout.addComponent(loginFailedLabel = new Label());
    loginLayout.setComponentAlignment(loginFailedLabel, Alignment.BOTTOM_CENTER);
    loginFailedLabel.setSizeUndefined();
    loginFailedLabel.addStyleName(ValoTheme.LABEL_FAILURE);
    loginFailedLabel.setVisible(false);

    loginLayout.addComponent(loginForm);
    loginLayout.setComponentAlignment(loginForm, Alignment.TOP_CENTER);

    VerticalLayout rootLayout = new VerticalLayout(loginLayout);
    rootLayout.setSizeFull();
    rootLayout.setComponentAlignment(loginLayout, Alignment.MIDDLE_CENTER);
    setContent(rootLayout);
    setSizeFull();
}

From source file:hudson.cli.CopyJobCommandTest.java

@Test
public void copyBetweenFolders() throws Exception {
    MockFolder dir1 = j.createFolder("dir1");
    MockFolder dir2 = j.createFolder("dir2");
    FreeStyleProject p = dir1.createProject(FreeStyleProject.class, "p1");
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    PrintStream outS = new PrintStream(out);
    int result = new CopyJobCommand().main(Arrays.asList("dir1/p1", "dir2/p2"), Locale.ENGLISH,
            new NullInputStream(0), outS, outS);
    outS.flush();//from   w w w  .j  a v a2  s  .co  m
    assertEquals(out.toString(), 0, result);
    assertEquals("", out.toString());
    assertNotNull(j.jenkins.getItemByFullName("dir2/p2"));
    // TODO test copying from/to root, or into nonexistent folder
}

From source file:net.sf.dynamicreports.test.jasper.chart.XyStepChartTest.java

@Override
protected void configureReport(JasperReportBuilder rb) {
    TextColumnBuilder<Integer> column1;
    TextColumnBuilder<Integer> column2;

    Locale.setDefault(Locale.ENGLISH);

    rb.columns(column1 = col.column("Column1", "field1", Integer.class),
            column2 = col.column("Column2", "field2", Integer.class))
            .summary(cht.xyStepChart().setXValue(column1).series(cht.xySerie(column2)).setStepPoint(0.5d), cht
                    .xyStepChart().setXValue(column1).series(cht.xySerie(column2))
                    .setXAxisFormat(cht.axisFormat().setLabel("category").setLabelColor(Color.BLUE)
                            .setLabelFont(stl.fontArialBold()).setTickLabelFont(stl.fontArial().setItalic(true))
                            .setTickLabelColor(Color.CYAN).setLineColor(Color.LIGHT_GRAY)),
                    cht.xyStepChart().setXValue(column1).series(cht.xySerie(column2))
                            .setYAxisFormat(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:com.callidusrobotics.object.ItemData.java

public String getId() {
    return StringUtils.trim(StringUtils.lowerCase(identifier, Locale.ENGLISH));
}

From source file:hudson.cli.GetJobCommandTest.java

@Issue("JENKINS-20236")
@Test/*  w  w w .  java2 s . com*/
public void withFolders() throws Exception {
    MockFolder d = j.createFolder("d");
    FreeStyleProject p = d.createProject(FreeStyleProject.class, "p");
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    PrintStream outS = new PrintStream(out);
    int result = new GetJobCommand().main(Collections.singletonList("d/p"), Locale.ENGLISH,
            new NullInputStream(0), outS, outS);
    outS.flush();
    String output = out.toString();
    assertEquals(output, 0, result);
    assertEquals(p.getConfigFile().asString(), output);
    out = new ByteArrayOutputStream();
    outS = new PrintStream(out);
    result = new GetJobCommand().main(Collections.singletonList("d"), Locale.ENGLISH, new NullInputStream(0),
            outS, outS);
    outS.flush();
    output = out.toString();
    assertEquals(output, 0, result);
    assertEquals(d.getConfigFile().asString(), output);
}

From source file:org.openmrs.event.EventTest.java

/**
 * @see {@link Event#subscribe(Class<OpenmrsObject>,String,EventListener)}
 *//* www.  j  a  v  a  2s  .  c o m*/
@Test
@NotTransactional
@Verifies(value = "should subscribe only to the specified action", method = "subscribe(Class<OpenmrsObject>,String,EventListener)")
public void subscribe_shouldSubscribeOnlyToTheSpecifiedAction() throws Exception {
    ConceptService cs = Context.getConceptService();
    MockEventListener listener = new MockEventListener(3); //let's wait for 3 messages
    Event.subscribe(Concept.class, Action.UPDATED.toString(), listener);

    Concept concept = new Concept();
    ConceptName name = new ConceptName("Name", Locale.ENGLISH);
    concept.addName(name);
    cs.saveConcept(concept);

    concept.setVersion("new random version");
    cs.saveConcept(concept);

    cs.purgeConcept(concept);

    listener.waitForEvents();

    Assert.assertEquals(0, listener.getCreatedCount());
    Assert.assertEquals(1, listener.getUpdatedCount());
    Assert.assertEquals(0, listener.getDeletedCount());
}

From source file:ch.ralscha.extdirectspring_itest.UserInitBinderServiceTest.java

@Test
public void testPostWithoutDate() throws IOException {
    Locale.setDefault(Locale.ENGLISH);
    List<NameValuePair> formparams = new ArrayList<NameValuePair>();
    formparams.add(new BasicNameValuePair("extTID", "1"));
    formparams.add(new BasicNameValuePair("extAction", "userServiceInitBinderService"));
    formparams.add(new BasicNameValuePair("extMethod", "updateUser"));
    formparams.add(new BasicNameValuePair("extType", "rpc"));
    formparams.add(new BasicNameValuePair("extUpload", "false"));
    formparams.add(new BasicNameValuePair("name", "Garner"));
    formparams.add(new BasicNameValuePair("firstName", "Joe"));
    formparams.add(new BasicNameValuePair("email", "test@test.com"));
    formparams.add(new BasicNameValuePair("age", "28"));
    formparams.add(new BasicNameValuePair("flag", "false"));
    formparams.add(new BasicNameValuePair("dateOfBirth", ""));
    UrlEncodedFormEntity postEntity = new UrlEncodedFormEntity(formparams, "UTF-8");

    this.post.setEntity(postEntity);

    CloseableHttpResponse response = this.client.execute(this.post);
    try {//from w  w w  . jav  a  2 s.c  o m
        HttpEntity entity = response.getEntity();
        assertThat(entity).isNotNull();
        String responseString = EntityUtils.toString(entity);

        Map<String, Object> rootAsMap = this.mapper.readValue(responseString, Map.class);
        assertThat(rootAsMap).hasSize(5);
        assertThat(rootAsMap.get("method")).isEqualTo("updateUser");
        assertThat(rootAsMap.get("type")).isEqualTo("rpc");
        assertThat(rootAsMap.get("action")).isEqualTo("userServiceInitBinderService");
        assertThat(rootAsMap.get("tid")).isEqualTo(1);

        Map<String, Object> result = (Map<String, Object>) rootAsMap.get("result");
        assertThat(result).hasSize(6);
        assertThat(result.get("name")).isEqualTo("Garner");
        assertThat(result.get("firstName")).isEqualTo("Joe");
        assertThat(result.get("age")).isEqualTo(28);
        assertThat(result.get("email")).isEqualTo("test@test.com");
        assertThat(result.get("flag")).isEqualTo(Boolean.FALSE);
        assertThat(result.get("dateOfBirth")).isNull();
        assertThat(result.get("success")).isEqualTo(Boolean.TRUE);
    } finally {
        IOUtils.closeQuietly(response);
    }
}