]> source.dussan.org Git - jgit.git/commitdiff
Make JGit test work with both hamcrest 1.1 (juno) and 1.3 (kepler) 61/13161/3
authorRobin Rosenberg <robin.rosenberg@dewire.com>
Sun, 26 May 2013 20:07:24 +0000 (22:07 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Sat, 8 Jun 2013 22:50:51 +0000 (00:50 +0200)
The hamcrest library has moved things around. This problem applies only
to the test, not plugin runtime.

Change-Id: I5b97f356d8595dbdc9e91d157558e40561a6a30d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CheckoutCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutMaliciousPathTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FileUtilTest.java

index fb98c2fb8993357e1ca91f51ea5634c50ab55df5..4087fb0ddab5db8cfcb7dbd843ac53384409fc11 100644 (file)
@@ -44,7 +44,7 @@
 package org.eclipse.jgit.api;
 
 import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
+import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
index 94577a0d6848a9400bf85cb0f1502c628be862e8..9aa13caf9440f78f218fa199a16bfd3f0d8177a4 100644 (file)
@@ -43,8 +43,8 @@
 package org.eclipse.jgit.api;
 
 import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.not;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.not;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
index d95eee2b26a9d61fb34a34ed8b668067ddc5db73..d263f629a5923a97358e6a6576481e56361ffe5e 100644 (file)
@@ -37,8 +37,7 @@
  */
 package org.eclipse.jgit.lib;
 
-import static org.hamcrest.Matchers.startsWith;
-import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.io.File;
@@ -399,7 +398,7 @@ public class DirCacheCheckoutMaliciousPathTest extends RepositoryTestCase {
                } catch (InvalidPathException e) {
                        if (good)
                                throw e;
-                       assertThat(e.getMessage(), startsWith("Invalid path: "));
+                       assertTrue(e.getMessage().startsWith("Invalid path: "));
                }
        }
 
index 5c2f77c3c39bccab877e6b009af42de30b3b5dc8..df39f2b9d80fd9e846cf59ebeab8515289e49751 100644 (file)
@@ -43,8 +43,6 @@
 
 package org.eclipse.jgit.util;
 
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.endsWith;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -332,7 +330,7 @@ public class FileUtilTest {
                        FileUtils.delete(t, FileUtils.EMPTY_DIRECTORIES_ONLY | FileUtils.RECURSIVE);
                        fail("expected failure to delete f");
                } catch (IOException e) {
-                       assertThat(e.getMessage(), endsWith(f.getAbsolutePath()));
+                       assertTrue(e.getMessage().endsWith(f.getAbsolutePath()));
                }
                assertTrue(t.exists());
        }