I got a failure when I ran the tests for the server the first time. I ran it a second time and it worked without failure. I was able to reproduce the error by doing gradle clean
and then running the specs.
$ gradle test --info
Starting Build
Settings evaluated using settings file '/Users/sandropadin/code/j8th/jhttpsrv/settings.gradle'.
Projects loaded. Root project using build file '/Users/sandropadin/code/j8th/jhttpsrv/build.gradle'.
Included projects: [root project 'jhttpsrv']
Evaluating root project 'jhttpsrv' using build file '/Users/sandropadin/code/j8th/jhttpsrv/build.gradle'.
All projects evaluated.
Selected primary task 'test' from project :
Tasks to be executed: [task ':compileJava', task ':processResources', task ':classes', task ':compileTestJava', task ':processTestResources', task ':testClasses', task ':test']
:compileJava (Thread[main,5,main]) started.
:compileJava
Executing task ':compileJava' (up-to-date check took 0.085 secs) due to:
Input file /Users/sandropadin/code/j8th/jhttpsrv/src/main/java/com/eighthlight/jhttpsrv/handler/FileRequestHandler.java has changed.
Input file /Users/sandropadin/code/j8th/jhttpsrv/src/main/java/com/eighthlight/jhttpsrv/handler/TimeRequestHandler.java has changed.
Input file /Users/sandropadin/code/j8th/jhttpsrv/src/main/java/com/eighthlight/jhttpsrv/response/ResponseBody.java has changed.
Compiling with JDK Java compiler API.
:compileJava (Thread[main,5,main]) completed. Took 0.955 secs.
:processResources (Thread[main,5,main]) started.
:processResources
Skipping task ':processResources' as it has no source files.
:processResources UP-TO-DATE
:processResources (Thread[main,5,main]) completed. Took 0.002 secs.
:classes (Thread[main,5,main]) started.
:classes
Skipping task ':classes' as it has no actions.
:classes (Thread[main,5,main]) completed. Took 0.001 secs.
:compileTestJava (Thread[main,5,main]) started.
:compileTestJava
Download https://repo1.maven.org/maven2/org/mockito/mockito-core/1.10.19/mockito-core-1.10.19.pom
Found locally available resource with matching checksum: [https://jcenter.bintray.com/org/mockito/mockito-core/1.10.19/mockito-core-1.10.19.pom, /Users/sandropadin/.gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/1.10.19/228d760941af5e4c6e772d8761794aefe555da22/mockito-core-1.10.19.pom]
Download https://repo1.maven.org/maven2/org/mockito/mockito-core/1.10.19/mockito-core-1.10.19.jar
Executing task ':compileTestJava' (up-to-date check took 2.045 secs) due to:
Input file /Users/sandropadin/code/j8th/jhttpsrv/src/test/java/com/eighthlight/jhttpsrv/testmessage/chrome/TestRequestMaker.java has changed.
Input file /Users/sandropadin/code/j8th/jhttpsrv/build/classes/main/com/eighthlight/jhttpsrv/constants/StatusCodes.class has been added.
Input file /Users/sandropadin/code/j8th/jhttpsrv/src/test/java/com/eighthlight/jhttpsrv/router/RouterTest.java has changed.
Compiling with JDK Java compiler API.
Note: /Users/sandropadin/code/j8th/jhttpsrv/src/test/java/com/eighthlight/jhttpsrv/request/RequestHeaderTest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:compileTestJava (Thread[main,5,main]) completed. Took 2.309 secs.
:processTestResources (Thread[main,5,main]) started.
:processTestResources
Skipping task ':processTestResources' as it has no source files.
:processTestResources UP-TO-DATE
:processTestResources (Thread[main,5,main]) completed. Took 0.001 secs.
:testClasses (Thread[main,5,main]) started.
:testClasses
Skipping task ':testClasses' as it has no actions.
:testClasses (Thread[main,5,main]) completed. Took 0.001 secs.
:test (Thread[main,5,main]) started.
:test
Executing task ':test' (up-to-date check took 0.067 secs) due to:
Value of input property 'candidateClassFiles' has changed for task ':test'
Starting process 'Gradle Test Executor 1'. Working directory: /Users/sandropadin/code/j8th/jhttpsrv Command: /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/bin/java -Djava.security.manager=jarjar.org.gradle.process.internal.child.BootstrapSecurityManager -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea -cp /Users/sandropadin/.gradle/caches/2.2.1/workerMain/gradle-worker.jar jarjar.org.gradle.process.internal.launcher.GradleWorkerMain 'Gradle Test Executor 1'
Successfully started process 'Gradle Test Executor 1'
Gradle Test Executor 1 started executing tests.
com.eighthlight.jhttpsrv.server.JhttpsrvTest > testRun STANDARD_ERROR
Exception in thread "Thread-4" java.lang.NullPointerException
com.eighthlight.jhttpsrv.util.StringUtilsTest STANDARD_ERROR
at com.eighthlight.jhttpsrv.worker.Worker.run(Worker.java:30)
at com.eighthlight.jhttpsrv.server.Jhttpsrv.run(Jhttpsrv.java:34)
at java.lang.Thread.run(Thread.java:745)
Gradle Test Executor 1 finished executing tests.
Finished generating test XML results (0.01 secs) into: /Users/sandropadin/code/j8th/jhttpsrv/build/test-results
Generating HTML test report...
Finished generating test html results (0.058 secs) into: /Users/sandropadin/code/j8th/jhttpsrv/build/reports/tests
:test (Thread[main,5,main]) completed. Took 3.219 secs.
BUILD SUCCESSFUL
Total time: 9.28 secs
Stopped 0 compiler daemon(s).