Browse Source

Suppress "The allocated object is never used" warning in tests

Change-Id: Ibb405e0b36ce5a2cb30268a7de31ab2bd079ad80
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
stable-4.2
David Pursehouse 9 years ago committed by Matthias Sohn
parent
commit
75e096c80a
  1. 3
      org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheEntryTest.java
  2. 3
      org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileRepositoryBuilderTest.java
  3. 1
      org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java
  4. 2
      org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java
  5. 2
      org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SideBandOutputStreamTest.java
  6. 2
      org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java

3
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheEntryTest.java vendored

@ -69,6 +69,7 @@ public class DirCacheEntryTest {
assertFalse(isValidPath("a\u0000b")); assertFalse(isValidPath("a\u0000b"));
} }
@SuppressWarnings("unused")
private static boolean isValidPath(String path) { private static boolean isValidPath(String path) {
try { try {
new DirCacheEntry(path); new DirCacheEntry(path);
@ -78,6 +79,7 @@ public class DirCacheEntryTest {
} }
} }
@SuppressWarnings("unused")
@Test @Test
public void testCreate_ByStringPath() { public void testCreate_ByStringPath() {
assertEquals("a", new DirCacheEntry("a").getPathString()); assertEquals("a", new DirCacheEntry("a").getPathString());
@ -91,6 +93,7 @@ public class DirCacheEntryTest {
} }
} }
@SuppressWarnings("unused")
@Test @Test
public void testCreate_ByStringPathAndStage() { public void testCreate_ByStringPathAndStage() {
DirCacheEntry e; DirCacheEntry e;

3
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileRepositoryBuilderTest.java

@ -72,6 +72,7 @@ public class FileRepositoryBuilderTest extends LocalDiskRepositoryTestCase {
.findGitDir(d).getGitDir()); .findGitDir(d).getGitDir());
} }
@SuppressWarnings("unused")
@Test @Test
public void emptyRepositoryFormatVersion() throws Exception { public void emptyRepositoryFormatVersion() throws Exception {
Repository r = createWorkRepository(); Repository r = createWorkRepository();
@ -83,6 +84,7 @@ public class FileRepositoryBuilderTest extends LocalDiskRepositoryTestCase {
new FileRepository(r.getDirectory()); new FileRepository(r.getDirectory());
} }
@SuppressWarnings("unused")
@Test @Test
public void invalidRepositoryFormatVersion() throws Exception { public void invalidRepositoryFormatVersion() throws Exception {
Repository r = createWorkRepository(); Repository r = createWorkRepository();
@ -99,6 +101,7 @@ public class FileRepositoryBuilderTest extends LocalDiskRepositoryTestCase {
} }
} }
@SuppressWarnings("unused")
@Test @Test
public void unknownRepositoryFormatVersion() throws Exception { public void unknownRepositoryFormatVersion() throws Exception {
Repository r = createWorkRepository(); Repository r = createWorkRepository();

1
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java

@ -364,6 +364,7 @@ public class T0003_BasicTest extends SampleDataRepositoryTestCase {
assertNotSame(db.getConfig(), db2.getConfig()); assertNotSame(db.getConfig(), db2.getConfig());
} }
@SuppressWarnings("unused")
@Test @Test
public void test008_FailOnWrongVersion() throws IOException { public void test008_FailOnWrongVersion() throws IOException {
final File cfg = new File(db.getDirectory(), Constants.CONFIG); final File cfg = new File(db.getDirectory(), Constants.CONFIG);

2
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java

@ -75,11 +75,13 @@ public class T0001_PersonIdentTest {
p.toExternalString()); p.toExternalString());
} }
@SuppressWarnings("unused")
@Test(expected = IllegalArgumentException.class) @Test(expected = IllegalArgumentException.class)
public void nullForNameShouldThrowIllegalArgumentException() { public void nullForNameShouldThrowIllegalArgumentException() {
new PersonIdent(null, "author@example.com"); new PersonIdent(null, "author@example.com");
} }
@SuppressWarnings("unused")
@Test(expected = IllegalArgumentException.class) @Test(expected = IllegalArgumentException.class)
public void nullForEmailShouldThrowIllegalArgumentException() { public void nullForEmailShouldThrowIllegalArgumentException() {
new PersonIdent("A U Thor", null); new PersonIdent("A U Thor", null);

2
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SideBandOutputStreamTest.java

@ -195,6 +195,7 @@ public class SideBandOutputStreamTest {
assertEquals(1, flushCnt[0]); assertEquals(1, flushCnt[0]);
} }
@SuppressWarnings("unused")
@Test @Test
public void testConstructor_RejectsBadChannel() { public void testConstructor_RejectsBadChannel() {
try { try {
@ -220,6 +221,7 @@ public class SideBandOutputStreamTest {
} }
} }
@SuppressWarnings("unused")
@Test @Test
public void testConstructor_RejectsBadBufferSize() { public void testConstructor_RejectsBadBufferSize() {
try { try {

2
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java

@ -64,6 +64,7 @@ public class URIishTest {
private static final String GIT_SCHEME = "git://"; private static final String GIT_SCHEME = "git://";
@SuppressWarnings("unused")
@Test @Test
public void shouldRaiseErrorOnEmptyURI() throws Exception { public void shouldRaiseErrorOnEmptyURI() throws Exception {
try { try {
@ -74,6 +75,7 @@ public class URIishTest {
} }
} }
@SuppressWarnings("unused")
@Test @Test
public void shouldRaiseErrorOnNullURI() throws Exception { public void shouldRaiseErrorOnNullURI() throws Exception {
try { try {

Loading…
Cancel
Save