You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by ra...@apache.org on 2006/10/18 20:45:35 UTC

svn commit: r465331 - in /xml/security/trunk: ./ src/org/apache/xml/security/utils/resolver/implementations/ src_unitTests/org/apache/xml/security/test/utils/ src_unitTests/org/apache/xml/security/test/utils/resolver/

Author: raul
Date: Wed Oct 18 11:45:33 2006
New Revision: 465331

URL: http://svn.apache.org/viewvc?view=rev&rev=465331
Log:
Fixed bug 40783

Added:
    xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/resolver/AllTests.java
    xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/resolver/ResolverDirectHTTP.java
Modified:
    xml/security/trunk/CHANGELOG.txt
    xml/security/trunk/src/org/apache/xml/security/utils/resolver/implementations/ResolverDirectHTTP.java
    xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/AllTests.java

Modified: xml/security/trunk/CHANGELOG.txt
URL: http://svn.apache.org/viewvc/xml/security/trunk/CHANGELOG.txt?view=diff&rev=465331&r1=465330&r2=465331
==============================================================================
--- xml/security/trunk/CHANGELOG.txt (original)
+++ xml/security/trunk/CHANGELOG.txt Wed Oct 18 11:45:33 2006
@@ -1,5 +1,8 @@
 Changelog for "Apache xml-security" <http://xml.apache.org/security/>
 New in ...
+    Fixed bug 40783
+
+New in 1.4RC1
 	Fixed bug 40512. Made TransformSPI backward compatible. Now it is possible 
 		to use implementations for the >1.3 versions paying the performance hit
 		of the old implementation.

Modified: xml/security/trunk/src/org/apache/xml/security/utils/resolver/implementations/ResolverDirectHTTP.java
URL: http://svn.apache.org/viewvc/xml/security/trunk/src/org/apache/xml/security/utils/resolver/implementations/ResolverDirectHTTP.java?view=diff&rev=465331&r1=465330&r2=465331
==============================================================================
--- xml/security/trunk/src/org/apache/xml/security/utils/resolver/implementations/ResolverDirectHTTP.java (original)
+++ xml/security/trunk/src/org/apache/xml/security/utils/resolver/implementations/ResolverDirectHTTP.java Wed Oct 18 11:45:33 2006
@@ -265,7 +265,7 @@
       	log.debug("I was asked whether I can resolve " + uriNodeValue);
 
       if ( uriNodeValue.startsWith("http:") ||
-				 BaseURI.startsWith("http:")) {
+				(BaseURI!=null && BaseURI.startsWith("http:") )) {
          if (log.isDebugEnabled())
          	log.debug("I state that I can resolve " + uriNodeValue);
 

Modified: xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/AllTests.java
URL: http://svn.apache.org/viewvc/xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/AllTests.java?view=diff&rev=465331&r1=465330&r2=465331
==============================================================================
--- xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/AllTests.java (original)
+++ xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/AllTests.java Wed Oct 18 11:45:33 2006
@@ -1,5 +1,7 @@
 package org.apache.xml.security.test.utils;
 
+import com.sun.corba.se.spi.resolver.Resolver;
+
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
@@ -13,6 +15,7 @@
 		suite.addTest(Base64Test.suite());
 		suite.addTestSuite(OldApiTest.class);
 		//$JUnit-END$
+		suite.addTest(org.apache.xml.security.test.utils.resolver.AllTests.suite());
 		return suite;
 	}
 

Added: xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/resolver/AllTests.java
URL: http://svn.apache.org/viewvc/xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/resolver/AllTests.java?view=auto&rev=465331
==============================================================================
--- xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/resolver/AllTests.java (added)
+++ xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/resolver/AllTests.java Wed Oct 18 11:45:33 2006
@@ -0,0 +1,18 @@
+package org.apache.xml.security.test.utils.resolver;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests  {
+
+	public static Test suite() {
+		TestSuite suite = new TestSuite(
+				"Test for org.apache.xml.security.test.utils.resolver");
+		//$JUnit-BEGIN$
+		suite.addTest(ResourceResolverTest.suite());
+		suite.addTestSuite(ResolverDirectHTTP.class);
+		//$JUnit-END$
+		return suite;
+	}
+
+}

Added: xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/resolver/ResolverDirectHTTP.java
URL: http://svn.apache.org/viewvc/xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/resolver/ResolverDirectHTTP.java?view=auto&rev=465331
==============================================================================
--- xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/resolver/ResolverDirectHTTP.java (added)
+++ xml/security/trunk/src_unitTests/org/apache/xml/security/test/utils/resolver/ResolverDirectHTTP.java Wed Oct 18 11:45:33 2006
@@ -0,0 +1,29 @@
+package org.apache.xml.security.test.utils.resolver;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.xml.security.Init;
+import org.apache.xml.security.utils.resolver.ResourceResolver;
+import org.apache.xml.security.utils.resolver.ResourceResolverException;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class ResolverDirectHTTP extends TestCase {
+  public void testBug40783() throws Exception{
+	  Init.init();
+	  Document doc=DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();		
+	  Attr uri=doc.createAttribute("id");
+	  uri.setNodeValue("urn:ddd:uuu");
+	  ((Element)doc.createElement("test")).setAttributeNode(uri);
+	  try {
+		  ResourceResolver resolver=ResourceResolver.getInstance(uri, null);		  
+		  fail("No exception throw, but resolver found:"+resolver);
+	  } catch (ResourceResolverException e) {
+		  
+	  }
+	}
+  
+}