You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2019/05/05 22:59:45 UTC

[groovy] 02/04: minor refactor: rename test

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit a185f4be026dbb05acbc59de95fce7c4bb935c46
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sun May 5 14:19:29 2019 +1000

    minor refactor: rename test
---
 .../{MyTestJunit5.groovy => JUnit5Test.groovy}     | 42 +++++++++++-----------
 1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/subprojects/groovy-test-junit5/src/test/groovy/MyTestJunit5.groovy b/subprojects/groovy-test-junit5/src/test/groovy/JUnit5Test.groovy
similarity index 58%
rename from subprojects/groovy-test-junit5/src/test/groovy/MyTestJunit5.groovy
rename to subprojects/groovy-test-junit5/src/test/groovy/JUnit5Test.groovy
index 37bf440..cb358ed 100644
--- a/subprojects/groovy-test-junit5/src/test/groovy/MyTestJunit5.groovy
+++ b/subprojects/groovy-test-junit5/src/test/groovy/JUnit5Test.groovy
@@ -23,29 +23,31 @@ import org.junit.jupiter.params.provider.ValueSource
 import java.util.stream.Stream
 import static org.junit.jupiter.api.DynamicTest.dynamicTest
 
-class MyTestJUnit5 {
+class JUnit5Test {
 
-  @Test
-  void streamSum() {
-    assert Stream.of(1, 2, 3).mapToInt{ i -> i }.sum() > 5
-  }
+    @Test
+    void streamSum() {
+        assert Stream.of(1, 2, 3).mapToInt { i -> i }.sum() > 5
+    }
 
-  @RepeatedTest(value=2, name = "{displayName} {currentRepetition}/{totalRepetitions}")
-  void streamSumRepeated() {
-    assert Stream.of(1, 2, 3).mapToInt{ i -> i }.sum() == 6
-  }
+    @RepeatedTest(value = 2, name = "{displayName} {currentRepetition}/{totalRepetitions}")
+    void streamSumRepeated() {
+        assert Stream.of(1, 2, 3).mapToInt { i -> i }.sum() == 6
+    }
 
-  private boolean isPalindrome(s) { s == s.reverse()  }
+    private boolean isPalindrome(s) { s == s.reverse() }
 
-  @ParameterizedTest
-  @ValueSource(strings = [ "racecar", "radar", "able was I ere I saw elba" ])
-  void palindromes(String candidate) {
-    assert isPalindrome(candidate)
-  }
+    @ParameterizedTest
+    @ValueSource(strings = ["racecar", "radar", "able was I ere I saw elba"])
+    void palindromes(String candidate) {
+        assert isPalindrome(candidate)
+    }
 
-  @TestFactory
-  def dynamicTestCollection() {[
-    dynamicTest("Add test") { -> assert 1 + 1 == 2 },
-    dynamicTest("Multiply Test") { -> assert 2 * 3 == 6 }
-  ]}
+    @TestFactory
+    def dynamicTestCollection() {
+        [
+                dynamicTest("Add test") { -> assert 1 + 1 == 2 },
+                dynamicTest("Multiply Test") { -> assert 2 * 3 == 6 }
+        ]
+    }
 }