01: /*
02: * Copyright 2006-2007, Unitils.org
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.unitils.database.annotations;
17:
18: import static java.lang.annotation.ElementType.FIELD;
19: import static java.lang.annotation.ElementType.METHOD;
20: import java.lang.annotation.Retention;
21: import static java.lang.annotation.RetentionPolicy.RUNTIME;
22: import java.lang.annotation.Target;
23:
24: /**
25: * Annotation indicating that this field or method should be initialized with the <code>DataSource</code> that supplies
26: * a connection to the unit test database.
27: * <p/>
28: * If a field is annotated, it should be of type <code>DataSource</code>. This field can be private. Example:
29: * <pre><code>
30: * ' @DataSource
31: * private DataSource dataSource;
32: * </code></pre>
33: * If a method is annotated, the method should have 1 DataSource argument. Example:
34: * <pre><code>
35: * ' @DataSource
36: * void myMethod(DataSource dataSource)
37: * </code></pre>
38: *
39: * @author Filip Neven
40: * @author Tim Ducheyne
41: */
42: @Target({METHOD,FIELD})
43: @Retention(RUNTIME)
44: public @interface TestDataSource {
45: }
|