⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 passwordhintactiontest.java

📁 Chinaxp 论坛源代码
💻 JAVA
字号:
/* * XP Forum * * Copyright (c) 2002-2003 RedSoft Group.  All rights reserved. * */package org.redsoft.forum.web;import org.redsoft.forum.dao.DAOFactory;/** * Test Case for PasswordHintAction */public class PasswordHintActionTest extends MyMockStrutsTestCase {    public PasswordHintActionTest(String s) {        super(s);    }    public void setUp() throws Exception {        super.setUp();        DAOFactory.buildMockDAOFactory();        setRequestPathInfo("/passwordHint");    }    public void testNoInput() {        actionPerform();        verifyActionErrors( new String[]{            "error.userName.required",            "error.email.required"        } );        verifyInputForward();    }    public void testUsernameNotFound() {        // incorrect userName, should be "User1"        addRequestParameter( "userName", "xxx" );        addRequestParameter( "email", "user@domain.org" );        actionPerform();        verifyActionErrors( new String[] {            "error.userName.notFound"        } );        verifyInputForward();    }    public void testEmailMismatch() {        addRequestParameter( "userName", "User1" );        // incorrect email, should be "user@domain.org"        addRequestParameter( "email", "xxx@xxx.org" );        actionPerform();        verifyActionErrors( new String[] {            "error.email.misMatch"        } );        verifyInputForward();    }    public void testOk() {        addRequestParameter( "userName", "User1" );        addRequestParameter( "email", "user@domain.org" );        actionPerform();        verifyNoActionErrors();        verifyForward( "success" );    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -