• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem wrt StrutsTest

 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Am using strutstest for testing our Struts actionclasses . Am getting
this error only when run from within a war file . Thoughts??
This occurs only when run from within a war file. Am almost done with
automating the testing from within the daily builds (using ANT).
But am unable to solve this issue. All the jars required on the "server
side" for running cactus tests reside in the webapp/web-inf/lib
directory.
Testcase: testSuccessfulLogin took 0.36 sec
Caused an ERROR
(class: com/i2/iquote/test/ui/actions/LoginActionTest, method:
testSuccessfulLogin signature: ()V) Incompatible object argument for
function
call
java.lang.VerifyError: (class:
com/i2/iquote/test/ui/actions/LoginActionTest, method:
testSuccessfulLogin signature: ()V) Incompatible object
argument for function call
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at
org.apache.cactus.util.ClassLoaderUtils.dispatch130_loadClassFromWebappClassLoader(ClassLoaderUtils.java;org/apache/cactus/util/log/LogAspect.aj(1k):132)
-----------------------------------------
Source Code:
public class LoginActionTest extends BaseTestcase {
public LoginActionTest(String name) {
super(name);
}
public void testSuccessfulLogin() {
setRequestPathInfo("/logon");
addRequestParameter(UIConstants.USER_KEY,
getTestParameter("USERNAME"));
addRequestParameter(UIConstants.PASSWORD_KEY,
getTestParameter("CORRECT_PASSWORD"));
actionPerform();
verifyForward("success");
User user = (User) getSession().getAttribute(UIConstants.CURRENT_USER);
Boolean isLoggedIn =
(Boolean) getSession().getAttribute(UIConstants.IS_USER_LOGGED_IN);
assertNotNull("USER Object from session IS NULL", user);
assertNotNull("IS LOGGED IN from session is NULL", isLoggedIn);
assertTrue(" USER NOT LOGGED IN ", isLoggedIn.booleanValue());
String uid = user.getId();
assertEquals("user_100", uid);
Role role = user.getRole();
assertNotNull(" ROLE OBTAINED FOR USER IS NULL ", role);
verifyNoActionErrors();
printString("User user_100 logged in successfully.");
}
}
BaseTestCase in turn extends CactusStrutsTestCase
thanks,
regards,
karthik
 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic