Added support to parse pom.xml contained within a JAR

Former-commit-id: 0f6ea59241f29e5c3d10f7f94ae153525024dbe7
This commit is contained in:
Jeremy Long
2012-11-12 10:53:27 -05:00
parent 9d3a32908e
commit 777664d1fe
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);
}
}