added find bugs and fixed some bugs

Former-commit-id: 4448947c0e718bdef87d241008043e76c001feea
This commit is contained in:
Jeremy Long
2012-12-22 06:15:39 -05:00
parent 5ec9a24c99
commit 3bf638f7c6
15 changed files with 133 additions and 77 deletions

View File

@@ -46,8 +46,9 @@ public class IndexIntegrationTest extends BaseIndexTestCase {
@Test
public void testUpdate() throws Exception {
System.out.println("update");
Index instance = new Index();
instance.update();
//deprecated
//Index instance = new Index();
//instance.update();
}
/**
@@ -56,8 +57,9 @@ public class IndexIntegrationTest extends BaseIndexTestCase {
@Test
public void testUpdateNeeded() throws Exception {
System.out.println("updateNeeded");
Index instance = new Index();
instance.updateNeeded();
//deprecated
//Index instance = new Index();
//instance.updateNeeded();
//if an exception is thrown this test fails. However, because it depends on the
// order of the tests what this will return I am just testing for the exception.
//assertTrue(expResult < result);

View File

@@ -5,7 +5,7 @@
package org.codesecure.dependencycheck.utils;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import junit.framework.TestCase;
import org.junit.Test;
@@ -66,7 +66,7 @@ public class ChecksumTest extends TestCase {
boolean exceptionThrown = false;
try {
byte[] result = Checksum.getChecksum(algorithm, file);
} catch (FileNotFoundException ex) {
} catch (IOException ex) {
exceptionThrown = true;
}
assertTrue(exceptionThrown);