def testExclusion(self): pig = Artifact('org.apache.pig', 'pig', '0.8.3') exclusion = [Artifact(*x.split(":")) for x in ['ant:ant', 'junit:junit','org.eclipse.jdt:core']] artifacts = _resolve_artifacts([pig], exclusion) self.assertTrue(len(artifacts) > 0) self.assertFalse(any([x.is_same_artifact(Artifact('ant', 'ant')) for x in artifacts])) self.assertFalse(any([x.is_same_artifact(Artifact('junit', 'junit')) for x in artifacts])) self.assertFalse(any([x.is_same_artifact(Artifact('org.eclipse', 'core')) for x in artifacts]))
def testExclusion(self): pig = Artifact('org.apache.pig', 'pig', '0.8.3') exclusion = map(lambda x: Artifact(*x.split(":")), ['ant:ant', 'junit:junit','org.eclipse.jdt:core']) print exclusion artifacts = _resolve_artifacts([pig], exclusion) print artifacts self.assert_(len(artifacts) > 0) self.assert_(not any(map(lambda x: x.is_same_artifact(Artifact('ant', 'ant')), artifacts))) self.assert_(not any(map(lambda x: x.is_same_artifact(Artifact('junit', 'junit')), artifacts))) self.assert_(not any(map(lambda x: x.is_same_artifact(Artifact('org.eclipse', 'core')), artifacts)))
def require(artifact_id): _prepare() artifact = Artifact.from_id(artifact_id) artifact_set = _resolve_artifacts([artifact]) ## download to cache first for artifact in artifact_set: if artifact.repos != cache_manager.as_repos(): artifact.repos.download_jar(artifact, cache_manager.get_jar_path(artifact)) pool.join() ## append jars to path for artifact in artifact_set: sys.path.append(cache_manager.get_jar_path(artifact, filepath=True))
def testExclusion(self): pig = Artifact('org.apache.pig', 'pig', '0.8.3') exclusion = map(lambda x: Artifact(*x.split(":")), ['ant:ant', 'junit:junit', 'org.eclipse.jdt:core']) print exclusion artifacts = _resolve_artifacts([pig], exclusion) print artifacts self.assert_(len(artifacts) > 0) self.assert_(not any( map(lambda x: x.is_same_artifact(Artifact('ant', 'ant')), artifacts))) self.assert_(not any( map(lambda x: x.is_same_artifact(Artifact('junit', 'junit')), artifacts))) self.assert_(not any( map(lambda x: x.is_same_artifact(Artifact('org.eclipse', 'core')), artifacts)))
def testResolve(self): junit = Artifact('junit', 'junit', '3.8.1') artifacts = _resolve_artifacts([junit]) self.assertEqual(len(artifacts), 1)
def testResolveArtifactWithUmlautsInPom(self): artifact = Artifact('de.l3s.boilerpipe', 'boilerpipe', '1.1.0') artifacts = _resolve_artifacts([artifact]) self.assertEqual(len(artifacts), 1)
def testResolve(self): commons_lang = Artifact('commons-lang', 'commons-lang', '2.6') print commons_lang artifacts = _resolve_artifacts([commons_lang]) print artifacts self.assert_(len(artifacts) == 1)