Search in sources :

Example 1 with Label

use of com.facebook.buck.rules.Label in project buck by facebook.

the class TypeCoercerTest method coerceToLabels.

@Test
public void coerceToLabels() throws NoSuchFieldException, CoerceFailedException {
    Type type = TestFields.class.getField("labels").getGenericType();
    TypeCoercer<?> coercer = typeCoercerFactory.typeCoercerForType(type);
    ImmutableList<String> input = ImmutableList.of("cheese", "cake", "tastes", "good");
    Object result = coercer.coerce(cellRoots, filesystem, Paths.get(""), input);
    ImmutableSortedSet<Label> expected = ImmutableSortedSet.of(Label.of("cake"), Label.of("cheese"), Label.of("good"), Label.of("tastes"));
    assertEquals(expected, result);
}
Also used : Type(java.lang.reflect.Type) Label(com.facebook.buck.rules.Label) Test(org.junit.Test)

Aggregations

Label (com.facebook.buck.rules.Label)1 Type (java.lang.reflect.Type)1 Test (org.junit.Test)1