~ubuntu-branches/ubuntu/lucid/libstruts1.2-java/lucid

« back to all changes in this revision

Viewing changes to src/test/org/apache/struts/taglib/bean/TestPageTag.java

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2006-04-24 12:14:23 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060424121423-naev53qigqgks0sa
Tags: 1.2.9-1
New upstream  release Fixes  three security  problems: CVE-2006-1546,
CVE-2006-1547,  CVE-2006-1548  (closes:  #360551),  thanks  to  Moritz
Muehlenhoff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $Header: /home/cvs/jakarta-struts/src/test/org/apache/struts/taglib/bean/TestPageTag.java,v 1.10 2004/03/14 06:23:48 sraeburn Exp $
3
 
 * $Revision: 1.10 $
4
 
 * $Date: 2004/03/14 06:23:48 $
 
2
 * $Id: TestPageTag.java 54929 2004-10-16 16:38:42Z germuska $ 
5
3
 *
6
4
 * Copyright 1999-2004 The Apache Software Foundation.
7
5
 * 
20
18
package org.apache.struts.taglib.bean;
21
19
 
22
20
import javax.servlet.jsp.PageContext;
 
21
 
23
22
import junit.framework.Test;
24
23
import junit.framework.TestSuite;
25
24
 
26
 
import org.apache.cactus.JspTestCase;
27
25
import org.apache.cactus.WebResponse;
28
 
import org.apache.commons.lang.StringUtils;
 
26
import org.apache.struts.taglib.TaglibTestBase;
29
27
 
30
28
/**
31
29
 * Suite of unit tests for the
32
30
 * <code>org.apache.struts.taglib.bean.PageTag</code> class.
33
31
 *
34
32
 */
35
 
public class TestPageTag extends JspTestCase {
 
33
public class TestPageTag extends TaglibTestBase {
36
34
 
37
35
    protected final static String PAGETAG_KEY = "PAGETAG_KEY";
38
36
    protected final static String PAGETAG_VAL = "PAGETAG_VAL";
71
69
 
72
70
        private void formatAndTest(String compare, String output) {
73
71
                //fix for introduced carriage return / line feeds
74
 
                output = StringUtils.replace(output,"\r","");
75
 
                output = StringUtils.replace(output,"\n","");
 
72
                output = replace(output,"\r","");
 
73
                output = replace(output,"\n","");
76
74
                output = output.trim();
77
75
                //System.out.println("Testing [" + compare + "] == [" + output + "]");
78
76
            assertEquals(compare, output);