Merge branch 'master' of github.com:colezlaw/DependencyCheck into colezlaw-master

Former-commit-id: 852aaebdb276c0974da0a76fe53e7228228a18a1
This commit is contained in:
Jeremy Long
2014-03-01 15:35:57 -05:00
2 changed files with 13 additions and 8 deletions

View File

@@ -200,9 +200,8 @@ public class AssemblyAnalyzer extends AbstractAnalyzer {
final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(p.getInputStream()); final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(p.getInputStream());
final XPath xpath = XPathFactory.newInstance().newXPath(); final XPath xpath = XPathFactory.newInstance().newXPath();
final String error = xpath.evaluate("/assembly/error", doc); final String error = xpath.evaluate("/assembly/error", doc);
if (p.exitValue() != 1 || error == null || "".equals(error)) { if (p.waitFor() != 1 || error == null || "".equals(error)) {
LOG.warning("An error occured with the .NET AssemblyAnalyzer; " LOG.warning("An error occured with the .NET AssemblyAnalyzer, please see the log for more details.");
+ "this can be ignored unless you are scanning .NET dlls. Please see the log for more details.");
LOG.fine("GrokAssembly.exe is not working properly"); LOG.fine("GrokAssembly.exe is not working properly");
grokAssemblyExe = null; grokAssemblyExe = null;
throw new AnalysisException("Could not execute .NET AssemblyAnalyzer"); throw new AnalysisException("Could not execute .NET AssemblyAnalyzer");

View File

@@ -17,15 +17,19 @@
*/ */
package org.owasp.dependencycheck.analyzer; package org.owasp.dependencycheck.analyzer;
import java.io.File;
import org.junit.After;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import java.io.File;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.Assume; import org.junit.Assume;
import static org.junit.Assume.assumeFalse; import static org.junit.Assume.assumeFalse;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.mortbay.log.Log;
import org.owasp.dependencycheck.analyzer.exception.AnalysisException; import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
import org.owasp.dependencycheck.dependency.Confidence; import org.owasp.dependencycheck.dependency.Confidence;
import org.owasp.dependencycheck.dependency.Dependency; import org.owasp.dependencycheck.dependency.Dependency;
@@ -39,6 +43,8 @@ import org.owasp.dependencycheck.utils.Settings;
* *
*/ */
public class AssemblyAnalyzerTest { public class AssemblyAnalyzerTest {
private static final Logger LOGGER = Logger.getLogger(AssemblyAnalyzerTest.class.getName());
AssemblyAnalyzer analyzer; AssemblyAnalyzer analyzer;
@@ -52,8 +58,8 @@ public class AssemblyAnalyzerTest {
try { try {
analyzer = new AssemblyAnalyzer(); analyzer = new AssemblyAnalyzer();
analyzer.initialize(); analyzer.initialize();
} catch (Throwable e) { } catch (Exception e) {
Log.warn("Exception setting up AssemblyAnalyzer. Tests will be incomplete"); LOGGER.log(Level.WARNING, "Exception setting up AssemblyAnalyzer. Tests will be incomplete", e);
Assume.assumeNoException("Is mono installed? TESTS WILL BE INCOMPLETE", e); Assume.assumeNoException("Is mono installed? TESTS WILL BE INCOMPLETE", e);
} }
} }