[java-opensaml COMMIT] in /trunk: opensaml-soap-impl/src/test/java/org/opensaml/ws/BaseTestCase.java opensaml-temp/sr...

noreply at shibboleth.net noreply at shibboleth.net
Tue Mar 27 20:30:42 BST 2012


Author: putmanb
Date: Tue Mar 27 20:30:42 2012
New Revision: 2960

URL: http://svn.shibboleth.net/view/java-opensaml?rev=2960&view=rev
Log:
Fix some unit tests failing due to refactoring.

Modified:
    trunk/opensaml-soap-impl/src/test/java/org/opensaml/ws/BaseTestCase.java
    trunk/opensaml-temp/src/main/java/org/opensaml/ws/message/decoder/BaseMessageDecoder.java

Modified: trunk/opensaml-soap-impl/src/test/java/org/opensaml/ws/BaseTestCase.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-soap-impl/src/test/java/org/opensaml/ws/BaseTestCase.java?rev=2960&r1=2959&r2=2960&view=diff
==============================================================================
--- trunk/opensaml-soap-impl/src/test/java/org/opensaml/ws/BaseTestCase.java (original)
+++ trunk/opensaml-soap-impl/src/test/java/org/opensaml/ws/BaseTestCase.java Tue Mar 27 20:30:42 2012
@@ -21,11 +21,13 @@
 
 import junit.framework.TestCase;
 import net.shibboleth.utilities.java.support.xml.BasicParserPool;
+import net.shibboleth.utilities.java.support.xml.ParserPool;
 import net.shibboleth.utilities.java.support.xml.SerializeSupport;
 
 import org.custommonkey.xmlunit.Diff;
 import org.custommonkey.xmlunit.XMLAssert;
 import org.custommonkey.xmlunit.XMLUnit;
+import org.opensaml.core.config.InitializationService;
 import org.opensaml.xml.XMLObjectProviderRegistrySupport;
 import org.opensaml.xml.XMLConfigurator;
 import org.opensaml.xml.XMLObject;
@@ -48,7 +50,7 @@
     private final Logger log = LoggerFactory.getLogger(BaseTestCase.class);
 
     /** Parser pool. */
-    protected static BasicParserPool parserPool;
+    protected static ParserPool parserPool;
 
     /** XMLObject builder factory. */
     protected static XMLObjectBuilderFactory builderFactory;
@@ -64,29 +66,13 @@
         super.setUp();
         XMLUnit.setIgnoreWhitespace(true);
         
-        parserPool = new BasicParserPool();
-        parserPool.setNamespaceAware(true);
-        parserPool.initialize();
-
-        Class clazz = BaseTestCase.class;
-        try {
-
-            // Configuration Files
-            Document wsfedConfig = parserPool.parse(clazz.getResourceAsStream("/wsfed11-protocol-config.xml"));
-            Document soap11Config = parserPool.parse(clazz.getResourceAsStream("/soap11-config.xml"));
-            Document defaulfConfig = parserPool.parse(clazz.getResourceAsStream("/default-config.xml"));
-            
-            XMLConfigurator configurator = new XMLConfigurator();
-            configurator.load(wsfedConfig);
-            configurator.load(soap11Config);
-            configurator.load(defaulfConfig);
-
-            builderFactory = XMLObjectProviderRegistrySupport.getBuilderFactory();
-            marshallerFactory = XMLObjectProviderRegistrySupport.getMarshallerFactory();
-            unmarshallerFactory = XMLObjectProviderRegistrySupport.getUnmarshallerFactory();
-        } catch (Exception e) {
-            System.err.println("Can not initialize test suite, " + e.getMessage());
-        }
+        InitializationService.initialize();
+        
+        parserPool = XMLObjectProviderRegistrySupport.getParserPool();
+        builderFactory = XMLObjectProviderRegistrySupport.getBuilderFactory();
+        marshallerFactory = XMLObjectProviderRegistrySupport.getMarshallerFactory();
+        unmarshallerFactory = XMLObjectProviderRegistrySupport.getUnmarshallerFactory();
+        
     }
 
     /**

Modified: trunk/opensaml-temp/src/main/java/org/opensaml/ws/message/decoder/BaseMessageDecoder.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-temp/src/main/java/org/opensaml/ws/message/decoder/BaseMessageDecoder.java?rev=2960&r1=2959&r2=2960&view=diff
==============================================================================
--- trunk/opensaml-temp/src/main/java/org/opensaml/ws/message/decoder/BaseMessageDecoder.java (original)
+++ trunk/opensaml-temp/src/main/java/org/opensaml/ws/message/decoder/BaseMessageDecoder.java Tue Mar 27 20:30:42 2012
@@ -57,7 +57,7 @@
 
     /** Constructor. */
     public BaseMessageDecoder() {
-        parserPool = new BasicParserPool();
+        parserPool = XMLObjectProviderRegistrySupport.getParserPool();
     }
 
     /**



More information about the commits mailing list