Example usage for com.liferay.portal.util HttpImpl HttpImpl

List of usage examples for com.liferay.portal.util HttpImpl HttpImpl

Introduction

In this page you can find the example usage for com.liferay.portal.util HttpImpl HttpImpl.

Prototype

public HttpImpl() 

Source Link

Usage

From source file:com.liferay.item.selector.web.internal.ItemSelectorImplTest.java

License:Open Source License

@Before
public void setUp() {
    _flickrItemSelectorCriterion = new FlickrItemSelectorCriterion();

    List<ItemSelectorReturnType> desiredItemSelectorReturnTypes = new ArrayList<>();

    desiredItemSelectorReturnTypes.add(_testURLItemSelectorReturnType);

    _flickrItemSelectorCriterion.setDesiredItemSelectorReturnTypes(desiredItemSelectorReturnTypes);

    _itemSelectorImpl = new ItemSelectorImpl();

    _stubItemSelectorCriterionSerializer.addItemSelectorReturnType(_testFileEntryItemSelectorReturnType);
    _stubItemSelectorCriterionSerializer.addItemSelectorReturnType(_testStringItemSelectorReturnType);
    _stubItemSelectorCriterionSerializer.addItemSelectorReturnType(_testURLItemSelectorReturnType);

    _itemSelectorImpl.setItemSelectorCriterionSerializer(_stubItemSelectorCriterionSerializer);

    ReflectionTestUtil.setFieldValue(_itemSelectorImpl, "_http", new HttpImpl());
    ReflectionTestUtil.setFieldValue(_itemSelectorImpl, "_portal", new PortalImpl());

    _mediaItemSelectorCriterion = new MediaItemSelectorCriterion();

    _mediaItemSelectorCriterion.setFileExtension("jpg");
    _mediaItemSelectorCriterion.setMaxSize(2048);

    desiredItemSelectorReturnTypes = new ArrayList<>();

    desiredItemSelectorReturnTypes.add(new TestFileEntryItemSelectorReturnType());
    desiredItemSelectorReturnTypes.add(_testURLItemSelectorReturnType);

    _mediaItemSelectorCriterion.setDesiredItemSelectorReturnTypes(desiredItemSelectorReturnTypes);

    HttpUtil httpUtil = new HttpUtil();

    httpUtil.setHttp(new HttpImpl());

    JSONFactoryUtil jsonFactoryUtil = new JSONFactoryUtil();

    jsonFactoryUtil.setJSONFactory(new JSONFactoryImpl());

    PortalUtil portalUtil = new PortalUtil();

    portalUtil.setPortal(new PortalImpl());
}