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

Former-commit-id: f3badca9d690cbf388c593f4bea1594855da6d1e
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 XPath xpath = XPathFactory.newInstance().newXPath();
final String error = xpath.evaluate("/assembly/error", doc);
if (p.exitValue() != 1 || error == null || "".equals(error)) {
LOG.warning("An error occured with the .NET AssemblyAnalyzer; "
+ "this can be ignored unless you are scanning .NET dlls. Please see the log for more details.");
if (p.waitFor() != 1 || error == null || "".equals(error)) {
LOG.warning("An error occured with the .NET AssemblyAnalyzer, please see the log for more details.");
LOG.fine("GrokAssembly.exe is not working properly");
grokAssemblyExe = null;
throw new AnalysisException("Could not execute .NET AssemblyAnalyzer");

View File

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