001    /*
002     * To change this template, choose Tools | Templates
003     * and open the template in the editor.
004     */
005    package org.kuali.student.datadictionary.util;
006    
007    import java.util.Stack;
008    import org.junit.After;
009    import org.junit.AfterClass;
010    import org.junit.Before;
011    import org.junit.BeforeClass;
012    import org.junit.Test;
013    import static org.junit.Assert.*;
014    import org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase;
015    import org.kuali.rice.krad.datadictionary.DataObjectEntry;
016    import org.kuali.student.contract.model.test.source.AtpInfo;
017    import org.kuali.student.r2.core.exemption.dto.ExemptionInfo;
018    
019    /**
020     *
021     * @author nwright
022     */
023    public class Bean2DictionaryConverterTest {
024    
025        public Bean2DictionaryConverterTest() {
026        }
027    
028        @BeforeClass
029        public static void setUpClass() throws Exception {
030        }
031    
032        @AfterClass
033        public static void tearDownClass() throws Exception {
034        }
035    
036        @Before
037        public void setUp() {
038        }
039    
040        @After
041        public void tearDown() {
042        }
043    
044        /**
045         * Test of convert method, of class Bean2DictionaryConverter.
046         */
047        @Test
048        public void testConvert() {
049            System.out.println("convert");
050            Class<?> clazz = null;
051            Stack<DataDictionaryDefinitionBase> parentFields = null;
052            Stack<Class<?>> parentClasses = null;
053            Bean2DictionaryConverter instance = null;
054            DataObjectEntry result = null;
055            
056            clazz = AtpInfo.class;
057            parentFields = new Stack<DataDictionaryDefinitionBase>();
058            parentClasses = new Stack<Class<?>>();        
059            instance = new Bean2DictionaryConverter(clazz, parentFields, parentClasses);
060            result = instance.convert();
061            assertEquals(13, result.getAttributes().size());
062    
063            clazz = ExemptionInfo.class;
064            parentFields = new Stack<DataDictionaryDefinitionBase>();
065            parentClasses = new Stack<Class<?>>();        
066            instance = new Bean2DictionaryConverter(clazz, parentFields, parentClasses);
067            result = instance.convert();
068            assertEquals(22, result.getAttributes().size());        
069        }
070    }