KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > strutsel > taglib > utils > JspTagTestCase


1 /*
2  * $Id: JspTagTestCase.java 54933 2004-10-16 17:04:52Z germuska $
3  *
4  * Copyright 1999-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 package org.apache.strutsel.taglib.utils;
20
21 import java.util.HashMap JavaDoc;
22 import org.apache.cactus.JspTestCase;
23
24 public class JspTagTestCase extends JspTestCase
25 {
26     public JspTagTestCase(String JavaDoc theName) {
27         super(theName);
28     }
29
30     protected void
31         checkAttrValue(HashMap JavaDoc attrMap,
32                        com.meterware.httpunit.WebResponse testResponse,
33                        String JavaDoc headerKey,
34                        String JavaDoc tagName,
35                        String JavaDoc attrName)
36     {
37         String JavaDoc attrValue = (String JavaDoc)attrMap.get(attrName);
38         String JavaDoc requiredAttrValue =
39             (String JavaDoc)testResponse.getHeaderField(headerKey);
40
41         if (!attrValue.equals(requiredAttrValue)) {
42             fail(TestHelper.getAttrErrMess(tagName, attrName,
43                                            requiredAttrValue, attrValue));
44         }
45     }
46 }
47
Popular Tags