|
Groovy example source code file (EnsureClassAnnotationPresentInStubTest.groovy)
The Groovy EnsureClassAnnotationPresentInStubTest.groovy source codepackage org.codehaus.groovy.tools.stubgenerator /** * @author Guillaume Laforge */ class EnsureClassAnnotationPresentInStubTest extends StringSourcesStubTestCase { @Override Map<String, String> provideSources() { [ 'Foo.java': ''' package foo; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface Foo {} ''', 'bar/Bar.groovy': ''' package bar import foo.Foo @Foo class Bar {} ''' ] } @Override void verifyStubs() { assert classes['bar.Bar'].annotations[0].type.toString() == 'foo.Foo' } } Other Groovy examples (source code examples)Here is a short list of links related to this Groovy EnsureClassAnnotationPresentInStubTest.groovy source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.