aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2016-01-20 09:32:19 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2016-01-20 09:45:48 +0900
commitaca07fac464834611bab83b91e828308838f361c (patch)
treed2075304ea161f9a02e4f874b67ca7db8501499c /org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java
parent2ccea7f05a0f3e783f6a8fa3f07cc5f1001bc950 (diff)
parent4b93de43bafd419b973ebf242e4ca1dd3b3b87d1 (diff)
downloadjgit-aca07fac464834611bab83b91e828308838f361c.tar.gz
jgit-aca07fac464834611bab83b91e828308838f361c.zip
Merge branch 'stable-4.2'
* stable-4.2: CheckoutCommandTest: Create Git instances in try-with-resource BranchCommandTest: Create Git instances in try-with-resource CheckoutTest: Create Git instances in try-with-resource BranchTest: Create Git instances in try-with-resource URIishTest: Use @Test annotation's `expected` argument Suppress "The allocated object is never used" warning in tests Add $NON-NLS to suppress "Non-externalized string literal" warnings Don't use deprecated constructors of CmdLineException Prepare 4.2.0-SNAPSHOT builds Remove org.eclipse.jgit.updatesite project from tools/version.sh RevParse: Remove superfluous semicolon RefUpdateTest: Use try-with-resource for auto-closable types RefUpdateTest: Add null check to prevent potential NPE CommitCommand: Remove redundant null check JGit v4.2.0.201512141825-rc1 Change-Id: I2179859289b2f2e3d0b7c6d02ef7e7890c467f7b Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java48
1 files changed, 12 insertions, 36 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java
index 5e4ba35079..e55d373347 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java
@@ -51,7 +51,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
import java.io.File;
import java.io.IOException;
@@ -64,24 +63,16 @@ public class URIishTest {
private static final String GIT_SCHEME = "git://";
- @Test
+ @SuppressWarnings("unused")
+ @Test(expected = URISyntaxException.class)
public void shouldRaiseErrorOnEmptyURI() throws Exception {
- try {
- new URIish("");
- fail("expecting an exception");
- } catch (URISyntaxException e) {
- // expected
- }
+ new URIish("");
}
- @Test
+ @SuppressWarnings("unused")
+ @Test(expected = URISyntaxException.class)
public void shouldRaiseErrorOnNullURI() throws Exception {
- try {
- new URIish((String) null);
- fail("expecting an exception");
- } catch (URISyntaxException e) {
- // expected
- }
+ new URIish((String) null);
}
@Test
@@ -634,34 +625,19 @@ public class URIishTest {
assertEquals(u, new URIish(str));
}
- @Test
+ @Test(expected = IllegalArgumentException.class)
public void testGetNullHumanishName() {
- try {
- new URIish().getHumanishName();
- fail("path must be not null");
- } catch (IllegalArgumentException e) {
- // expected
- }
+ new URIish().getHumanishName();
}
- @Test
+ @Test(expected = IllegalArgumentException.class)
public void testGetEmptyHumanishName() throws URISyntaxException {
- try {
- new URIish(GIT_SCHEME).getHumanishName();
- fail("empty path is useless");
- } catch (IllegalArgumentException e) {
- // expected
- }
+ new URIish(GIT_SCHEME).getHumanishName();
}
- @Test
+ @Test(expected = IllegalArgumentException.class)
public void testGetAbsEmptyHumanishName() {
- try {
- new URIish().getHumanishName();
- fail("empty path is useless");
- } catch (IllegalArgumentException e) {
- // expected
- }
+ new URIish().getHumanishName();
}
@Test