~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/TestMessageTag2.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/TestMessageTag2.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: TestMessageTag2.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
 
import org.apache.commons.lang.StringUtils;
 
30
import org.apache.struts.taglib.TaglibTestBase;
33
31
 
34
32
/**
35
33
  * These tests attempt to cover every single possible configuration of the
42
40
  * checked here in endXXX method.
43
41
  *
44
42
  */
45
 
public class TestMessageTag2 extends JspTestCase {
 
43
public class TestMessageTag2 extends TaglibTestBase {
46
44
 
47
45
    protected final static String TEST_KEY = "BeanKey";
48
46
    protected final static String TEST_VAL = "Testing Message 1 2";
77
75
 
78
76
        private void formatAndTest(String compare, String output) {
79
77
                //fix for introduced carriage return / line feeds
80
 
                output = StringUtils.replace(output,"\r","");
81
 
                output = StringUtils.replace(output,"\n","");
 
78
                output = replace(output,"\r","");
 
79
                output = replace(output,"\n","");
82
80
                output = output.trim();
83
81
                //System.out.println("Testing [" + compare + "] == [" + output + "]");
84
82
            assertEquals(compare, output);