You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2012/03/04 17:23:56 UTC

svn commit: r1296829 - in /axis/axis2/java/rampart/trunk/modules: rampart-integration/src/test/java/org/apache/rampart/RampartTest.java rampart-trust/src/main/java/org/apache/rahas/TokenRequestDispatcherConfig.java

Author: veithen
Date: Sun Mar  4 16:23:55 2012
New Revision: 1296829

URL: http://svn.apache.org/viewvc?rev=1296829&view=rev
Log:
Avoid direct references to Axiom implementation classes.

Modified:
    axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java
    axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/TokenRequestDispatcherConfig.java

Modified: axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java?rev=1296829&r1=1296828&r2=1296829&view=diff
==============================================================================
--- axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java (original)
+++ axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java Sun Mar  4 16:23:55 2012
@@ -21,7 +21,6 @@ import org.apache.axiom.om.OMAbstractFac
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.util.AXIOMUtil;
 import org.apache.axiom.soap.SOAPHeaderBlock;
 import org.apache.axis2.AxisFault;
@@ -271,8 +270,7 @@ public class RampartTest extends TestCas
     }
 
     private Policy loadPolicy(String xmlPath) throws Exception {
-        StAXOMBuilder builder = new StAXOMBuilder(RampartTest.class.getResourceAsStream(xmlPath));
-        return PolicyEngine.getPolicy(builder.getDocumentElement());
+        return PolicyEngine.getPolicy(RampartTest.class.getResourceAsStream(xmlPath));
     }
 
 

Modified: axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/TokenRequestDispatcherConfig.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/TokenRequestDispatcherConfig.java?rev=1296829&r1=1296828&r2=1296829&view=diff
==============================================================================
--- axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/TokenRequestDispatcherConfig.java (original)
+++ axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/TokenRequestDispatcherConfig.java Sun Mar  4 16:23:55 2012
@@ -17,7 +17,8 @@
 package org.apache.rahas;
 
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.ws.security.util.Loader;
 
 import javax.xml.namespace.QName;
@@ -261,12 +262,12 @@ public class TokenRequestDispatcherConfi
 
     public static TokenRequestDispatcherConfig load(String configFilePath) throws TrustException {
         FileInputStream fis;
-        StAXOMBuilder builder;
+        OMXMLParserWrapper builder;
         try {
             fis = new FileInputStream(configFilePath);
-            builder = new StAXOMBuilder(fis);
+            builder = OMXMLBuilderFactory.createOMBuilder(fis);
         } catch (Exception e) {
-            throw new TrustException("errorLoadingConfigFile", new String[]{configFilePath});
+            throw new TrustException("errorLoadingConfigFile", new String[]{configFilePath}, e);
         }
         return load(builder.getDocumentElement());
     }