Example usage for org.apache.commons.lang RandomStringUtils randomAlphabetic

List of usage examples for org.apache.commons.lang RandomStringUtils randomAlphabetic

Introduction

In this page you can find the example usage for org.apache.commons.lang RandomStringUtils randomAlphabetic.

Prototype

public static String randomAlphabetic(int count) 

Source Link

Document

Creates a random string whose length is the number of characters specified.

Characters will be chosen from the set of alphabetic characters.

Usage

From source file:edu.sampleu.admin.PermissionAftBase.java

protected void createNewEnterDetails() throws InterruptedException {
    waitAndTypeByName("document.documentHeader.documentDescription", RandomStringUtils.randomAlphabetic(30));
    selectByName("document.newMaintainableObject.templateId", "KR-IDM : Assign Role");
    selectByName("document.newMaintainableObject.namespaceCode", "KR-BUS - Service Bus");
    waitAndTypeByName("document.newMaintainableObject.name", RandomStringUtils.randomAlphabetic(10));
}

From source file:edu.sampleu.admin.ResponsibilityAftBase.java

protected void createNewEnterDetails() throws InterruptedException {
    waitAndTypeByName("document.documentHeader.documentDescription", RandomStringUtils.randomAlphabetic(30));
    String randomAlphabetic = RandomStringUtils.randomAlphabetic(10);
    selectByName("document.newMaintainableObject.namespaceCode", "KR-BUS - Service Bus");
    waitAndTypeByName("document.newMaintainableObject.name", randomAlphabetic);
    waitAndTypeByName("document.newMaintainableObject.documentTypeName", "RoutingRuleDocument");
    waitAndTypeByName("document.newMaintainableObject.routeNodeName", randomAlphabetic);
    waitAndClickByName("document.newMaintainableObject.actionDetailsAtRoleMemberLevel");
    waitAndClickByName("document.newMaintainableObject.required");
}

From source file:com.haulmont.cuba.gui.components.filter.UserSetHelper.java

public static String generateSetFilter(Set ids, String entityClass, String componentId, String entityAlias) {
    Document document = DocumentHelper.createDocument();
    Element root = DocumentHelper.createElement("filter");
    Element or = root.addElement("and");

    Element condition = or.addElement("c");
    condition.addAttribute("name", "set");
    condition.addAttribute("inExpr", "true");
    condition.addAttribute("hidden", "true");
    condition.addAttribute("locCaption", "Set filter");
    condition.addAttribute("entityAlias", entityAlias);
    condition.addAttribute("class", entityClass);
    condition.addAttribute("type", ConditionType.CUSTOM.name());

    String listOfId = createIdsString(ids);
    String randomName = RandomStringUtils.randomAlphabetic(10);
    condition.addText(entityAlias + ".id in :component$" + componentId + "." + randomName);

    Element param = condition.addElement("param");
    param.addAttribute("name", "component$" + componentId + "." + randomName);
    param.addText(listOfId);/* w  w  w.  ja va2 s.co  m*/

    document.add(root);
    return Dom4j.writeDocument(document, true);
}

From source file:edu.sampleu.admin.CampusAftBase.java

protected void createNewEnterDetails() throws InterruptedException {
    waitAndTypeByName("document.documentHeader.documentDescription", RandomStringUtils.randomAlphabetic(30));
    String randomAlphabetic = RandomStringUtils.randomAlphabetic(10);
    String randomNumbeForCode = RandomStringUtils.randomNumeric(1);
    String randomAlphabeticForCode = RandomStringUtils.randomAlphabetic(1);
    clearTextByName("document.newMaintainableObject.code");
    waitAndTypeByName("document.newMaintainableObject.code", randomNumbeForCode + randomAlphabeticForCode);
    waitAndTypeByName("document.newMaintainableObject.name", randomAlphabetic);
    waitAndTypeByName("document.newMaintainableObject.shortName", randomAlphabetic);
    selectByName("document.newMaintainableObject.campusTypeCode", "B - BOTH");
}

From source file:com.knewton.mapreduce.util.RandomStudentEventGenerator.java

/**
 * Generates a random student event. Sets the date of the event to now.
 *
 * @return Random student event with event time set to now.
 *//*  ww  w . ja  v a  2 s.  c  om*/
public static StudentEvent getRandomStudentEvent() {
    StudentEventData eventData = new StudentEventData(getRandomId(), DateTime.now().getMillis(),
            RandomStringUtils.randomAlphabetic(10), RandomUtils.nextInt(101));
    eventData.setBook(RandomStringUtils.randomAlphabetic(10));
    eventData.setCourse(RandomStringUtils.randomAlphabetic(10));
    return new StudentEvent(initTimeInMillis++, eventData);
}

From source file:com.alibaba.dubbo.util.KetamaNodeLocatorTest.java

public static List<String> generateRandomStrings(final int size) {
    final List<String> results = new ArrayList<String>(size);
    for (int ix = 0; ix < size; ix++) {
        results.add(new StringBuilder(RandomStringUtils.randomAlphanumeric(5))
                .append(RandomStringUtils.randomAlphabetic(ix % 5)).append(ix).toString());
    }//from   w  w w.  j  av  a 2 s .  c  o  m
    return results;
}

From source file:integration.report.ListIdentifiersIT.java

@Test
public void testListOAIDCIdentifiers() throws Exception {
    createFedoraObjectWithOaiRecord(RandomStringUtils.randomAlphabetic(16),
            RandomStringUtils.randomAlphabetic(16), null,
            this.getClass().getClassLoader().getResourceAsStream("oaidc.xml"));
    HttpResponse resp = getOAIPMHResponse(VerbType.LIST_IDENTIFIERS.value(), null, "oai_dc", null, null, null);
    assertEquals(200, resp.getStatusLine().getStatusCode());
    OAIPMHtype oaipmh = ((JAXBElement<OAIPMHtype>) this.unmarshaller.unmarshal(resp.getEntity().getContent()))
            .getValue();/*from  ww w.  j a  va 2  s.  co m*/
    assertEquals(0, oaipmh.getError().size());
    assertNotNull(oaipmh.getRequest());
    assertEquals(VerbType.LIST_IDENTIFIERS.value(), oaipmh.getRequest().getVerb().value());
    assertTrue(oaipmh.getListIdentifiers().getHeader().size() > 0);
}

From source file:com.gwtcx.server.util.Security.java

/**
 * Generates a string of 32 letters (A to Z)
 * /*  w w  w . j ava2s .  c  o m*/
 * @return A string formed by 32 A-to-Z random letters.
 */
public static String randomCharString() {
    return RandomStringUtils.randomAlphabetic(32);
}

From source file:de.unioninvestment.eai.portal.portlet.crud.scripting.category.StringCategoryTest.java

@Test
public void shouldReturnStringUnchanged() {
    String str = RandomStringUtils.randomAlphabetic(20);
    String result = StringCategory.shorten(str, 20, "{0}... ({1} Zeichen)");

    Assert.assertEquals(str, result);/*from w  w  w.j  a va 2 s . co  m*/
}

From source file:com.adobe.acs.commons.social.linkedin.LinkedInApi20Test.java

@Test
public void testAuthorizationWithNoScopes() {
    String state = RandomStringUtils.randomAlphabetic(10);
    String key = RandomStringUtils.randomAlphabetic(10);
    String secret = RandomStringUtils.randomAlphabetic(10);
    LinkedInApi20 api = new LinkedInApi20(state);

    OAuthService service = new ServiceBuilder().provider(api).apiKey(key).apiSecret(secret)
            .callback("http://localhost:4502/linkedin").build();

    String expected = "https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=" + key
            + "&state=" + state + "&redirect_uri=" + OAuthEncoder.encode("http://localhost:4502/linkedin");

    assertEquals(expected, service.getAuthorizationUrl(null));
}