public void testGatherSingleArtifactOk() throws Exception {
DeploymentArtifactCollector handler = new DeploymentArtifactCollector(TARGET, VERSION1);
m_parser.parse(m_inputStream, handler);
List<XmlDeploymentArtifact>[] artifacts = handler.getArtifacts();
assert artifacts.length == 1 : "Expected a single artifact to be found!";
assert artifacts[0].size() == 1 : "Expected a single artifact to be found!";
XmlDeploymentArtifact artifact1 = artifacts[0].get(0);
assert new URL("file:///bundle1").equals(artifact1.getUrl()) : "Expected 'file:///bundle1' URL to be found!";
assert artifact1.getDirective().size() == 2 : "Expected two directives to be found!";
assert "bundle1".equals(artifact1.getDirective().get(KEY_SYMBOLICNAME)) : "Expected correct symbolic name to be found!";
assert "1.0.0".equals(artifact1.getDirective().get(KEY_VERSION)) : "Expected correct bundle version to be found!";
}
|