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

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

Introduction

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

Prototype

UniqueStringRandomizerBumper INSTANCE

To view the source code for com.liferay.portal.kernel.test.randomizerbumpers UniqueStringRandomizerBumper 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  av a 2 s. c  om*/

        firendlyURLMap.put(locale, friendlyURL);
    }

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