1 15 package org.apache.hivemind.parse; 16 17 import hivemind.test.FrameworkTestCase; 18 19 import java.net.URL ; 20 21 import org.apache.hivemind.ApplicationRuntimeException; 22 import org.apache.hivemind.Resource; 23 import org.apache.hivemind.impl.DefaultErrorHandler; 24 import org.apache.hivemind.util.FileResource; 25 import org.apache.hivemind.util.URLResource; 26 27 public class TestXmlResourceProcessor extends FrameworkTestCase 28 { 29 public void testMissingURLResource() throws Exception 30 { 31 XmlResourceProcessor processor = new XmlResourceProcessor(getClassResolver(), 32 new DefaultErrorHandler()); 33 34 Resource[] missingResources = new Resource[] 35 { new FileResource("foo"), new URLResource(new URL ("file://MissingFile")) }; 36 37 for (int i = 0; i < missingResources.length; i++) 38 { 39 try 40 { 41 processor.processResource(missingResources[i]); 42 43 fail(); 44 } 45 catch (ApplicationRuntimeException e) 46 { 47 assertEquals(ParseMessages.missingResource(missingResources[i]), e.getMessage()); 48 49 } 50 } 51 } 52 } | Popular Tags |