Added support to parse pom.xml contained within a JAR

Former-commit-id: 2074209494ac958b83d49b3d9918b4badae0d17c
This commit is contained in:
Jeremy Long
2012-11-12 10:53:27 -05:00
parent a37e53769c
commit 83742437d6
45 changed files with 14405 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
*/
package org.codesecure.dependencycheck.analyzer;
import java.util.Properties;
import org.codesecure.dependencycheck.analyzer.JarAnalyzer;
import org.codesecure.dependencycheck.dependency.Dependency;
import org.codesecure.dependencycheck.dependency.Evidence;
@@ -130,4 +131,16 @@ public class JarAnalyzerTest {
boolean result = instance.supportsExtension(extension);
assertEquals(expResult, result);
}
@Test
public void testInterpolateString() {
Properties prop = new Properties();
prop.setProperty("key", "value");
prop.setProperty("nested", "nested ${key}");
String text = "This is a test of '${key}' '${nested}'";
String expResults = "This is a test of 'value' 'nested value'";
JarAnalyzer instance = new JarAnalyzer();
String results = instance.interpolateString(text, prop);
assertEquals(expResults, results);
}
}