package org.slc.sli.validation;

import static org.junit.Assert.*;

import java.util.HashMap;
import java.util.Map;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import org.slc.sli.validation.schema.NeutralSchema;

/**
 * JUnit for validating section
 * 
 * @author nbrown
 * 
 */
public class SectionValidation {
    private static final Logger LOG = LoggerFactory.getLogger(SectionValidation.class);
    
    @Autowired
    private SchemaRepository repo;
    
    @Test
    public void testSectionValidation() {
        NeutralSchema schema = repo.getSchema("section");
        Map<String, Object> goodSection = new HashMap<String, Object>();
        schema.validate(goodSection);
    }
}

@@ -141,16 +141,50 @@
 .Test;%0D%0A
+import org.junit.runner.RunWith;%0D%0A
 import o
@@ -201,16 +201,16 @@
 ogger;%0D%0A
-
 import o
@@ -297,16 +297,152 @@
 owired;%0D
+%0Aimport org.springframework.test.context.ContextConfiguration;%0D%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0D
 %0A%0D%0Aimpor
@@ -563,16 +563,135 @@
  %0D%0A */%0D%0A
+@RunWith(SpringJUnit4ClassRunner.class)%0D%0A@ContextConfiguration(locations = %7B %22/spring/applicationContext-test.xml%22 %7D)%0D%0A
 public c
@@ -978,24 +978,56 @@
 section%22);%0D%0A
+        assertNotNull(schema);%0D%0A
         Map%3C
@@ -1084,24 +1084,594 @@
 Object%3E();%0D%0A
+        goodSection.put(%22uniqueSectionCode%22, %22Math101%22);%0D%0A        goodSection.put(%22sequenceOfCourse%22, 1);%0D%0A        goodSection.put(%22educationalEnvironment%22, %22Classroom%22);%0D%0A        goodSection.put(%22mediumOfInstruction%22, %22Face-to-face instruction%22);%0D%0A        goodSection.put(%22populationServed%22, %22Regular Students%22);%0D%0A        Map%3CString, Object%3E credit = new HashMap%3CString, Object%3E();%0D%0A        credit.put(%22credit%22, 1.5);%0D%0A        credit.put(%22creditType%22, %22Semester hour credit%22);%0D%0A        credit.put(%22creditConversion%22, 2.5);%0D%0A        goodSection.put(%22credits%22, credit);%0D%0A
         sche

test for good section