TestNG测试登陆模块的问题
qiaopang
2009-03-12
今天用testng测试简单的登录模块问题,遇到莫名其妙的异常:
“ERROR [org.jboss.seam.security.jaas.SeamLoginModule] No authentication method defined - please define authenticate-method for <security:identity/> in components.xml” 可是在components.xml中已经写入 <security:identity security-rules="#{securityRules}" authenticate-method="#{authenticator.authenticate}" remember-me="true"/> 不知道问什么,请教大家如何解决? AuthenticatorTest.java代码如下: package com.salas.test; import org.jboss.seam.core.Manager; import org.jboss.seam.mock.SeamTest; import org.testng.annotations.Test; public class AuthenticateTest extends SeamTest { @Test public void testLogin() throws Exception { new FacesRequest() { @Override protected void invokeApplication() { assert !isSessionInvalid(); assert getValue("#{identity.loggedIn}").equals(false); } }.run(); new FacesRequest() { @Override protected void updateModelValues() throws Exception { assert !isSessionInvalid(); setValue("#{identity.username}", "liuyan"); setValue("#{identity.password}", "password"); } @Override protected void invokeApplication() { invokeAction("#{identity.login}"); } @Override protected void renderResponse() { assert getValue("#{identity.loggedIn}").equals(true); } }.run(); } } |
相关讨论
相关资源推荐
- skyway-ios-sdk:适用于SkyWay的iOS SDK
- rational rosa_走向空中:使用Rational和Skyway Builder生成Spring应用程序
- skyway-js-sdk:SkyWayJavaScript SDK
- skyway-webrtc-gateway:适用于SkyWay的WebRTC网关
- java代码生成工具作用,Java应用开发中代码生成工具的作用
- Skyway Builder Community Edition-开源
- java代码中 作用_Java利用开发中代码生成工具的作用
- skyway-conf:天威会议
- skyway-p2p:skyway-p2p_200602
- webrtc_handson:WebRTC实际操作的一套教材(包括SkyWay)