mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-17 17:21:53 +01:00
cleanup and rework of core engine
Former-commit-id: e5bd95da1080429837df5835f28f46542a20fff7
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.codesecure.dependencycheck.dependency;
|
||||
|
||||
import org.codesecure.dependencycheck.dependency.Dependency;
|
||||
import org.codesecure.dependencycheck.dependency.Evidence;
|
||||
import java.util.List;
|
||||
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 DependencyTest {
|
||||
|
||||
public DependencyTest() {
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpClass() throws Exception {
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDownClass() throws Exception {
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of containsUsedString method, of class Dependency.
|
||||
*/
|
||||
@Test
|
||||
public void testContainsUsedString() {
|
||||
System.out.println("containsUsedString");
|
||||
String str = "apache";
|
||||
String str2 = "codesecure";
|
||||
Dependency instance = new Dependency();
|
||||
instance.vendorEvidence.addEvidence("manifest", "something", "apache", Evidence.Confidence.HIGH);
|
||||
instance.vendorEvidence.addEvidence("manifest", "something", "codesecure", Evidence.Confidence.MEDIUM);
|
||||
assertFalse(instance.containsUsedString(str));
|
||||
assertFalse(instance.containsUsedString(str2));
|
||||
for (Evidence i : instance.vendorEvidence.iterator(Evidence.Confidence.HIGH)) {
|
||||
String readValue = i.getValue();
|
||||
}
|
||||
assertTrue(instance.containsUsedString(str));
|
||||
assertFalse(instance.containsUsedString(str2));
|
||||
for (Evidence i : instance.vendorEvidence.iterator(Evidence.Confidence.MEDIUM)) {
|
||||
String readValue = i.getValue();
|
||||
}
|
||||
assertTrue(instance.containsUsedString(str));
|
||||
assertTrue(instance.containsUsedString(str2));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user