View Javadoc

1   /*
2    * Copyright 2007 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in
5    * compliance with the License. You may obtain a copy of the License at
6    * 
7    * http://www.opensource.org/licenses/ecl2.php
8    * 
9    * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS
10   * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
11   * language governing permissions and limitations under the License.
12   */
13  package org.kuali.rice.test.data;
14  
15  import java.lang.annotation.Documented;
16  import java.lang.annotation.ElementType;
17  import java.lang.annotation.Inherited;
18  import java.lang.annotation.Retention;
19  import java.lang.annotation.RetentionPolicy;
20  import java.lang.annotation.Target;
21  
22  /**
23   * Annotation for loading/running data before unit test runs.
24   * 
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   */
27  @Documented
28  @Target({ElementType.TYPE, ElementType.METHOD})
29  @Retention(RetentionPolicy.RUNTIME)
30  @Inherited
31  public @interface UnitTestData {
32     
33      public enum Type { SQL_STATEMENTS, SQL_FILES }
34  
35      // add direct support for both styles 
36      String value() default "";
37      String filename() default "";
38      String delimiter() default ";";
39  
40      UnitTestSql[] sqlStatements() default {};
41      UnitTestFile[] sqlFiles() default {};
42      Type[] order() default { Type.SQL_STATEMENTS, Type.SQL_FILES };
43      
44      // TODO: Come back and add the JPQL equivalents
45  }