Example usage for com.liferay.portal.test.randomizerbumpers FriendlyURLRandomizerBumper INSTANCE

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

Introduction

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

Prototype

FriendlyURLRandomizerBumper INSTANCE

To view the source code for com.liferay.portal.test.randomizerbumpers FriendlyURLRandomizerBumper 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 w w  . jav  a 2 s  .  c o  m

        firendlyURLMap.put(locale, friendlyURL);
    }

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