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