📄 testaction.java
字号:
package com.ouyang.ejb3.test;
import org.junit.Assert;
import org.junit.Test;
import com.ouyang.ejb3.action.LoginAction;
import com.ouyang.ejb3.entity.User;
public class TestAction {
@Test
public void testLoginAction() throws Exception{
User user = new User("test","test",null);
LoginAction loginAction = new LoginAction();
loginAction.setUser(user);
String returnString = loginAction.execute();
Assert.assertEquals("success", returnString);
}
@Test
public void testLoginAction2() throws Exception{
User user = new User("nameError","test",null);
LoginAction loginAction = new LoginAction();
loginAction.setUser(user);
String returnString = loginAction.execute();
Assert.assertEquals("nameError", returnString);
}
@Test
public void testLoginAction3() throws Exception{
User user = new User("test","passwordError",null);
LoginAction loginAction = new LoginAction();
loginAction.setUser(user);
String returnString = loginAction.execute();
Assert.assertEquals("passwordError", returnString);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -