/*
* 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 {
@SuppressWarnings("javadoc")
repository = new TestRepository();
}
@SuppressWarnings("javadoc")
public static void tearDownClass() {
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.
// but not for diffs or pathes with history - pass through
// if there is no repo, don't pass
// but diff takes care by itself - so always pass
// Expect no redirection (that is, empty string is returned) if the
// directories already have a trailing slash.
// if the file or directory doesn't exist, don't pass.
// but for history it might be a previously existing and now deleted path
// so let the servelt determine, what to do
// but diff takes care by itself - so always pass
}
/**
* 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
*/
{
}
/**
* 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;
}
};
}
}