@Test public void testGetRequestedRevision() { final String[] params = {"r", "h", "r", "r", "r"}; final String[] revisions = { "6c5588de", "", "6c5588de", "6c5588de", "6c5588de" }; assertEquals(params.length, revisions.length); for (int i = 0; i < revisions.length; i++) { final int index = i; DummyHttpServletRequest req = new DummyHttpServletRequest() { @Override public String getParameter(String name) { if (name.equals("r")) { return revisions[index]; } return null; } }; PageConfig cfg = PageConfig.get(req); String rev = cfg.getRequestedRevision(); assertNotNull(rev); assertEquals(revisions[i], rev); assertFalse(rev.contains("r=")); PageConfig.cleanup(req); } }
public String getRequestedRevision() { if (rev == null) { String tmp = Laundromat.launderInput( req.getParameter(QueryParameters.REVISION_PARAM)); rev = (tmp != null && tmp.length() > 0) ? tmp : ""; } return rev; }
PageConfig { public String getRequestedRevision() { if (rev == null) { String tmp = Laundromat.launderInput( req.getParameter(QueryParameters.REVISION_PARAM)); rev = (tmp != null && tmp.length() > 0) ? tmp : ""; } return rev; } }
PageConfig { public String getRequestedRevision() { if (rev == null) { String tmp = Laundromat.launderInput( req.getParameter(QueryParameters.REVISION_PARAM)); rev = (tmp != null && tmp.length() > 0) ? tmp : ""; } return rev; } private  PageConfig(HttpServletRequest req); }
PageConfig { public String getRequestedRevision() { if (rev == null) { String tmp = Laundromat.launderInput( req.getParameter(QueryParameters.REVISION_PARAM)); rev = (tmp != null && tmp.length() > 0) ? tmp : ""; } return rev; } private  PageConfig(HttpServletRequest req); void setRequestAttribute(String attr, Object val); Object getRequestAttribute(String attr); void removeAttribute(String string); void addHeaderData(String data); String getHeaderData(); DiffData getDiffData(); DiffType getDiffType(); boolean fullDiff(); String canProcess(); List<String> getResourceFileList(); long getLastModified(); String getHistoryDirs(); int getIntParam(String name, int defaultValue); int getSearchStart(); int getSearchMaxItems(); int getRevisionMessageCollapseThreshold(); int getCurrentIndexedCollapseThreshold(); int getGroupsCollapseThreshold(); List<SortOrder> getSortOrder(); QueryBuilder getQueryBuilder(); EftarFileReader getEftarReader(); String getDefineTagsIndex(); String getRequestedRevision(); boolean hasHistory(); boolean hasAnnotations(); boolean annotate(); Annotation getAnnotation(); String[] getSearchOnlyIn(); Project getProject(); String getRequestedProjectsAsString(); SortedSet<String> getRequestedProjects(); List<String> getCookieVals(String cookieName); ProjectHelper getProjectHelper(); void setTitle(String title); String getTitle(); String getCssDir(); RuntimeEnvironment getEnv(); IgnoredNames getIgnoredNames(); String getSourceRootPath(); Prefix getPrefix(); String getPath(); File getResourceFile(String path); File getResourceFile(); String getResourcePath(); boolean resourceNotAvailable(); boolean isDir(); File[] findDataFiles(List<String> filenames); File findDataFile(); String getLatestRevision(); boolean isLatestRevision(String rev); String getRevisionLocation(String revStr); String getDirectoryRedirect(); String getUriEncodedPath(); PageConfig addScript(String name); Scripts getScripts(); File getDataRoot(); SearchHelper prepareSearch(); SearchHelper prepareInternalSearch(); static PageConfig get(HttpServletRequest request); static void cleanup(ServletRequest sr); boolean isAllowed(Project t); boolean isAllowed(Group g); SortedSet<AcceptedMessage> getMessages(); SortedSet<AcceptedMessage> getMessages(String tag); String getShortPath(String path); String getSearchTitle(); String getHistoryTitle(); String getPathTitle(); void checkSourceRootExistence(); boolean isNotModified(HttpServletRequest request, HttpServletResponse response); static String getRelativePath(String root, String path); boolean evaluateMatchOffset(); }
PageConfig { public String getRequestedRevision() { if (rev == null) { String tmp = Laundromat.launderInput( req.getParameter(QueryParameters.REVISION_PARAM)); rev = (tmp != null && tmp.length() > 0) ? tmp : ""; } return rev; } private  PageConfig(HttpServletRequest req); void setRequestAttribute(String attr, Object val); Object getRequestAttribute(String attr); void removeAttribute(String string); void addHeaderData(String data); String getHeaderData(); DiffData getDiffData(); DiffType getDiffType(); boolean fullDiff(); String canProcess(); List<String> getResourceFileList(); long getLastModified(); String getHistoryDirs(); int getIntParam(String name, int defaultValue); int getSearchStart(); int getSearchMaxItems(); int getRevisionMessageCollapseThreshold(); int getCurrentIndexedCollapseThreshold(); int getGroupsCollapseThreshold(); List<SortOrder> getSortOrder(); QueryBuilder getQueryBuilder(); EftarFileReader getEftarReader(); String getDefineTagsIndex(); String getRequestedRevision(); boolean hasHistory(); boolean hasAnnotations(); boolean annotate(); Annotation getAnnotation(); String[] getSearchOnlyIn(); Project getProject(); String getRequestedProjectsAsString(); SortedSet<String> getRequestedProjects(); List<String> getCookieVals(String cookieName); ProjectHelper getProjectHelper(); void setTitle(String title); String getTitle(); String getCssDir(); RuntimeEnvironment getEnv(); IgnoredNames getIgnoredNames(); String getSourceRootPath(); Prefix getPrefix(); String getPath(); File getResourceFile(String path); File getResourceFile(); String getResourcePath(); boolean resourceNotAvailable(); boolean isDir(); File[] findDataFiles(List<String> filenames); File findDataFile(); String getLatestRevision(); boolean isLatestRevision(String rev); String getRevisionLocation(String revStr); String getDirectoryRedirect(); String getUriEncodedPath(); PageConfig addScript(String name); Scripts getScripts(); File getDataRoot(); SearchHelper prepareSearch(); SearchHelper prepareInternalSearch(); static PageConfig get(HttpServletRequest request); static void cleanup(ServletRequest sr); boolean isAllowed(Project t); boolean isAllowed(Group g); SortedSet<AcceptedMessage> getMessages(); SortedSet<AcceptedMessage> getMessages(String tag); String getShortPath(String path); String getSearchTitle(); String getHistoryTitle(); String getPathTitle(); void checkSourceRootExistence(); boolean isNotModified(HttpServletRequest request, HttpServletResponse response); static String getRelativePath(String root, String path); boolean evaluateMatchOffset(); static final String OPEN_GROK_PROJECT; }