|
12 | 12 |
|
13 | 13 | import static org.hamcrest.MatcherAssert.assertThat; |
14 | 14 | import static org.junit.Assert.assertEquals; |
| 15 | +import static org.junit.Assert.assertFalse; |
15 | 16 | import static org.junit.Assert.assertNotNull; |
16 | 17 | import static org.junit.Assert.assertTrue; |
17 | 18 | import static org.junit.Assume.assumeTrue; |
@@ -150,7 +151,8 @@ public void test_configuration_must_be_updated_with_surefire_config() |
150 | 151 |
|
151 | 152 | // check argLine |
152 | 153 | String argLine = config.getAttribute(UnitTestSupport.LAUNCH_CONFIG_VM_ARGUMENTS, ""); |
153 | | - assertTrue(argLine.contains("--argLineItem=surefireArgLineValue")); |
| 154 | + assertThat(argLine, Matchers.containsString("--argLineItem=surefireArgLineValue --undefinedArgLineItem=")); |
| 155 | + assertThat(argLine, Matchers.not(Matchers.containsString("${undefinedProperty}"))); |
154 | 156 |
|
155 | 157 | // check environmentVariables |
156 | 158 | Map<String, String> envVars = config.getAttribute(UnitTestSupport.LAUNCH_CONFIG_ENVIRONMENT_VARIABLES, |
@@ -209,7 +211,8 @@ public void test_configuration_must_be_updated_with_failsafe_config() |
209 | 211 |
|
210 | 212 | // check argLine |
211 | 213 | String argLine = config.getAttribute(UnitTestSupport.LAUNCH_CONFIG_VM_ARGUMENTS, ""); |
212 | | - assertTrue(argLine.contains("--argLineItem=failsafeArgLineValue")); |
| 214 | + assertThat(argLine, Matchers.containsString("--argLineItem=failsafeArgLineValue --undefinedArgLineItem=")); |
| 215 | + assertThat(argLine, Matchers.not(Matchers.containsString("${undefinedProperty}"))); |
213 | 216 |
|
214 | 217 | // check environmentVariables |
215 | 218 | Map<String, String> envVars = config.getAttribute(UnitTestSupport.LAUNCH_CONFIG_ENVIRONMENT_VARIABLES, |
@@ -261,7 +264,8 @@ public void test_configuration_must_be_updated_with_surefire_config_when_created |
261 | 264 |
|
262 | 265 | // check argLine |
263 | 266 | String argLine = config.getAttribute(UnitTestSupport.LAUNCH_CONFIG_VM_ARGUMENTS, ""); |
264 | | - assertTrue(argLine.contains("--argLineItem=surefireArgLineValue")); |
| 267 | + assertThat(argLine, Matchers.containsString("--argLineItem=surefireArgLineValue --undefinedArgLineItem=")); |
| 268 | + assertThat(argLine, Matchers.not(Matchers.containsString("${undefinedProperty}"))); |
265 | 269 |
|
266 | 270 | // check environmentVariables |
267 | 271 | Map<String, String> envVars = config.getAttribute(UnitTestSupport.LAUNCH_CONFIG_ENVIRONMENT_VARIABLES, |
@@ -310,7 +314,8 @@ public void test_configuration_must_be_updated_with_failSafe_config_when_created |
310 | 314 |
|
311 | 315 | // check argLine |
312 | 316 | String argLine = config.getAttribute(UnitTestSupport.LAUNCH_CONFIG_VM_ARGUMENTS, ""); |
313 | | - assertTrue(argLine.contains("--argLineItem=failsafeArgLineValue")); |
| 317 | + assertThat(argLine, Matchers.containsString("--argLineItem=failsafeArgLineValue --undefinedArgLineItem=")); |
| 318 | + assertThat(argLine, Matchers.not(Matchers.containsString("${undefinedProperty}"))); |
314 | 319 |
|
315 | 320 | // check environmentVariables |
316 | 321 | Map<String, String> envVars = config.getAttribute(UnitTestSupport.LAUNCH_CONFIG_ENVIRONMENT_VARIABLES, |
@@ -355,7 +360,7 @@ public void test_deferred_variable_are_resolved() throws CoreException, IOExcept |
355 | 360 | ILaunchConfiguration config = updatedConfigurations[0]; |
356 | 361 | String argLine = config.getAttribute(UnitTestSupport.LAUNCH_CONFIG_VM_ARGUMENTS, ""); |
357 | 362 | assertTrue(argLine.contains("-javaagent")); // resolved jacoco agent |
358 | | - assertTrue(argLine.contains("@{titi.tata}")); // unresolved property is unchanged as in CLI |
| 363 | + assertFalse(argLine.contains("@{titi.tata}")); // unresolved property is removed |
359 | 364 | } |
360 | 365 |
|
361 | 366 | private void updateProject(IProject project) throws CoreException, InterruptedException { |
|
0 commit comments