hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject cvs commit: jakarta-hivemind/framework/src/test/org/apache/hivemind/parse TestXmlResourceProcessor.java
Date Sat, 19 Feb 2005 19:08:52 GMT
knut        2005/02/19 11:08:52

  Modified:    framework/src/test/org/apache/hivemind/parse
                        TestXmlResourceProcessor.java
  Log:
  fix for HIVEMIND-81 (Null pointer exception when module resource does not exist)
  
  Revision  Changes    Path
  1.2       +18 -11    jakarta-hivemind/framework/src/test/org/apache/hivemind/parse/TestXmlResourceProcessor.java
  
  Index: TestXmlResourceProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/org/apache/hivemind/parse/TestXmlResourceProcessor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestXmlResourceProcessor.java	19 Feb 2005 16:56:11 -0000	1.1
  +++ TestXmlResourceProcessor.java	19 Feb 2005 19:08:52 -0000	1.2
  @@ -14,32 +14,39 @@
   
   package org.apache.hivemind.parse;
   
  +import hivemind.test.FrameworkTestCase;
  +
  +import java.net.URL;
  +
   import org.apache.hivemind.ApplicationRuntimeException;
   import org.apache.hivemind.Resource;
   import org.apache.hivemind.impl.DefaultClassResolver;
   import org.apache.hivemind.impl.DefaultErrorHandler;
   import org.apache.hivemind.util.FileResource;
  -
  -import hivemind.test.FrameworkTestCase;
  +import org.apache.hivemind.util.URLResource;
   
   public class TestXmlResourceProcessor extends FrameworkTestCase
   {
  -    public void testMissingResource() throws Exception
  +    public void testMissingURLResource() throws Exception
       {
           XmlResourceProcessor processor = new XmlResourceProcessor(new DefaultClassResolver(),
                   new DefaultErrorHandler());
   
  -        Resource missingResource = new FileResource("foo");
  +        Resource[] missingResources = new Resource[]
  +        { new FileResource("foo"), new URLResource(new URL("http://www.foo.com/foo")) };
   
  -        try
  +        for (int i = 0; i < missingResources.length; i++)
           {
  -            processor.processResource(missingResource);
  +            try
  +            {
  +                processor.processResource(missingResources[i]);
   
  -            fail();
  -        }
  -        catch (ApplicationRuntimeException e)
  -        {
  -            assertEquals(ParseMessages.missingResource(missingResource), e.getMessage());
  +                fail();
  +            }
  +            catch (ApplicationRuntimeException e)
  +            {
  +                assertEquals(ParseMessages.missingResource(missingResources[i]), e.getMessage());
  +            }
           }
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org


Mime
View raw message