Package org.milyn.xml

Source Code of org.milyn.xml.NamespaceMappingsTest

/*
  Milyn - Copyright (C) 2006 - 2010

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License (version 2.1) as published by the Free Software
  Foundation.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  See the GNU Lesser General Public License for more details:
  http://www.gnu.org/licenses/lgpl.txt
*/
package org.milyn.xml;

import java.io.IOException;
import java.util.Properties;

import org.milyn.Smooks;
import org.milyn.container.ApplicationContext;
import org.milyn.container.ExecutionContext;
import org.xml.sax.SAXException;

import junit.framework.TestCase;

/**
* @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly@jboss.com</a>
*/
public class NamespaceMappingsTest extends TestCase {

  public void test_01() throws IOException, SAXException {
    Smooks smooks = new Smooks(getClass().getResourceAsStream("config-01.xml"));   
    ExecutionContext execContext = smooks.createExecutionContext();
    ApplicationContext appContext = execContext.getContext();
    Properties mappings = NamespaceMappings.getMappings(appContext);

    assertEquals("http://a", mappings.getProperty("a"));
    assertEquals("http://b", mappings.getProperty("b"));
    assertEquals("http://c", mappings.getProperty("c"));
  }
}
TOP

Related Classes of org.milyn.xml.NamespaceMappingsTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.