/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See LICENSE.txt included in this distribution for the specific
* language governing permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at LICENSE.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/**
* Unit tests for the {@code PageConfig} class.
*/
public class PageConfigTest {
repository = new TestRepository();
}
repository = null;
}
@Test
public void canProcess() {
// Expect no redirection (that is, empty string is returned) for a
// file that exists.
// Expect directories without trailing slash to get a trailing slash
// appended.
"/source", "/xref", "/mercurial");
"/source", "/history", "/mercurial");
// Expect no redirection (that is, empty string is returned) if the
// directories already have a trailing slash.
// Expect null if the file or directory doesn't exist.
}
/**
* Assert that {@code canProcess()} returns the expected value for the
* specified path.
*
* @param expected the expected return value
* @param context the context path
* @param servlet the servlet path
* @param pathInfo the path info
*/
private void assertCanProcess(
}
/**
* Create a request with the specified path elements.
*
* @param contextPath the context path
* @param servletPath the path of the servlet
* @param pathInfo the path info
* @return a servlet request for the specified path
*/
{
return new DummyHttpServletRequest() {
public String getContextPath() {
return contextPath;
}
public String getServletPath() {
return servletPath;
}
public String getPathInfo() {
return pathInfo;
}
};
}
}