You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2005/08/29 19:19:29 UTC

DO NOT REPLY [Bug 36409] New: - Testcases test protected method of some struts classes, may fail in some setup due to classloading

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36409>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36409

           Summary: Testcases test protected method of some struts classes,
                    may fail in some setup due to classloading
           Product: Struts
           Version: 1.2.7
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Test
        AssignedTo: dev@struts.apache.org
        ReportedBy: coltzhao@yahoo.com


Testcases test protected method of some struts classes, may fail in some setup
due to classloading

The failures are listed below:

Test Name 	        Tests 	Errors 	Failures
TestActionServlet 	1 	1 	0
TestEmptyTag 	        2 	2 	0
TestEqualTag 	        9 	9 	0
TestGreaterEqualTag 	8 	8 	0
TestGreaterThanTag 	8 	8 	0
TestLessEqualTag 	9 	9 	0
TestLessThanTag 	9 	9 	0
TestNotEqualTag 	11 	11 	0
TestNotPresentTag 	13 	13 	0
TestPresentTag 	        17 	17 	0

What is the error

The TestActionServlet testcase tries to access
org.apache.struts.action.ActionServlet.initInternal() method from
org.apache.struts.action.TestActionServlet calss, and get an exception:
"java.lang.IllegalAccessError"

Similiarly, almost all TestXXXTag testcases try to access corresponding
org.apache.struts.taglib.logic.XXXTag.condition() method from
org.apache.struts.taglib.logic.TestXXXTag classes, and get an exception:
"java.lang.IllegalAccessError" 


In some setup, struts.jar is loaded by different classloader from the one load
test.war, this will cause these tests fail.

For example, jboss, with 

<attribute name="UseJBossWebLoader">true</attribute> 

in

server/default/deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml

and deploy the struts-mailreader.war in the server before test.

struts.jar is loaded from struts-mailreader.war by one classloader  and
testcases in test.war is loaded with another classloader, will cause these tests
fail.

Following is my patch for all TestXXXTag testcases, basically use public method 
doStartTag() instead of protected method condition().

Still there seems no way to just modify the testcase TestActionServlet to make
it work without modifying struts source code.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org