ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject [05/12] git commit: contains instead of indexof
Date Thu, 28 Aug 2014 07:04:46 GMT
contains instead of indexof


Project: http://git-wip-us.apache.org/repos/asf/ant-easyant-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-easyant-core/commit/118a6be9
Tree: http://git-wip-us.apache.org/repos/asf/ant-easyant-core/tree/118a6be9
Diff: http://git-wip-us.apache.org/repos/asf/ant-easyant-core/diff/118a6be9

Branch: refs/heads/master
Commit: 118a6be95653188f11fb460d050002bd2340822b
Parents: b343823
Author: Jean-Louis Boudart <jeanlouis.boudart@gmail.com>
Authored: Thu Aug 28 08:51:28 2014 +0200
Committer: Jean-Louis Boudart <jeanlouis.boudart@gmail.com>
Committed: Thu Aug 28 08:51:28 2014 +0200

----------------------------------------------------------------------
 .../java/org/apache/easyant/core/EasyAntBaseTest.java   | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-easyant-core/blob/118a6be9/src/test/java/org/apache/easyant/core/EasyAntBaseTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/easyant/core/EasyAntBaseTest.java b/src/test/java/org/apache/easyant/core/EasyAntBaseTest.java
index 3e1495a..d4587be 100755
--- a/src/test/java/org/apache/easyant/core/EasyAntBaseTest.java
+++ b/src/test/java/org/apache/easyant/core/EasyAntBaseTest.java
@@ -127,7 +127,7 @@ public abstract class EasyAntBaseTest {
     public void assertLogContaining(String substring) {
         String realLog = getLog();
         assertTrue("expecting log to contain \"" + substring + "\" log was \"" + realLog
+ "\"",
-                realLog.indexOf(substring) >= 0);
+                realLog.contains(substring));
     }
 
     /**
@@ -136,7 +136,7 @@ public abstract class EasyAntBaseTest {
     public void assertLogNotContaining(String substring) {
         String realLog = getLog();
         assertFalse("didn't expect log to contain \"" + substring + "\" log was \"" + realLog
+ "\"",
-                realLog.indexOf(substring) >= 0);
+                realLog.contains(substring));
     }
 
     /**
@@ -159,7 +159,7 @@ public abstract class EasyAntBaseTest {
         String realOutput = getOutput();
         String realMessage = (message != null) ? message : "expecting output to contain \""
+ substring
                 + "\" output was \"" + realOutput + "\"";
-        assertTrue(realMessage, realOutput.indexOf(substring) >= 0);
+        assertTrue(realMessage, realOutput.contains(substring));
     }
 
     /**
@@ -173,7 +173,7 @@ public abstract class EasyAntBaseTest {
         String realOutput = getOutput();
         String realMessage = (message != null) ? message : "expecting output to not contain
\"" + substring
                 + "\" output was \"" + realOutput + "\"";
-        assertFalse(realMessage, realOutput.indexOf(substring) >= 0);
+        assertFalse(realMessage, realOutput.contains(substring));
     }
 
     /**
@@ -217,7 +217,7 @@ public abstract class EasyAntBaseTest {
     public void assertDebuglogContaining(String substring) {
         String realLog = getFullLog();
         assertTrue("expecting debug log to contain \"" + substring + "\" log was \"" + realLog
+ "\"",
-                realLog.indexOf(substring) >= 0);
+                realLog.contains(substring));
     }
 
     /**
@@ -501,7 +501,7 @@ public abstract class EasyAntBaseTest {
             executeTarget(target);
         } catch (org.apache.tools.ant.BuildException ex) {
             buildException = ex;
-            if ((null != contains) && (ex.getMessage().indexOf(contains) == -1))
{
+            if ((null != contains) && (!ex.getMessage().contains(contains))) {
                 fail("Should throw BuildException because '" + cause + "' with message containing
'" + contains
                         + "' (actual message '" + ex.getMessage() + "' instead)");
             }


Mime
View raw message