OpenSSL: Updates to use FileFilter instead of file extension.

Former-commit-id: 974bc28171b5b3ac3e772c93447489e1afb797f1
This commit is contained in:
Dale Visser
2015-07-09 16:35:04 -04:00
parent e5fdda60fc
commit 433c2e5916
2 changed files with 18 additions and 42 deletions

View File

@@ -17,7 +17,6 @@
*/
package org.owasp.dependencycheck.analyzer;
import org.apache.commons.lang.StringUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -25,11 +24,10 @@ import org.owasp.dependencycheck.BaseTest;
import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
import org.owasp.dependencycheck.dependency.Dependency;
import java.util.Arrays;
import java.util.HashSet;
import java.io.File;
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
/**
* Unit tests for OpenSSLAnalyzerAnalyzer.
@@ -75,25 +73,13 @@ public class OpenSSLAnalyzerTest extends BaseTest {
analyzer.getName());
}
/**
* Test of getSupportedExtensions method, of class OpenSSLAnalyzer.
*/
@Test
public void testGetSupportedExtensions() {
final String[] expected = {"h"};
assertEquals("Supported extensions should just have the following: "
+ StringUtils.join(expected, ", "),
new HashSet<String>(Arrays.asList(expected)),
analyzer.getSupportedExtensions());
}
/**
* Test of supportsExtension method, of class PythonPackageAnalyzer.
*/
@Test
public void testSupportsExtension() {
assertTrue("Should support \"h\" extension.",
analyzer.supportsExtension("h"));
public void testAccept() {
assertTrue("Should support files named \"opensslv.h\".",
analyzer.accept(new File("opensslv.h")));
}
@Test