use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method primitiveValue.
@Test
public void primitiveValue() {
AnnotationBuilder builder = new AnnotationBuilder(env, Prim.class);
builder.setValue("a", 3);
assertEquals(1, builder.build().getElementValues().size());
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method listArrayObjectWrongType1.
@Test(expected = SourceChecker.CheckerError.class)
public void listArrayObjectWrongType1() {
AnnotationBuilder builder = new AnnotationBuilder(env, B.class);
builder.setValue("strings", 1);
assertEquals(1, builder.build().getElementValues().size());
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method multiple3.
@Test
public void multiple3() {
AnnotationBuilder builder = new AnnotationBuilder(env, Mult.class);
builder.setValue("a", 1);
builder.setValue("b", "mark");
assertEquals(2, builder.build().getElementValues().size());
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method listArrayPrimitive.
@Test
public void listArrayPrimitive() {
AnnotationBuilder builder = new AnnotationBuilder(env, A.class);
builder.setValue("numbers", new Integer[] { 34, 32, 43 });
assertEquals(1, builder.build().getElementValues().size());
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method multiple1.
@Test
public void multiple1() {
AnnotationBuilder builder = new AnnotationBuilder(env, Mult.class);
builder.setValue("a", 2);
assertEquals(1, builder.build().getElementValues().size());
}
Aggregations