I'm working on a fairly small project (in terms of dependencies), and whenever I run a unit test it takes 8 seconds for the JVM to load, before running the actual test in 0.2s.
My environment:
- Java 8
- Spring Tool Suite 3.8.1.RELEASE
- JUnit 4
- Windows 8
I fear there must be something in my environment that's causing this to take so long, and I'm hoping someone has seen this before and found the source of the problem and perhaps a solution?
E.g. if my PATH
environment variable is really long, would that matter at all?
What exactly happens when I run a JUnit test?
The actual test I'm trying to run is:
public class TemplateLocationCalculatorTest {
private TemplateLocationCalculator target = new TemplateLocationCalculator();
@Test
public void whenGivenRootReturnIndex(){
Assert.assertEquals("index", target.calculate("/"));
}
}
And the target class is this:
public class TemplateLocationCalculator {
public String calculate(String string) {
return "index";
}
}
I hope you'll agree with me when I say this shouldn't take long to load.