use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method multiple2.
@Test(expected = BugInCF.class)
public void multiple2() {
AnnotationBuilder builder = new AnnotationBuilder(env, Mult.class);
builder.setValue("a", "m");
Assert.assertEquals(1, builder.build().getElementValues().size());
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method testEnumPositive.
@Test
public void testEnumPositive() {
AnnotationBuilder builder = new AnnotationBuilder(env, EnumElt.class);
builder.setValue("value", MyEnum.OK);
builder.setValue("value", MyEnum.NOT);
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method testToString1.
@Test
public void testToString1() {
AnnotationBuilder builder = new AnnotationBuilder(env, Anno.class);
Assert.assertEquals("@org.checkerframework.framework.test.junit.AnnotationBuilderTest.Anno", builder.build().toString());
}
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 });
Assert.assertEquals(1, builder.build().getElementValues().size());
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method testRetClassNegative.
// Failing test for now. AnnotationBuilder is a bit permissive
// It doesn't not check type argument subtyping
@Test(expected = BugInCF.class)
// bug for now
@Ignore
public void testRetClassNegative() {
AnnotationBuilder builder = new AnnotationBuilder(env, RestrictedClassElt.class);
builder.setValue("value", String.class);
}
Aggregations