package testng;
import org.jboss.seam.mock.SeamTest;
import org.testng.annotations.Test;
public class LoginTest extends SeamTest{
@Test
public void testLogin() throws Exception{
new NonFacesRequest("/login.xhtml"){
protected void renderResponse() throws Exception {
setValue("#{credentials.username}", "1");
setValue("#{credentials.password}", "1");
assert (Boolean)getValue("#{authenticator.authenticate()}");
}
}.run();
}
}
参照地址:http://wan-2004.iteye.com/blog/309863
import org.jboss.seam.mock.SeamTest;
import org.testng.annotations.Test;
public class LoginTest extends SeamTest{
@Test
public void testLogin() throws Exception{
new NonFacesRequest("/login.xhtml"){
protected void renderResponse() throws Exception {
setValue("#{credentials.username}", "1");
setValue("#{credentials.password}", "1");
assert (Boolean)getValue("#{authenticator.authenticate()}");
}
}.run();
}
}
参照地址:http://wan-2004.iteye.com/blog/309863