01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.pluto.testsuite;
18:
19: import java.util.Map;
20:
21: import javax.portlet.PortletConfig;
22: import javax.portlet.PortletContext;
23: import javax.portlet.PortletRequest;
24: import javax.portlet.PortletResponse;
25:
26: /**
27: * Interface for pluto portlet test classes.
28: *
29: */
30: public interface PortletTest {
31:
32: /**
33: * Returns the test suite name.
34: * @return the test suite name.
35: */
36: public String getTestSuiteName();
37:
38: /**
39: * Initializes the portlet test using test configuration.
40: * @param config the test configuration.
41: */
42: public void init(TestConfig config);
43:
44: /**
45: * Returns the render parameters. This method will be invoked in
46: * <code>Portlet.processAction()</code> method. All parameters returned
47: * by this method will be set as render parameters.
48: *
49: * @param request the portlet request.
50: * @return a map of render parameters, key is the string name of the
51: * parameter, value is a string array.
52: */
53: public Map getRenderParameters(PortletRequest request);
54:
55: /**
56: * Runs the test.
57: * @param config the portlet config.
58: * @param context the portlet context.
59: * @param request the portlet request.
60: * @param response the portlet response.
61: * @return the results of the test.
62: */
63: public TestResults doTest(PortletConfig config,
64: PortletContext context, PortletRequest request,
65: PortletResponse response);
66:
67: /**
68: * Returns the test configuration.
69: * @return the test configuration.
70: */
71: public TestConfig getConfig();
72:
73: }
|