playframework/playframework — pull request #830 by huntc (2013-10-20 22:48:15+00:00)
Title: integration tests does not work outside of play console

The stock integration test does not work inside Eclipse.

Steps to reproduce:

1. Create new play project:
$ play new reportplay
$ cd reportplay

2. Create eclipse project
$ play "eclipse with-source=true"

3. Run the tests iside eclipse:
Import the created eclipse project, select IntegrationTest.java / Right Click / Run As / JUnit test

Expected results: the tests are passing.
Actual results: the TESTS ARE NOT PASSSING but the stack trace below is displayed:

```
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.(Ljava/lang/String;ILorg/apache/http/conn/scheme/SchemeSocketFactory;)V
at play.test.Helpers.running(Helpers.java:426)
at IntegrationTest.test(IntegrationTest.java:20)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.(Ljava/lang/String;ILorg/apache/http/conn/scheme/SchemeSocketFactory;)V
at play.test.Helpers.testBrowser(Helpers.java:467)
at play.test.Helpers.testBrowser(Helpers.java:455)
at play.test.Helpers.running(Helpers.java:423)
... 24 more
Caused by: java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.(Ljava/lang/String;ILorg/apache/http/conn/scheme/SchemeSocketFactory;)V
at com.gargoylesoftware.htmlunit.HttpWebConnection.createHttpClient(HttpWebConnection.java:504)
at com.gargoylesoftware.htmlunit.HttpWebConnection.getHttpClient(HttpWebConnection.java:470)
at com.gargoylesoftware.htmlunit.HttpWebConnection.setUseInsecureSSL(HttpWebConnection.java:659)
at com.gargoylesoftware.htmlunit.WebClient.setUseInsecureSSL(WebClient.java:1085)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.createWebClient(HtmlUnitDriver.java:263)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.(HtmlUnitDriver.java:129)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.(HtmlUnitDriver.java:172)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.(HtmlUnitDriver.java:168)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at play.api.test.WebDriverFactory$.apply(Selenium.scala:95)
at play.api.test.WebDriverFactory.apply(Selenium.scala)
at play.test.TestBrowser.(TestBrowser.java:24)
at play.test.Helpers.testBrowser(Helpers.java:463)
... 26 more
```

This actual error seem to be due to some missing library. In case of my project, the TestServer fails to serve static files, due that the static files are not in the classpath.

Play version: 2.1
Eclipse Version: 4.2.1
@gissues:{"order":74.35897435897431,"status":"backlog"}