Runtime exception when performing functional tests

public class MyTest extends FunctionalTest { @Test public void gtest() { Http.Response response = GET("http://google.com"); // <--- RuntimeException assertIsOk(response); assertContentType("text/html", response); assertCharset("utf-8", response); } } 

This code throw:

 java.lang.RuntimeException: java.util.concurrent.ExecutionException: play.exceptions.UnexpectedException: Unexpected Error at play.test.FunctionalTest.makeRequest(FunctionalTest.java:299) at play.test.FunctionalTest.makeRequest(FunctionalTest.java:305) at play.test.FunctionalTest.GET(FunctionalTest.java:103) at play.test.FunctionalTest.GET(FunctionalTest.java:57) at MyTest.gtest(MyTest.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 

Can I say why this error occurs? And how to fix it? Playframework 1.2.4 / Java 1.7.0_02.

+4
source share
1 answer

You probably just need to increase the size of the execution pool, which defaults to 1 in dev mode (which also means test , by default). You have run out of threads, and so an exception is thrown.

Try with a setting similar to this in application.conf :

 %test.play.pool=2 
0
source

Source: https://habr.com/ru/post/1392607/


All Articles