renamed and moved classes

Former-commit-id: b0e9d931be4d61eb25178182e8602a0c0be4b6b9
This commit is contained in:
Jeremy Long
2014-01-04 08:47:25 -05:00
parent 133a18b70c
commit a4771090ed
11 changed files with 30 additions and 28 deletions

View File

@@ -27,7 +27,7 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import org.owasp.dependencycheck.data.UpdateException;
import org.owasp.dependencycheck.update.UpdateException;
import org.owasp.dependencycheck.utils.DownloadFailedException;
/**
@@ -120,7 +120,7 @@ public class StandardUpdateIntegrationTest {
@Test
public void testUpdatesNeeded() throws Exception {
StandardUpdate instance = getStandardUpdateTask();
Updateable result = instance.updatesNeeded();
UpdateableNvdCve result = instance.updatesNeeded();
assertNotNull(result);
}
}

View File

@@ -33,9 +33,9 @@ import org.owasp.dependencycheck.utils.DownloadFailedException;
*
* @author Jeremy Long (jeremy.long@owasp.org)
*/
public class UpdateableTest {
public class UpdateableNvdCveTest {
public UpdateableTest() {
public UpdateableNvdCveTest() {
}
@BeforeClass
@@ -55,7 +55,7 @@ public class UpdateableTest {
}
/**
* Test of isUpdateNeeded method, of class Updateable.
* Test of isUpdateNeeded method, of class UpdateableNvdCve.
*/
@Test
public void testIsUpdateNeeded() throws MalformedURLException, DownloadFailedException, IOException {
@@ -63,7 +63,7 @@ public class UpdateableTest {
//use a local file as this test will load the result and check the timestamp
File f = new File("target/test-classes/nvdcve-2.0-2012.xml");
String url = "file:///" + f.getCanonicalPath();
Updateable instance = new Updateable();
UpdateableNvdCve instance = new UpdateableNvdCve();
instance.add(id, url, url, false);
boolean expResult = false;
@@ -78,7 +78,7 @@ public class UpdateableTest {
}
/**
* Test of add method, of class Updateable.
* Test of add method, of class UpdateableNvdCve.
*/
@Test
public void testAdd_3args() throws Exception {
@@ -86,7 +86,7 @@ public class UpdateableTest {
File f = new File("target/test-classes/nvdcve-2.0-2012.xml");
//use a local file as this test will load the result and check the timestamp
String url = "file:///" + f.getCanonicalPath();
Updateable instance = new Updateable();
UpdateableNvdCve instance = new UpdateableNvdCve();
instance.add(id, url, url);
NvdCveInfo results = instance.get(id);
assertEquals(id, results.getId());
@@ -95,7 +95,7 @@ public class UpdateableTest {
}
/**
* Test of add method, of class Updateable.
* Test of add method, of class UpdateableNvdCve.
*/
@Test
public void testAdd_4args() throws Exception {
@@ -103,7 +103,7 @@ public class UpdateableTest {
//use a local file as this test will load the result and check the timestamp
File f = new File("target/test-classes/nvdcve-2.0-2012.xml");
String url = "file:///" + f.getCanonicalPath();
Updateable instance = new Updateable();
UpdateableNvdCve instance = new UpdateableNvdCve();
instance.add(id, url, url, false);
boolean expResult = false;
@@ -120,7 +120,7 @@ public class UpdateableTest {
}
/**
* Test of clear method, of class Updateable.
* Test of clear method, of class UpdateableNvdCve.
*/
@Test
public void testClear() throws MalformedURLException, DownloadFailedException, IOException {
@@ -128,7 +128,7 @@ public class UpdateableTest {
//use a local file as this test will load the result and check the timestamp
File f = new File("target/test-classes/nvdcve-2.0-2012.xml");
String url = "file:///" + f.getCanonicalPath();
Updateable instance = new Updateable();
UpdateableNvdCve instance = new UpdateableNvdCve();
instance.add(id, url, url, false);
assertFalse(instance.getCollection().isEmpty());
instance.clear();
@@ -136,14 +136,14 @@ public class UpdateableTest {
}
/**
* Test of iterator method, of class Updateable.
* Test of iterator method, of class UpdateableNvdCve.
*/
@Test
public void testIterator() throws IOException {
//use a local file as this test will load the result and check the timestamp
File f = new File("target/test-classes/nvdcve-2.0-2012.xml");
String url = "file:///" + f.getCanonicalPath();
Updateable instance = new Updateable();
UpdateableNvdCve instance = new UpdateableNvdCve();
instance.add("one", url, url, false);
instance.add("two", url, url, false);
instance.add("three", url, url, false);