Make JGit test work with both hamcrest 1.1 (juno) and 1.3 (kepler)
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>
This commit is contained in:
parent
79a2e28a93
commit
b83c269369
|
@ -44,7 +44,7 @@
|
||||||
package org.eclipse.jgit.api;
|
package org.eclipse.jgit.api;
|
||||||
|
|
||||||
import static org.hamcrest.MatcherAssert.assertThat;
|
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.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
|
@ -43,8 +43,8 @@
|
||||||
package org.eclipse.jgit.api;
|
package org.eclipse.jgit.api;
|
||||||
|
|
||||||
import static org.hamcrest.MatcherAssert.assertThat;
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.CoreMatchers.equalTo;
|
||||||
import static org.hamcrest.Matchers.not;
|
import static org.hamcrest.CoreMatchers.not;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
|
@ -37,8 +37,7 @@
|
||||||
*/
|
*/
|
||||||
package org.eclipse.jgit.lib;
|
package org.eclipse.jgit.lib;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.startsWith;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -399,7 +398,7 @@ private void testMaliciousPath(boolean good, boolean secondCheckout,
|
||||||
} catch (InvalidPathException e) {
|
} catch (InvalidPathException e) {
|
||||||
if (good)
|
if (good)
|
||||||
throw e;
|
throw e;
|
||||||
assertThat(e.getMessage(), startsWith("Invalid path: "));
|
assertTrue(e.getMessage().startsWith("Invalid path: "));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,6 @@
|
||||||
|
|
||||||
package org.eclipse.jgit.util;
|
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.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
@ -332,7 +330,7 @@ public void testDeleteNotEmptyTreeNotOk() throws IOException {
|
||||||
FileUtils.delete(t, FileUtils.EMPTY_DIRECTORIES_ONLY | FileUtils.RECURSIVE);
|
FileUtils.delete(t, FileUtils.EMPTY_DIRECTORIES_ONLY | FileUtils.RECURSIVE);
|
||||||
fail("expected failure to delete f");
|
fail("expected failure to delete f");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
assertThat(e.getMessage(), endsWith(f.getAbsolutePath()));
|
assertTrue(e.getMessage().endsWith(f.getAbsolutePath()));
|
||||||
}
|
}
|
||||||
assertTrue(t.exists());
|
assertTrue(t.exists());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue