1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.core.test;
17
18 import java.lang.annotation.Documented;
19 import java.lang.annotation.ElementType;
20 import java.lang.annotation.Inherited;
21 import java.lang.annotation.Retention;
22 import java.lang.annotation.RetentionPolicy;
23 import java.lang.annotation.Target;
24
25 import org.junit.After;
26 import org.junit.Before;
27 import org.junit.BeforeClass;
28 import org.junit.Test;
29 import org.kuali.rice.core.api.lifecycle.BaseLifecycle;
30 import org.kuali.rice.test.BaselineTestCase;
31 import org.kuali.rice.test.ClearDatabaseLifecycle;
32 import org.kuali.rice.test.data.PerSuiteUnitTestData;
33 import org.kuali.rice.test.data.PerTestUnitTestData;
34 import org.kuali.rice.test.data.UnitTestData;
35
36 import static org.junit.Assert.assertNotNull;
37 import static org.junit.Assert.fail;
38
39
40
41
42
43
44
45 @PerSuiteUnitTestData(
46 overrideSuperClasses = true,
47 value = {@UnitTestData("insert into " + AnnotationTestParent.TEST_TABLE_NAME + " (COL) values ('3')"),
48 @UnitTestData(filename = "classpath:org/kuali/rice/test/DataLoaderAnnotationTestData.sql")
49 })
50
51 @DataLoaderAnnotationOverrideTest.Nothing
52 public class DataLoaderAnnotationOverrideTest extends AnnotationTestParent {
53
54
55 @Documented
56 @Target({ElementType.TYPE, ElementType.METHOD})
57 @Retention(RetentionPolicy.RUNTIME)
58 @Inherited
59 public static @interface Nothing {
60 }
61
62 @Override
63 protected void setUpInternal() throws Exception {
64 try{
65 resetDb();
66 } catch (Exception e) {
67
68 }
69 super.setUpInternal();
70 }
71
72 @Test public void testParentAndSubClassImplementation() throws Exception {
73
74
75
76 verifyCount("3", 1, "https://jira.kuali.org/browse/KULRICE-9283");
77
78
79 verifyCount("4", 1);
80
81
82 verifyNonExistent("1");
83
84
85 verifyNonExistent("2");
86
87 }
88
89 }