mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-23 09:31:32 +01:00
Removed compiler warnings from test code.
This commit is contained in:
@@ -34,7 +34,7 @@ public class AbstractFileTypeAnalyzerTest extends BaseTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testNewHashSet() {
|
public void testNewHashSet() {
|
||||||
Set result = AbstractFileTypeAnalyzer.newHashSet("one", "two");
|
Set<String> result = AbstractFileTypeAnalyzer.newHashSet("one", "two");
|
||||||
assertEquals(2, result.size());
|
assertEquals(2, result.size());
|
||||||
assertTrue(result.contains("one"));
|
assertTrue(result.contains("one"));
|
||||||
assertTrue(result.contains("two"));
|
assertTrue(result.contains("two"));
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertTrue;
|
|||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.owasp.dependencycheck.dependency.Vulnerability;
|
||||||
import org.owasp.dependencycheck.dependency.VulnerableSoftware;
|
import org.owasp.dependencycheck.dependency.VulnerableSoftware;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -93,7 +94,7 @@ public class CveDBMySQLTest {
|
|||||||
CveDB instance = new CveDB();
|
CveDB instance = new CveDB();
|
||||||
try {
|
try {
|
||||||
instance.open();
|
instance.open();
|
||||||
List result = instance.getVulnerabilities(cpeStr);
|
List<Vulnerability> result = instance.getVulnerabilities(cpeStr);
|
||||||
assertTrue(result.size() > 5);
|
assertTrue(result.size() > 5);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
System.out.println("Unable to access the My SQL database; verify that the db server is running and that the schema has been generated");
|
System.out.println("Unable to access the My SQL database; verify that the db server is running and that the schema has been generated");
|
||||||
|
|||||||
@@ -185,7 +185,6 @@ public class DependencyTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetIdentifiers() {
|
public void testGetIdentifiers() {
|
||||||
Dependency instance = new Dependency();
|
Dependency instance = new Dependency();
|
||||||
List expResult = null;
|
|
||||||
Set<Identifier> result = instance.getIdentifiers();
|
Set<Identifier> result = instance.getIdentifiers();
|
||||||
|
|
||||||
assertTrue(true); //this is just a getter setter pair.
|
assertTrue(true); //this is just a getter setter pair.
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class SuppressionParserTest {
|
|||||||
//File file = new File(this.getClass().getClassLoader().getResource("suppressions.xml").getPath());
|
//File file = new File(this.getClass().getClassLoader().getResource("suppressions.xml").getPath());
|
||||||
File file = BaseTest.getResourceAsFile(this, "suppressions.xml");
|
File file = BaseTest.getResourceAsFile(this, "suppressions.xml");
|
||||||
SuppressionParser instance = new SuppressionParser();
|
SuppressionParser instance = new SuppressionParser();
|
||||||
List result = instance.parseSuppressionRules(file);
|
List<SuppressionRule> result = instance.parseSuppressionRules(file);
|
||||||
assertTrue(result.size() > 3);
|
assertTrue(result.size() > 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,11 +61,11 @@ public class DependencyVersionTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testIterator() {
|
public void testIterator() {
|
||||||
DependencyVersion instance = new DependencyVersion("1.2.3");
|
DependencyVersion instance = new DependencyVersion("1.2.3");
|
||||||
Iterator result = instance.iterator();
|
Iterator<String> result = instance.iterator();
|
||||||
assertTrue(result.hasNext());
|
assertTrue(result.hasNext());
|
||||||
int count = 1;
|
int count = 1;
|
||||||
while (result.hasNext()) {
|
while (result.hasNext()) {
|
||||||
String v = (String) result.next();
|
String v = result.next();
|
||||||
assertTrue(String.valueOf(count++).equals(v));
|
assertTrue(String.valueOf(count++).equals(v));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user