List of usage examples for com.liferay.portal.kernel.util HttpUtil HttpUtil
HttpUtil
From source file:com.liferay.blogs.internal.util.PingbackMethodImplTest.java
License:Open Source License
protected void setUpHttpUtil() throws Exception { whenHttpURLToString("<body><a href='http://" + _TARGET_URI + "'>" + _EXCERPT_BODY + "</a></body>"); mockStatic(PortalSocketPermission.class, Mockito.RETURNS_DEFAULTS); HttpUtil httpUtil = new HttpUtil(); httpUtil.setHttp(_http);//w w w . j a va 2s . c o m }
From source file:com.liferay.blogs.web.internal.portlet.action.TrackbackMVCActionCommandTest.java
License:Open Source License
protected void setUpHttpUtil() throws Exception { HttpUtil httpUtil = new HttpUtil(); httpUtil.setHttp(_http); }
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()); }
From source file:org.politaktiv.communityselect.application.TestCommunityService.java
License:Apache License
@BeforeClass public static void setupClass() throws PortalException, SystemException { PortalUtil pu = new PortalUtil(); pu.setPortal(new PortalMock()); HttpUtil hu = new HttpUtil(); hu.setHttp(new HttpMock()); service = new CommunityService(); service.setCommunitiesRepository(new MockCommunitiesRepository()); service.setMembershipRequestService(new MockMembershipRequestService()); }