} finally {
in.close();
}
assertEquals(2, CollectionUtils.toList(repo.getModules()).size());
ModuleDescriptorWrapper bundle1 = repo.findModule(BUNDLE_1, BUNDLE_VERSION);
assertNotNull(bundle1);
Artifact[] artifacts = bundle1.getModuleDescriptor().getAllArtifacts();
assertEquals(2, artifacts.length);
if (artifacts[0].getType().equals("jar")) {
assertEquals("source", artifacts[1].getType());
} else {
assertEquals("jar", artifacts[1].getType());
assertEquals("source", artifacts[0].getType());
}
ModuleDescriptorWrapper bundle2 = repo.findModule(BUNDLE_2, BUNDLE_VERSION);
assertNotNull(bundle2);
assertEquals(1, bundle2.getModuleDescriptor().getAllArtifacts().length);
}