package org.jboss.test.xml;
import org.jboss.resource.deployment.ResourceAdapterObjectModelFactory;
import org.jboss.xml.binding.Unmarshaller;
import org.jboss.xml.binding.ObjectModelFactory;
import org.xml.sax.InputSource;
import junit.framework.TestCase;
import java.net.URL;
import java.io.FileInputStream;
public class RARTestCase
extends TestCase
{
private Unmarshaller unmarshaller;
private InputSource inputSource;
public RARTestCase(String name)
{
super(name);
}
protected void setUp() throws Exception
{
super.setUp();
unmarshaller = new Unmarshaller();
String resourceName = "xml/" + getName() + ".xml";
final URL resource = Thread.currentThread().getContextClassLoader().getResource(resourceName);
assertNotNull("Null resource", resource);
inputSource = new InputSource(new FileInputStream(resource.getFile()));
}
public void testRARwithoutDTD() throws Exception
{
ObjectModelFactory factory = new ResourceAdapterObjectModelFactory();
Object metaData = unmarshaller.unmarshal(inputSource, factory, null);
assertNotNull("Null meta data", metaData);
}
public void testRARwithDTD() throws Exception
{
ObjectModelFactory factory = new ResourceAdapterObjectModelFactory();
Object metaData = unmarshaller.unmarshal(inputSource, factory, null);
assertNotNull("Null meta data", metaData);
}
public void testRARwithSchema() throws Exception
{
ObjectModelFactory factory = new ResourceAdapterObjectModelFactory();
Object metaData = unmarshaller.unmarshal(inputSource, factory, null);
assertNotNull("Null meta data", metaData);
}
}