Пример #1
0
 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]))
Пример #2
0
 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]))
Пример #3
0
 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)))
Пример #4
0
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))
Пример #5
0
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))
Пример #6
0
 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)))
Пример #7
0
 def testResolve(self):
     junit = Artifact('junit', 'junit', '3.8.1')
     artifacts = _resolve_artifacts([junit])
     self.assertEqual(len(artifacts), 1)
Пример #8
0
 def testResolveArtifactWithUmlautsInPom(self):
     artifact = Artifact('de.l3s.boilerpipe', 'boilerpipe', '1.1.0')
     artifacts = _resolve_artifacts([artifact])
     self.assertEqual(len(artifacts), 1)
Пример #9
0
 def testResolve(self):
     junit = Artifact('junit', 'junit', '3.8.1')
     artifacts = _resolve_artifacts([junit])
     self.assertEqual(len(artifacts), 1)
Пример #10
0
 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)
Пример #11
0
 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)