How to set JVM parameters for Junit Unit Tests?

前端 未结 8 722
青春惊慌失措
青春惊慌失措 2020-11-28 03:47

I have some Junit unit tests that require a large amount of heap-space to run - i.e. 1G. (They test memory-intensive functionality for a webstart app that will only run with

8条回答
  •  离开以前
    2020-11-28 04:05

    If you set it in Java code, you can set it like this

          static {
            System.getProperties().setProperty("env", "test");
            System.getProperties().setProperty("spring.application.name", "spring-example");
        }
    

    reference:

    https://stackoverflow.com/a/60654275/4712855

    https://stackoverflow.com/a/10774432/4712855

提交回复
热议问题