ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [2/4] ant git commit: [AA] bugzilla-Bug-60628-Ant-Get-Task-To-Accept-Arbitrary-Header : simplifying test
Date Thu, 09 Feb 2017 08:31:41 GMT
[AA]  bugzilla-Bug-60628-Ant-Get-Task-To-Accept-Arbitrary-Header : simplifying test


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/3d215101
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/3d215101
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/3d215101

Branch: refs/heads/master
Commit: 3d215101449f63be2c62baf49425a929d758168f
Parents: b83bdce
Author: Arcadius <arcadius@menelic.com>
Authored: Mon Jan 23 23:50:55 2017 +0000
Committer: Arcadius <arcadius@menelic.com>
Committed: Mon Jan 23 23:50:55 2017 +0000

----------------------------------------------------------------------
 src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/3d215101/src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java
index 52950c9..e18fdcd 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java
@@ -143,10 +143,9 @@ public class GetTest {
         String log = buildRule.getLog();
         AntAssert.assertContains("Adding header 'header1'", log);
 
-        String firstHeaderLogTrimmed = log.replaceFirst("Adding header ", "");
-        String allHeaderLogsTrimmed = log.replaceAll("Adding header ", "");
+        int actualHeaderCount = log.split("Adding header ").length - 1;
 
-        assertEquals("Only one header has been added", firstHeaderLogTrimmed, allHeaderLogsTrimmed);
+        assertEquals("Only one header has been added", 1, actualHeaderCount);
     }
 
     @Test


Mime
View raw message