~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/TestWriteTag.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/TestWriteTag.java,v 1.12 2004/03/14 06:23:48 sraeburn Exp $
3
 
 * $Revision: 1.12 $
4
 
 * $Date: 2004/03/14 06:23:48 $
 
2
 * $Id: TestWriteTag.java 54929 2004-10-16 16:38:42Z germuska $ 
5
3
 *
6
4
 * Copyright 1999-2004 The Apache Software Foundation.
7
5
 * 
22
20
import java.util.Locale;
23
21
 
24
22
import javax.servlet.jsp.PageContext;
 
23
 
25
24
import junit.framework.Test;
26
25
import junit.framework.TestSuite;
27
26
 
28
 
import org.apache.cactus.JspTestCase;
29
27
import org.apache.cactus.WebResponse;
30
28
import org.apache.struts.Globals;
31
29
import org.apache.struts.taglib.SimpleBeanForTesting;
32
30
import org.apache.struts.taglib.TagUtils;
33
 
import org.apache.commons.lang.StringUtils;
 
31
import org.apache.struts.taglib.TaglibTestBase;
34
32
 
35
33
/**
36
34
 * Suite of unit tests for the
37
35
 * <code>org.apache.struts.taglib.bean.WriteTag</code> class.
38
36
 *
39
37
 */
40
 
public class TestWriteTag extends JspTestCase {
 
38
public class TestWriteTag extends TaglibTestBase {
41
39
        protected final static String TEST_STRING_VAL = "Test Value";
42
40
        protected final static Integer TEST_INTEGER_VAL = new Integer("1234");
43
41
        protected final static Double  TEST_DOUBLE_VAL  = new Double("1234.5961");
72
70
 
73
71
        private void formatAndTest(String compare, String output) {
74
72
                //fix for introduced carriage return / line feeds
75
 
                output = StringUtils.replace(output,"\r","");
76
 
                output = StringUtils.replace(output,"\n","");
 
73
                output = replace(output,"\r","");
 
74
                output = replace(output,"\n","");
77
75
                output = output.trim();
78
76
                //System.out.println("Testing [" + compare + "] == [" + output + "]");
79
77
            assertEquals(compare, output);