Package com.tuenti.supernanny.repo.artifacts

Examples of com.tuenti.supernanny.repo.artifacts.ArchiveArtifact


  }

  @Override
  public String fetch(Artifact artifact, File destination) throws IOException {
    if (artifact instanceof ArchiveArtifact) {
      ArchiveArtifact arch = (ArchiveArtifact) artifact;
      strategy.fetch(uri, arch.getFilename(), destination);
      String resolvedVersion = artifact.getVersion().toString();
      util.stampProject(artifact.getName(), destination, artifact.getOriginUrl(),
          resolvedVersion, getRepoType());
      return resolvedVersion;
    } else {
View Full Code Here


        file = readField("File:");
        md5 = readField("MD5:");
        readField("Deps:");
        deps = readDeps();
        List<Requirement> reqs = depParser.parseDeps(deps);
        artifacts.add(new ArchiveArtifact(name, new Version(version), file, md5, null, reqs));
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
    return artifacts;
View Full Code Here

    IndexReader ir = new IndexReader(bufferedReader);
    List<ArchiveArtifact> artifacts = ir.parse();

    Assert.assertEquals(4, artifacts.size());
   
    ArchiveArtifact a = artifacts.get(0);
    Assert.assertEquals("libphonenumber", a.getName());
    Assert.assertEquals(new Version("1.2.0"), a.getVersion());
    Assert.assertEquals("libphonenumber-1.2.0.tar.bz2", a.getFilename());

    List<Requirement> expectedRequirements = new LinkedList<Requirement>();
    expectedRequirements.add(new Requirement("tuenti-common", ReqType.LT, "7.8", RepositoryType.TARBZ2, "http://artifacts.tuenti.int/"));
    expectedRequirements.add(new Requirement("tfw-lib", ReqType.GT, "1.*", RepositoryType.TARBZ2, "http://artifacts.tuenti.int/"));
    Assert.assertEquals(expectedRequirements, a.getRequirements());

    a = artifacts.get(1);
    Assert.assertEquals("supervisor-common", a.getName());
    Assert.assertEquals(new Version("0.33"), a.getVersion());
    Assert.assertEquals("supervisor/supervisor-common-0.33.tar.bz2", a.getFilename());
    Assert.assertEquals(new LinkedList<Requirement>(), a.getRequirements());

    a = artifacts.get(2);
    Assert.assertEquals("fefw-fbi", a.getName());
    Assert.assertEquals(new Version("2.1"), a.getVersion());
    Assert.assertEquals("fefw-fbi-2.1.tar.bz2", a.getFilename());

    expectedRequirements = new LinkedList<Requirement>();
    expectedRequirements.add(new Requirement("tuenti-build", ReqType.LE, "16.8", RepositoryType.TARBZ2, "http://artifacts.tuenti.int/"));
    expectedRequirements.add(new Requirement("befw", ReqType.GE, "4.*", RepositoryType.TARBZ2, "http://artifacts.tuenti.int/"));
    expectedRequirements.add(new Requirement("otro", ReqType.SW, "5.*", RepositoryType.TARBZ2, "http://artifacts.tuenti.int/"));
    //expect the default GE
    expectedRequirements.add(new Requirement("squeeze", ReqType.GE, "6.*", RepositoryType.TARBZ2, "http://artifacts.tuenti.int/"));
    Assert.assertEquals(expectedRequirements, a.getRequirements());

    a = artifacts.get(3);
    Assert.assertEquals("supervisor-common", a.getName());
    Assert.assertEquals(new Version("1.0.1"), a.getVersion());
    Assert.assertEquals("supervisor-common-1.0.1.tar.bz2", a.getFilename());
    Assert.assertEquals(new LinkedList<Requirement>(), a.getRequirements());
  }
View Full Code Here

TOP

Related Classes of com.tuenti.supernanny.repo.artifacts.ArchiveArtifact

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.