use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method notFoundElements.
@Test(expected = SourceChecker.CheckerError.class)
public void notFoundElements() {
AnnotationBuilder builder = new AnnotationBuilder(env, AnnoWithStringArg.class);
builder.setValue("n", "m");
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method multiple2.
@Test(expected = SourceChecker.CheckerError.class)
public void multiple2() {
AnnotationBuilder builder = new AnnotationBuilder(env, Mult.class);
builder.setValue("a", "m");
assertEquals(1, builder.build().getElementValues().size());
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method testAnnoAsArgNegative.
@Test(expected = SourceChecker.CheckerError.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 testClassNegative.
@Test(expected = SourceChecker.CheckerError.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 testToString5.
@Test
public void testToString5() {
AnnotationBuilder builder = new AnnotationBuilder(env, Anno.class);
builder.setValue("can", new Object[] { 1 });
builder.setValue("value", "m");
assertEquals("@tests.AnnotationBuilderTest.Anno(can={1}, value=\"m\")", builder.build().toString());
}
Aggregations