use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method testEnumNegative2.
@Test(expected = SourceChecker.CheckerError.class)
public void testEnumNegative2() {
AnnotationBuilder builder = new AnnotationBuilder(env, EnumElt.class);
builder.setValue("value", OtherEnum.TEST);
}
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 = SourceChecker.CheckerError.class)
// bug for now
@Ignore
public void testRetClassNegative() {
AnnotationBuilder builder = new AnnotationBuilder(env, RestrictedClassElt.class);
builder.setValue("value", String.class);
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method testToString2.
@Test
public void testToString2() {
AnnotationBuilder builder = new AnnotationBuilder(env, Anno.class);
builder.setValue("value", "string");
assertEquals("@tests.AnnotationBuilderTest.Anno(\"string\")", builder.build().toString());
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method testRestClassPositive.
@Test
public void testRestClassPositive() {
AnnotationBuilder builder = new AnnotationBuilder(env, RestrictedClassElt.class);
builder.setValue("value", Integer.class);
}
use of org.checkerframework.javacutil.AnnotationBuilder in project checker-framework by typetools.
the class AnnotationBuilderTest method buildingTwice.
@Test(expected = SourceChecker.CheckerError.class)
public void buildingTwice() {
AnnotationBuilder builder = new AnnotationBuilder(env, Encrypted.class);
builder.build();
builder.build();
}
Aggregations