Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Functional Testing For Java

I want to write some functional tests for a java servlet and I want to make sure it works with all the filters and other random java web stuff that might interfere with the servlet. Is there a nice way to do this in java?

I noticed the play framework has a really nice way of doing functional tests.

import play.test.*;
import play.mvc.*;
import play.mvc.Http.*;
import org.junit.*;

public class ApplicationTest extends FunctionalTest {

    @Test
    public void testTheHomePage() {
        Response response = GET("/");
        assertStatus(200, response);
    }

}

http://www.playframework.org/documentation/1.0/test

Something like that would be great but I guess I'm getting my hopes up. :)

like image 976
benmmurphy Avatar asked Jan 17 '26 00:01

benmmurphy


1 Answers

Selenium is one option. It has the ability to export the tests to JUnit 3 or 4.

like image 59
jefflunt Avatar answered Jan 19 '26 13:01

jefflunt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!