1 /*
2 * Copyright (C) 2003-2013 eXo Platform SAS.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
13 *
14 * You should have received a copy of the GNU Affero General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 package org.exoplatform.commons.search.service;
18
19 import java.io.InputStream;
20 import java.util.List;
21 import java.util.Map;
22
23 import org.exoplatform.services.test.mock.MockHttpServletRequest;
24
25
26 /**
27 * Created by The eXo Platform SAS
28 * Author : Canh Pham Van
29 * canhpv@exoplatform.com
30 * Mar 25, 2013
31 */
32 public class UnifiedSearchMockHttpServletRequest extends MockHttpServletRequest{
33
34 public UnifiedSearchMockHttpServletRequest(String url,
35 InputStream data,
36 int length,
37 String method,
38 Map<String, List<String>> headers) {
39 super(url, data, length, method, headers);
40 // TODO Auto-generated constructor stub
41 }
42
43
44 /**
45 * {@inheritDoc}
46 */
47 public String getServerName() {
48 try {
49 return super.getServerName();
50 } catch (Exception e) { }
51 return "localhost";
52 }
53
54 /**
55 * {@inheritDoc}
56 */
57 public int getServerPort() {
58 try {
59 return super.getServerPort();
60 } catch (Exception e) { }
61 return 8080;
62 }
63
64
65 }