Setting line separator in JUnit template
Hello, I'm using the latest 2020.1 EAP on Windows 10. Java 8, update 241, 64-bit.
I want to modify the system property line.separator in the JUnit template. I added -Dline.separator="\n" to VM options (after -ea), but when I try to launch any test case, the test framework (Team City) does not even start properly.
Here is the output:
"C:\Program Files\Java\jdk1.8.0_241\bin\java.exe" -ea -Dline.separator=\n -Didea.test.cyclic.buffer.size=10240000 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 201.3803.71\lib\idea_rt.jar=52952:C:\Program Files\JetBrains\IntelliJ IDEA 201.3803.71\bin" -Dfile.encoding=UTF-8 -classpath <snip classpath> com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 mypackage.MyTest,testMe
##teamcity[enteredTheMatrix]\n##teamcity[suiteTreeNode name='MyTest.testMe' locationHint='java:test://mypackage.MyTest/testMe']\n##teamcity[treeEnded]\n##teamcity[rootName name = 'MyTest' comment = 'mypackage' location = 'java:suite://mypackage.MyTest']\n##teamcity[testStarted name='MyTest.testMe' locationHint='java:test://mypackage.MyTest/testMe']\n##teamcity[testFinished name='MyTest.testMe' duration='2']\n
Process finished with exit code 0
##teamcity[testSuiteFinished name='MyTest']\n
If I remove my modification to VM options, it works (but without the desired line separator change). I want the JVM to generate linux-style line breaks when executing under Windows.
What is the correct way to define the property value to achieve what I want?
Thanks!
Please sign in to leave a comment.
It is known issue with JUnit Run Configuration, please vote for https://youtrack.jetbrains.com/issue/IDEA-150394
Please see also https://stackoverflow.com/a/23643741/2000323 for other approaches to consider instead of setting this system property.