Package com.tuenti.supernanny.resolution

Examples of com.tuenti.supernanny.resolution.Resolver


  @Test
  public void testResolutionOk() throws Exception {
    prepareRepo();

    Resolver resolver = injector.getInstance(EagerResolver.class);
    List<Requirement> initialRequirements = new ArrayList<Requirement>();
    initialRequirements.add(new Requirement("befw", ReqType.EQ, "1.0.0", RepositoryType.TARBZ2,
        "http://localhost"));
    Set<Artifact> artifacts = resolver.resolve(initialRequirements);

    ArtifactData[] expected = { new ArtifactData("tuenti-common", "1.7.0"),
        new ArtifactData("futi", "3.0"), new ArtifactData("tuenti-build", "9.0"),
        new ArtifactData("befw", "1.0.0") };
    expectArtifacts(expected, artifacts);
View Full Code Here


  @Test
  public void testResolutionLibNotFound() throws Exception {
    prepareRepo();

    Resolver resolver = injector.getInstance(EagerResolver.class);
    List<Requirement> initialRequirements = new ArrayList<Requirement>();
    initialRequirements.add(new Requirement("something-weird", ReqType.EQ, "1.0",
        RepositoryType.TARBZ2, "http://localhost"));
    try {
      resolver.resolve(initialRequirements);
      Assert.fail();
    } catch (ResolutionException e) {
      String msg = e.getMessage();
      Assert.assertTrue(msg.contains("No artifact found") && msg.contains("tuenti-build"));
    }
View Full Code Here

  @Test
  public void testConflict() throws Exception {
    prepareRepo();

    Resolver resolver = injector.getInstance(EagerResolver.class);
    List<Requirement> initialRequirements = new ArrayList<Requirement>();
    initialRequirements.add(new Requirement("conflicting", ReqType.EQ, "1.0",
        RepositoryType.TARBZ2, "http://localhost"));
    try {
      resolver.resolve(initialRequirements);
      Assert.fail();
    } catch (ResolutionException e) {
      String msg = e.getMessage();
      Assert.assertTrue(msg.contains("tuenti-common") && msg.contains("tuenti-build")
          && msg.contains("9.0") && msg.contains("8.0"));
View Full Code Here

  @Test
  public void testChooseCorrectMajor() throws Exception {
    prepareRepo();

    Resolver resolver = injector.getInstance(EagerResolver.class);
    List<Requirement> initialRequirements = new ArrayList<Requirement>();
    initialRequirements.add(new Requirement("tuenti-build", ReqType.SW, "8.*",
        RepositoryType.TARBZ2, "http://localhost"));
    Set<Artifact> artifacts = resolver.resolve(initialRequirements);
    expectArtifacts(new ArtifactData[] { new ArtifactData("tuenti-build", "8.0") }, artifacts);
  }
View Full Code Here

  @Test
  public void testCircular() throws Exception {
    prepareRepo();

    Resolver resolver = injector.getInstance(EagerResolver.class);
    List<Requirement> initialRequirements = new ArrayList<Requirement>();
    initialRequirements.add(new Requirement("flik", ReqType.SW, "1.*",
        RepositoryType.TARBZ2, "http://localhost"));
    Set<Artifact> artifacts = resolver.resolve(initialRequirements);
    expectArtifacts(new ArtifactData[] { new ArtifactData("flik", "1.0"), new ArtifactData("flak", "1.0"), new ArtifactData("flok", "1.0") }, artifacts);
  }
View Full Code Here

TOP

Related Classes of com.tuenti.supernanny.resolution.Resolver

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.