|
Groovy example source code file (EnsureClassAnnotationPresentInStubTest.groovy)
The Groovy EnsureClassAnnotationPresentInStubTest.groovy source code
package 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: |
Other websites by Alvin Alexander:
Life/living in Alaska (OneMansAlaska.com)
How I Sold My Business (HowISoldMyBusiness.com)
Copyright 1998-2011 Alvin Alexander, devdaily.com
All Rights Reserved.