Package application

Source Code of application.SomeTests

package application;

import org.junit.Test;
import yalp.test.FunctionalTest;
import yalp.mvc.Http.Response;

public class SomeTests extends FunctionalTest {

  @Test
  public void fakeTest() {
    assertEquals(2, 1 + 1); // A really important thing to test
  }

  @Test
  public void indexTest() {
    // make a request on the application (embedded)
    Response response = GET("/");
    // check the HTTP response status is OK
    assertStatus(200, response);
    // check the response is HTML
    assertContentType("text/html", response);
    // check the declared charset encoding
    assertCharset(yalp.Yalp.defaultWebEncoding, response);
    // check some content in the page. may also test a regexp
    assertContentMatch("<h1>Validation samples</h1>", response);
  }
}
TOP

Related Classes of application.SomeTests

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.