Example usage for com.liferay.portal.kernel.test.randomizerbumpers NumericStringRandomizerBumper INSTANCE

List of usage examples for com.liferay.portal.kernel.test.randomizerbumpers NumericStringRandomizerBumper INSTANCE

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.test.randomizerbumpers NumericStringRandomizerBumper INSTANCE.

Prototype

NumericStringRandomizerBumper INSTANCE

To view the source code for com.liferay.portal.kernel.test.randomizerbumpers NumericStringRandomizerBumper INSTANCE.

Click Source Link

Usage

From source file:com.liferay.exportimport.internal.content.processor.test.DefaultExportImportContentProcessorTest.java

License:Open Source License

protected Layout addMultiLocaleLayout(Group group, boolean privateLayout) throws Exception {

    Map<Locale, String> nameMap = new HashMap<>();
    Map<Locale, String> firendlyURLMap = new HashMap<>();

    for (Locale locale : new Locale[] { _defaultLocale, _nonDefaultLocale }) {
        String name = RandomTestUtil.randomString(FriendlyURLRandomizerBumper.INSTANCE,
                NumericStringRandomizerBumper.INSTANCE, UniqueStringRandomizerBumper.INSTANCE);

        String friendlyURL = StringPool.SLASH + FriendlyURLNormalizerUtil.normalize(name);

        nameMap.put(locale, name);// w  ww.j a va 2s  .c  o  m

        firendlyURLMap.put(locale, friendlyURL);
    }

    return LayoutTestUtil.addLayout(group.getGroupId(), privateLayout, nameMap, firendlyURLMap);
}