[testng] 121/160: Rework after review

Eugene Zhukov eugene-guest at moszumanska.debian.org
Tue Aug 18 10:22:29 UTC 2015


This is an automated email from the git hooks/post-receive script.

eugene-guest pushed a commit to annotated tag testng-6.9.5
in repository testng.

commit 34a4ef79fc14059d843702198544237afa966854
Author: Julien Herr <julien.herr at alcatel-lucent.com>
Date:   Thu Jun 25 22:33:24 2015 +0200

    Rework after review
---
 src/test/java/test/assertion/SoftAssertTest.java | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/src/test/java/test/assertion/SoftAssertTest.java b/src/test/java/test/assertion/SoftAssertTest.java
index 898a334..66e850c 100644
--- a/src/test/java/test/assertion/SoftAssertTest.java
+++ b/src/test/java/test/assertion/SoftAssertTest.java
@@ -9,32 +9,26 @@ import java.util.ArrayList;
 import java.util.Collection;
 
 public class SoftAssertTest {
+
   @Test
-  public void testOnSucceedCalled() throws Exception {
-    final Collection<IAssert> succeed = new ArrayList<IAssert>();
+  public void testOnSucceedAndFailureCalled() throws Exception {
+    final Collection<IAssert> succeed = new ArrayList<>();
+    final Collection<IAssert> failures = new ArrayList<>();
     final SoftAssert sa = new SoftAssert() {
       @Override
       public void onAssertSuccess(IAssert assertCommand) {
         succeed.add(assertCommand);
       }
-    };
-    sa.assertTrue(true);
-    sa.assertTrue(false);
-    Assert.assertEquals(succeed.size(), 1, succeed.toString());
-  }
 
-  @Test
-  public void testOnFailureCalled() throws Exception {
-    final Collection<IAssert> failured = new ArrayList<IAssert>();
-    final SoftAssert sa = new SoftAssert() {
       @Override
       public void onAssertFailure(IAssert assertCommand, AssertionError ex) {
-        failured.add(assertCommand);
+        failures.add(assertCommand);
       }
     };
     sa.assertTrue(true);
     sa.assertTrue(false);
-    Assert.assertEquals(failured.size(), 1, failured.toString());
+    Assert.assertEquals(succeed.size(), 1, succeed.toString());
+    Assert.assertEquals(failures.size(), 1, failures.toString());
   }
 
   @Test

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/testng.git



More information about the pkg-java-commits mailing list