public void testVariantLevelAbiFilter() throws ProcessException {
    VariantOutput match;
    List<VariantOutput> list = Lists.newArrayList();

    list.add(match = getUniversalOutput(1));
    List<File> result = computeBestOutput(list, Sets.newHashSet("bar", "foo"), 160, "foo", "zzz");

    assertEquals(1, result.size());
    assertEquals(match.getMainOutputFile().getOutputFile(), result.get(0));
  }
  public void testSingleOutput() throws ProcessException {
    VariantOutput match;
    List<VariantOutput> list = Lists.newArrayList();

    list.add(match = getUniversalOutput(1));

    List<File> result = computeBestOutput(list, 160, "foo");

    assertEquals(1, result.size());
    assertEquals(match.getMainOutputFile().getOutputFile(), result.get(0));
  }
  public void testAbiOnlyWithUniversalMatch() throws ProcessException {
    VariantOutput match;
    List<VariantOutput> list = Lists.newArrayList();

    list.add(match = getUniversalOutput(1));
    list.add(getAbiOutput("foo", 2));
    list.add(getAbiOutput("bar", 3));

    List<File> result = computeBestOutput(list, 160, "zzz");

    assertEquals(1, result.size());
    assertEquals(match.getMainOutputFile().getOutputFile(), result.get(0));
  }
  public void testDensityOnlyWithCustomDeviceDensity() throws ProcessException {
    VariantOutput match;
    List<VariantOutput> list = Lists.newArrayList();

    list.add(match = getUniversalOutput(1));
    list.add(getDensityOutput(320, 2));
    list.add(getDensityOutput(480, 3));

    List<File> result = computeBestOutput(list, 1, "foo");

    assertEquals(1, result.size());
    assertEquals(match.getMainOutputFile().getOutputFile(), result.get(0));
  }
  public void testAbiOnlyWithMultiMatch2() throws ProcessException {
    VariantOutput match;
    List<VariantOutput> list = Lists.newArrayList();

    // test where the versionCode does not match the abi order
    list.add(getUniversalOutput(1));
    list.add(getAbiOutput("foo", 2));
    list.add(match = getAbiOutput("bar", 3));

    // bar is preferred over foo
    List<File> result = computeBestOutput(list, 160, "foo", "bar");

    assertEquals(1, result.size());
    assertEquals(match.getMainOutputFile().getOutputFile(), result.get(0));
  }