"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "documentation/src/test/java/example/SharedResourcesDemo.java" between
junit5-r5.3.2.tar.gz and junit5-r5.4.0.tar.gz

About: JUnit 5 is a unit testing framework for the Java programming language.

SharedResourcesDemo.java  (junit5-r5.3.2):SharedResourcesDemo.java  (junit5-r5.4.0)
/* /*
* Copyright 2015-2018 the original author or authors. * Copyright 2015-2019 the original author or authors.
* *
* All rights reserved. This program and the accompanying materials are * All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which * made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at * accompanies this distribution and is available at
* *
* http://www.eclipse.org/legal/epl-v20.html * http://www.eclipse.org/legal/epl-v20.html
*/ */
package example; package example;
skipping to change at line 53 skipping to change at line 53
} }
@Test @Test
@ResourceLock(value = SYSTEM_PROPERTIES, mode = READ) @ResourceLock(value = SYSTEM_PROPERTIES, mode = READ)
void customPropertyIsNotSetByDefault() { void customPropertyIsNotSetByDefault() {
assertNull(System.getProperty("my.prop")); assertNull(System.getProperty("my.prop"));
} }
@Test @Test
@ResourceLock(value = SYSTEM_PROPERTIES, mode = READ_WRITE) @ResourceLock(value = SYSTEM_PROPERTIES, mode = READ_WRITE)
void canSetCustomPropertyToFoo() { void canSetCustomPropertyToApple() {
System.setProperty("my.prop", "foo"); System.setProperty("my.prop", "apple");
assertEquals("foo", System.getProperty("my.prop")); assertEquals("apple", System.getProperty("my.prop"));
} }
@Test @Test
@ResourceLock(value = SYSTEM_PROPERTIES, mode = READ_WRITE) @ResourceLock(value = SYSTEM_PROPERTIES, mode = READ_WRITE)
void canSetCustomPropertyToBar() { void canSetCustomPropertyToBanana() {
System.setProperty("my.prop", "bar"); System.setProperty("my.prop", "banana");
assertEquals("bar", System.getProperty("my.prop")); assertEquals("banana", System.getProperty("my.prop"));
} }
} }
// end::user_guide[] // end::user_guide[]
 End of changes. 4 change blocks. 
7 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)