| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| TestableRequest |
|
| 1.0;1 |
| 1 | // Copyright 2007, 2009 The Apache Software Foundation | |
| 2 | // | |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 | // you may not use this file except in compliance with the License. | |
| 5 | // You may obtain a copy of the License at | |
| 6 | // | |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 | // | |
| 9 | // Unless required by applicable law or agreed to in writing, software | |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 | // See the License for the specific language governing permissions and | |
| 13 | // limitations under the License. | |
| 14 | ||
| 15 | package org.apache.tapestry5.internal.test; | |
| 16 | ||
| 17 | import org.apache.tapestry5.services.Request; | |
| 18 | import org.apache.tapestry5.test.PageTester; | |
| 19 | ||
| 20 | import java.util.Locale; | |
| 21 | ||
| 22 | /** | |
| 23 | * An extended version of {@link Request} that allows the {@link PageTester} to control and override behavior, | |
| 24 | * effectively simulating the portions of {@link Request} that are provided normally by a servlet container. | |
| 25 | */ | |
| 26 | public interface TestableRequest extends Request | |
| 27 | { | |
| 28 | /** | |
| 29 | * Clears the internal parameters map. | |
| 30 | * | |
| 31 | * @return the request for further configuration | |
| 32 | */ | |
| 33 | TestableRequest clear(); | |
| 34 | ||
| 35 | /** | |
| 36 | * Sets the path; the path should begin with a "/" character and contain everything from there to the start of query | |
| 37 | * parameters (if any). | |
| 38 | * | |
| 39 | * @param path | |
| 40 | * @return the request for further configuration | |
| 41 | */ | |
| 42 | TestableRequest setPath(String path); | |
| 43 | ||
| 44 | /** | |
| 45 | * Sets the locale requested by "the browser". | |
| 46 | * | |
| 47 | * @returns the request for further configuration | |
| 48 | */ | |
| 49 | TestableRequest setLocale(Locale locale); | |
| 50 | ||
| 51 | /** | |
| 52 | * Loads a single parameter/value pair. This may define a new parameter, or add a value to a list of parameters. | |
| 53 | * | |
| 54 | * @return the request for further configuration | |
| 55 | */ | |
| 56 | TestableRequest loadParameter(String parameterName, String parameterValue); | |
| 57 | ||
| 58 | /** | |
| 59 | * Overrides a parameter to the specific value, regardless of how the parameter was previously set. | |
| 60 | */ | |
| 61 | TestableRequest overrideParameter(String parameterName, String parameterValue); | |
| 62 | } |