001/* 002 * Copyright 2012 The Kuali Foundation. 003 * 004 * Licensed under the Educational Community License, Version 1.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl1.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.ole.ingest; 017 018import org.apache.commons.io.IOUtils; 019import org.apache.log4j.Logger; 020import org.junit.Test; 021 022import java.io.ByteArrayInputStream; 023 024import static junit.framework.Assert.assertTrue; 025 026public class ProfileXMLSchemaValidation_UT { 027 028 private static final Logger LOG = Logger.getLogger(ProfileXMLSchemaValidation_UT.class); 029 private static final String PROFILE_XML_FILE = "profile.xml"; 030 031 @Test 032 public void testProfileXMLSchemaValidation() throws Exception { 033 byte[] profileByteArray; 034 profileByteArray = IOUtils.toByteArray(getClass().getResourceAsStream(PROFILE_XML_FILE)); 035 ByteArrayInputStream profileSchemaByteArray = new ByteArrayInputStream(profileByteArray); 036 ProfileXMLSchemaValidator profileXMLSchemaValidator = new ProfileXMLSchemaValidator(); 037 boolean schemaFlag=profileXMLSchemaValidator.validateContentsAgainstSchema(profileSchemaByteArray); 038 assertTrue(schemaFlag); 039 } 040}