1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.kuali.student.datadictionary.util;
21
22 import static org.junit.Assert.assertEquals;
23
24 import java.util.Stack;
25
26 import org.junit.After;
27 import org.junit.AfterClass;
28 import org.junit.Before;
29 import org.junit.BeforeClass;
30 import org.junit.Test;
31 import org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase;
32 import org.kuali.rice.krad.datadictionary.DataObjectEntry;
33 import org.kuali.student.contract.model.test.source.AtpInfo;
34 import org.kuali.student.r2.core.exemption.dto.ExemptionInfo;
35 import org.kuali.student.validation.decorator.mojo.ValidationDecoratorWriterForOneService;
36 import org.slf4j.Logger;
37 import org.slf4j.LoggerFactory;
38
39
40
41
42
43 public class Bean2DictionaryConverterTest {
44
45 private static Logger log = LoggerFactory.getLogger(Bean2DictionaryConverterTest.class);
46
47
48 public Bean2DictionaryConverterTest() {
49 }
50
51 @BeforeClass
52 public static void setUpClass() throws Exception {
53 }
54
55 @AfterClass
56 public static void tearDownClass() throws Exception {
57 }
58
59 @Before
60 public void setUp() {
61 }
62
63 @After
64 public void tearDown() {
65 }
66
67
68
69
70 @Test
71 public void testConvert() {
72 log.info("convert");
73 Class<?> clazz = null;
74 Stack<DataDictionaryDefinitionBase> parentFields = null;
75 Stack<Class<?>> parentClasses = null;
76 Bean2DictionaryConverter instance = null;
77 DataObjectEntry result = null;
78
79 clazz = AtpInfo.class;
80 parentFields = new Stack<DataDictionaryDefinitionBase>();
81 parentClasses = new Stack<Class<?>>();
82 instance = new Bean2DictionaryConverter(clazz, parentFields, parentClasses);
83 result = instance.convert();
84 assertEquals(13, result.getAttributes().size());
85
86 clazz = ExemptionInfo.class;
87 parentFields = new Stack<DataDictionaryDefinitionBase>();
88 parentClasses = new Stack<Class<?>>();
89 instance = new Bean2DictionaryConverter(clazz, parentFields, parentClasses);
90 result = instance.convert();
91 assertEquals(22, result.getAttributes().size());
92 }
93 }