You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ha...@apache.org on 2012/01/21 03:45:20 UTC

svn commit: r1234249 - in /camel/branches/camel-2.9.x: ./ components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java

Author: hadrian
Date: Sat Jan 21 02:45:19 2012
New Revision: 1234249

URL: http://svn.apache.org/viewvc?rev=1234249&view=rev
Log:
Merged revisions 1234112 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r1234112 | bvahdat | 2012-01-20 15:29:04 -0500 (Fri, 20 Jan 2012) | 1 line
  
  Avoid deprecated API usage
........

Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.9.x/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java?rev=1234249&r1=1234248&r2=1234249&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java (original)
+++ camel/branches/camel-2.9.x/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java Sat Jan 21 02:45:19 2012
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.dataformat.xmlsecurity;
 
-import java.net.URL;
-import java.security.KeyStore;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -140,15 +138,14 @@ public class XMLSecurityDataFormatTest e
 
     @Test
     public void testFullPayloadAsymmetricKeyEncryption() throws Exception {
-        KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
-        URL trustStoreUrl = getClass().getClassLoader().getResource("sender.ts");
-        trustStore.load(trustStoreUrl.openStream(), "password".toCharArray());
+        KeyStoreParameters tsParameters = new KeyStoreParameters();
+        tsParameters.setPassword("password");
+        tsParameters.setResource("sender.ts");
 
         final XMLSecurityDataFormat xmlEncDataFormat = new XMLSecurityDataFormat();
         xmlEncDataFormat.setKeyCipherAlgorithm(XMLCipher.RSA_v1dot5);
+        xmlEncDataFormat.setKeyOrTrustStoreParameters(tsParameters);
         xmlEncDataFormat.setXmlCipherAlgorithm(testCypherAlgorithm);
-        xmlEncDataFormat.setTrustStore(trustStore);
-        xmlEncDataFormat.setTrustStorePassword("password");
         xmlEncDataFormat.setRecipientKeyAlias("recipient");
 
         context.addRoutes(new RouteBuilder() {
@@ -162,7 +159,6 @@ public class XMLSecurityDataFormatTest e
 
     @Test
     public void testPartialPayloadAsymmetricKeyEncryptionWithContextTruststoreProperties() throws Exception {
-        
         final KeyStoreParameters tsParameters = new KeyStoreParameters();
         tsParameters.setPassword("password");
         tsParameters.setResource("sender.ts");
@@ -309,7 +305,6 @@ public class XMLSecurityDataFormatTest e
 
     @Test
     public void testPartialPayloadAsymmetricKeyDecryption() throws Exception {
-                
         final Map<String, String> namespaces = new HashMap<String, String>();
         namespaces.put("ns1", "http://cheese.xmlsecurity.camel.apache.org/");
         
@@ -333,7 +328,6 @@ public class XMLSecurityDataFormatTest e
     
     @Test
     public void testPartialPayloadAsymmetricKeyDecryptionCustomNS() throws Exception {
-        
         final KeyStoreParameters tsParameters = new KeyStoreParameters();
         tsParameters.setPassword("password");
         tsParameters.setResource("sender.ts");