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