use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method testAnnoAsArgNegative.
@Test(expected = BugInCF.class)
public void testAnnoAsArgNegative() {
AnnotationMirror anno = AnnotationBuilder.fromClass(env.getElementUtils(), Anno.class);
AnnotationBuilder builder = new AnnotationBuilder(env, ContainingAnno.class);
builder.setValue("value", anno);
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method testToString3.
@Test
public void testToString3() {
AnnotationBuilder builder = new AnnotationBuilder(env, Anno.class);
builder.setValue("can", new Object[] { 1 });
Assert.assertEquals("@org.checkerframework.framework.test.junit.AnnotationBuilderTest.Anno(can={1})", builder.build().toString());
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method testToString5.
@Test
public void testToString5() {
AnnotationBuilder builder = new AnnotationBuilder(env, Anno.class);
builder.setValue("can", new Object[] { 1 });
builder.setValue("value", "m");
Assert.assertEquals("@org.checkerframework.framework.test.junit.AnnotationBuilderTest.Anno" + "(can={1}, value=\"m\")", builder.build().toString());
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method testClassNegative.
@Test(expected = BugInCF.class)
public void testClassNegative() {
AnnotationBuilder builder = new AnnotationBuilder(env, ClassElt.class);
builder.setValue("value", 2);
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method addingValuesAfterBuilding.
@Test(expected = BugInCF.class)
public void addingValuesAfterBuilding() {
AnnotationBuilder builder = new AnnotationBuilder(env, AnnoWithStringArg.class);
builder.setValue("value", "m");
// AnnotationMirror anno =
builder.build();
builder.setValue("value", "n");
}
Aggregations