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

📄 usermanagerimpltest.java

📁 struts + spring + hibernate的例子,用IntelliJ IDEA制作
💻 JAVA
字号:
/*
 * Copyright (c) 2004 Your Corporation. All Rights Reserved.
 */
package net.jetmaven.service.hibernate;

import junit.framework.TestCase;
import net.jetmaven.service.UserManager;
import net.jetmaven.JUnitHelper;
import net.jetmaven.Constants;
import net.jetmaven.model.PersonPO;

/**
 * <b>description:</b>  测试UserManager接口
 * Date: 2004-6-18
 *
 * @author <a href="mailto:linux_china@hotmail.com">chenlibing</a>
 */
public class UserManagerImplTest extends TestCase
{
    UserManager manager = null;

    /**
     * The fixture set up called before every test method.
     */
    protected void setUp() throws Exception
    {
        manager = (UserManager) JUnitHelper.getApplicationContext().getBean(UserManager.BEAN_NAME);
    }

    /**
     * The fixture clean up called after every test method.
     */
    protected void tearDown() throws Exception
    {

    }

    /**
     * 测试用户登陆
     *
     * @throws Exception 异常
     */
    public void testLogon() throws Exception
    {
        String logonName = "lbchen";
        String password = "1111";
        assertEquals(manager.logon(logonName, password), Constants.USER_VALID);
    }

    /**
     * 测试添加系统用户
     *
     * @throws Exception 异常
     */
    public void testSavePerson() throws Exception
    {
        PersonPO user = manager.getPerson(new Integer(2));
        user.setPassword("77777");
        Integer userId = manager.savePerson(user);
        System.out.println(".....................userId:" + userId);
        assertTrue(userId.intValue() > 0);
    }
}

⌨️ 快捷键说明

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