001    /*
002     * Copyright 2007 The Kuali Foundation
003     * 
004     * Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in
005     * compliance with the License. You may obtain a copy of the License at
006     * 
007     * http://www.opensource.org/licenses/ecl2.php
008     * 
009     * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS
010     * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
011     * language governing permissions and limitations under the License.
012     */
013    package org.kuali.rice.test.data;
014    
015    import java.lang.annotation.Documented;
016    import java.lang.annotation.ElementType;
017    import java.lang.annotation.Inherited;
018    import java.lang.annotation.Retention;
019    import java.lang.annotation.RetentionPolicy;
020    import java.lang.annotation.Target;
021    
022    /**
023     * Annotation for loading/running data before unit test runs.
024     * 
025     * @author Kuali Rice Team (rice.collab@kuali.org)
026     */
027    @Documented
028    @Target({ElementType.TYPE, ElementType.METHOD})
029    @Retention(RetentionPolicy.RUNTIME)
030    @Inherited
031    public @interface UnitTestData {
032       
033        public enum Type { SQL_STATEMENTS, SQL_FILES }
034    
035        // add direct support for both styles 
036        String value() default "";
037        String filename() default "";
038        String delimiter() default ";";
039    
040        UnitTestSql[] sqlStatements() default {};
041        UnitTestFile[] sqlFiles() default {};
042        Type[] order() default { Type.SQL_STATEMENTS, Type.SQL_FILES };
043        
044        // TODO: Come back and add the JPQL equivalents
045    }