1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.ingest;
17 import java.io.ByteArrayInputStream;
18 import java.io.InputStream;
19
20 import org.apache.commons.io.IOUtils;
21 import org.apache.log4j.Logger;
22 import org.junit.Test;
23 import org.kuali.ole.OleBaseTestCase;
24
25 import static junit.framework.Assert.assertTrue;
26
27 public class ProfileXMLSchemaValidation_UT extends OleBaseTestCase {
28
29 private static final Logger LOG = Logger.getLogger(ProfileXMLSchemaValidation_UT.class);
30 private static final String PROFILE_XML_FILE = "profile.xml";
31
32 @Test
33 public void testProfileXMLSchemaValidation() throws Exception {
34 byte[] profileByteArray;
35 profileByteArray = IOUtils.toByteArray(getClass().getResourceAsStream(PROFILE_XML_FILE));
36 ByteArrayInputStream profileSchemaByteArray = new ByteArrayInputStream(profileByteArray);
37 ProfileXMLSchemaValidator profileXMLSchemaValidator = new ProfileXMLSchemaValidator();
38 boolean schemaFlag=profileXMLSchemaValidator.validateContentsAgainstSchema(profileSchemaByteArray);
39 assertTrue(schemaFlag);
40 }
41 }