From 7b646c04d5fcd2bdb79938e643af98f8780b38b8 Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Sun, 12 Jan 2014 08:19:53 -0500 Subject: [PATCH] initial [empty] version Former-commit-id: 1642f701eea410c3cf2c0b5f9e6a12a6f8ac018e --- .../data/nvdcve/CveDBMySQLTest.java | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 dependency-check-core/src/test/java/org/owasp/dependencycheck/data/nvdcve/CveDBMySQLTest.java diff --git a/dependency-check-core/src/test/java/org/owasp/dependencycheck/data/nvdcve/CveDBMySQLTest.java b/dependency-check-core/src/test/java/org/owasp/dependencycheck/data/nvdcve/CveDBMySQLTest.java new file mode 100644 index 000000000..b667113d2 --- /dev/null +++ b/dependency-check-core/src/test/java/org/owasp/dependencycheck/data/nvdcve/CveDBMySQLTest.java @@ -0,0 +1,85 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.owasp.dependencycheck.data.nvdcve; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * + * @author jeremy + */ +public class CveDBMySQLTest { + + @BeforeClass + public static void setUpClass() { + } + + @AfterClass + public static void tearDownClass() { + } + + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + + /** + * Pretty useless tests of open, commit, and close methods, of class CveDB. + */ + @Test + public void testOpen() throws Exception { + /* + CveDB instance = new CveDB(); + instance.open(); + instance.commit(); + instance.close(); + */ + } + + /** + * Test of getCPEs method, of class CveDB. + */ + @Test + public void testGetCPEs() throws Exception { + /* + CveDB instance = new CveDB(); + try { + String vendor = "apache"; + String product = "struts"; + instance.open(); + Set result = instance.getCPEs(vendor, product); + assertTrue(result.size() > 5); + } finally { + instance.close(); + } + */ + } + + /** + * Test of getVulnerabilities method, of class CveDB. + */ + @Test + public void testGetVulnerabilities() throws Exception { + /* + String cpeStr = "cpe:/a:apache:struts:2.1.2"; + CveDB instance = new CveDB(); + try { + instance.open(); + List result = instance.getVulnerabilities(cpeStr); + assertTrue(result.size() > 5); + } finally { + instance.close(); + } + */ + } +}