1 22 package org.jboss.test.xml; 23 24 import org.jboss.resource.deployment.ResourceAdapterObjectModelFactory; 25 import org.jboss.xb.binding.ObjectModelFactory; 26 import org.jboss.xb.binding.Unmarshaller; 27 import org.jboss.xb.binding.UnmarshallerFactory; 28 29 import junit.framework.TestCase; 30 31 import java.net.URL ; 32 33 34 39 public class RARTestCase 40 extends TestCase 41 { 42 private Unmarshaller unmarshaller; 43 private String systemId; 44 45 public RARTestCase(String name) 46 { 47 super(name); 48 } 49 50 protected void setUp() throws Exception 52 { 53 super.setUp(); 54 55 unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller(); 56 String resourceName = "xml/" + getName() + ".xml"; 57 final URL resource = Thread.currentThread().getContextClassLoader().getResource(resourceName); 58 assertNotNull("Null resource", resource); 59 systemId = resource.toString(); 60 } 61 62 65 public void testRARwithoutDTD() throws Exception 66 { 67 ObjectModelFactory factory = new ResourceAdapterObjectModelFactory(); 68 Object metaData = unmarshaller.unmarshal(systemId, factory, null); 69 assertNotNull("Null meta data", metaData); 70 } 71 72 75 public void testRARwithDTD() throws Exception 76 { 77 ObjectModelFactory factory = new ResourceAdapterObjectModelFactory(); 78 Object metaData = unmarshaller.unmarshal(systemId, factory, null); 79 assertNotNull("Null meta data", metaData); 80 } 81 82 85 public void testRARwithSchema() throws Exception 86 { 87 ObjectModelFactory factory = new ResourceAdapterObjectModelFactory(); 88 Object metaData = unmarshaller.unmarshal(systemId, factory, null); 89 assertNotNull("Null meta data", metaData); 90 } 91 } 92 | Popular Tags |