mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-15 16:23:37 +01:00
location of data files is no longer the working directory, rather the location of the JAR file itself
Former-commit-id: 320077664c9c65f5b5f6dd7acb5c923da8869167
This commit is contained in:
@@ -40,35 +40,6 @@ public class IndexIntegrationTest extends BaseIndexTestCase {
|
||||
public void tearDown() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of open method, of class Index.
|
||||
*/
|
||||
@Test
|
||||
public void testOpen() {
|
||||
System.out.println("open");
|
||||
Index instance = new Index();
|
||||
try {
|
||||
instance.open();
|
||||
} catch (IOException ex) {
|
||||
fail(ex.getMessage());
|
||||
}
|
||||
instance.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getDirectory method, of class Index.
|
||||
*/
|
||||
@Test
|
||||
public void testGetDirectory() throws Exception {
|
||||
System.out.println("getDirectory");
|
||||
Index index = new Index();
|
||||
Directory result = index.getDirectory();
|
||||
|
||||
String exp = File.separatorChar + "target" + File.separatorChar + "data" + File.separatorChar + "cpe";
|
||||
// TODO review the generated test code and remove the default call to fail.
|
||||
assertTrue(result.toString().contains(exp));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of update method, of class Index.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.codesecure.dependencycheck.data.cpe;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import org.apache.lucene.store.Directory;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jeremy Long (jeremy.long@gmail.com)
|
||||
*/
|
||||
public class IndexTest extends BaseIndexTestCase {
|
||||
|
||||
public IndexTest(String testCase) {
|
||||
super(testCase);
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpClass() throws Exception {
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDownClass() throws Exception {
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of open method, of class Index.
|
||||
*/
|
||||
@Test
|
||||
public void testOpen() {
|
||||
System.out.println("open");
|
||||
Index instance = new Index();
|
||||
try {
|
||||
instance.open();
|
||||
} catch (IOException ex) {
|
||||
fail(ex.getMessage());
|
||||
}
|
||||
instance.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getDirectory method, of class Index.
|
||||
*/
|
||||
@Test
|
||||
public void testGetDirectory() throws Exception {
|
||||
System.out.println("getDirectory");
|
||||
Index index = new Index();
|
||||
Directory result = index.getDirectory();
|
||||
|
||||
String exp = File.separatorChar + "target" + File.separatorChar + "data" + File.separatorChar + "cpe";
|
||||
// TODO review the generated test code and remove the default call to fail.
|
||||
assertTrue(result.toString().contains(exp));
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import org.junit.*;
|
||||
* @author Jeremy
|
||||
*/
|
||||
public class IndexIntegrationTest extends BaseIndexTestCase {
|
||||
|
||||
|
||||
public IndexIntegrationTest(String testName) {
|
||||
super(testName);
|
||||
}
|
||||
@@ -28,11 +28,11 @@ public class IndexIntegrationTest extends BaseIndexTestCase {
|
||||
@AfterClass
|
||||
public static void tearDownClass() throws Exception {
|
||||
}
|
||||
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
}
|
||||
@@ -45,19 +45,7 @@ public class IndexIntegrationTest extends BaseIndexTestCase {
|
||||
System.out.println("retrieveCurrentTimestampFromWeb");
|
||||
Index instance = new Index();
|
||||
Map<String, Index.NvdCveUrl> result = instance.retrieveCurrentTimestampsFromWeb();
|
||||
assertEquals(12, result.size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getDirectory method, of class Index.
|
||||
*/
|
||||
@Test
|
||||
public void testGetDirectory() throws Exception {
|
||||
System.out.println("getDirectory");
|
||||
Index instance = new Index();
|
||||
String exp = File.separatorChar + "target" + File.separatorChar + "data" + File.separatorChar + "cve";
|
||||
Directory result = instance.getDirectory();
|
||||
assertTrue(result.toString().contains(exp));
|
||||
assertEquals(12, result.size());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,5 +69,4 @@ public class IndexIntegrationTest extends BaseIndexTestCase {
|
||||
//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.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.codesecure.dependencycheck.data.nvdcve;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
import org.apache.lucene.store.Directory;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import org.junit.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jeremy
|
||||
*/
|
||||
public class IndexTest extends BaseIndexTestCase {
|
||||
|
||||
public IndexTest(String testName) {
|
||||
super(testName);
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpClass() throws Exception {
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDownClass() throws Exception {
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getDirectory method, of class Index.
|
||||
*/
|
||||
@Test
|
||||
public void testGetDirectory() throws Exception {
|
||||
System.out.println("getDirectory");
|
||||
Index instance = new Index();
|
||||
String exp = File.separatorChar + "target" + File.separatorChar + "data" + File.separatorChar + "cve";
|
||||
Directory result = instance.getDirectory();
|
||||
assertTrue(result.toString().contains(exp));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user