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 2011/06/24 23:56:22 UTC
svn commit: r1139452 - in /camel/trunk:
camel-core/src/test/java/org/apache/camel/util/jsse/
components/camel-apns/src/test/java/org/apache/camel/component/apns/
components/camel-apns/src/test/java/org/apache/camel/component/apns/factory/
components/ca...
Author: hadrian
Date: Fri Jun 24 21:56:22 2011
New Revision: 1139452
URL: http://svn.apache.org/viewvc?rev=1139452&view=rev
Log:
CAMEL-4084. Patch applied with thanks to Dan Kulp
Modified:
camel/trunk/camel-core/src/test/java/org/apache/camel/util/jsse/SSLContextParametersTest.java
camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerTest.java
camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerTest.java
camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerWithoutTokensHeaderTest.java
camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/factory/ApnsServiceFactoryTest.java
camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/spring/SpringApnsConsumerTest.java
camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/util/ApnsUtils.java
camel/trunk/components/camel-apns/src/test/resources/org/apache/camel/component/apns/spring/SpringApnsConsumerTest-context.xml
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpServerTestSupport.java
camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java
camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerConsumerTest.java
camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerFileWriteTest.java
camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerSplitTest.java
camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerTest.java
camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsServerTestSupport.java
camel/trunk/components/camel-tagsoup/pom.xml
camel/trunk/components/camel-web/pom.xml
camel/trunk/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityConcurrencyTest.java
camel/trunk/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java
camel/trunk/parent/pom.xml
Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/util/jsse/SSLContextParametersTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/util/jsse/SSLContextParametersTest.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/util/jsse/SSLContextParametersTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/util/jsse/SSLContextParametersTest.java Fri Jun 24 21:56:22 2011
@@ -16,6 +16,7 @@
*/
package org.apache.camel.util.jsse;
+import java.security.Security;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
@@ -264,6 +265,18 @@ public class SSLContextParametersTest ex
assertEquals(12345, context.getServerSessionContext().getSessionTimeout());
}
+ private void checkProtocols(String[] control, String[] configured) {
+ //With the IBM JDK, an "default" unconfigured control socket is more
+ //restricted than with the Sun JDK. For example, with
+ //SSLContext.getInstance("TLS"), on Sun, you get
+ // TLSv1, SSLv3, SSLv2Hello
+ //but with IBM, you only get:
+ // TLSv1
+ //We'll check to make sure the "default" protocols are amongst the list
+ //that are in after configuration.
+ assertTrue(Arrays.asList(configured).containsAll(Arrays.asList(control)));
+ }
+
public void testClientParameters() throws Exception {
SSLContext controlContext = SSLContext.getInstance("TLS");
controlContext.init(null, null, null);
@@ -271,7 +284,6 @@ public class SSLContextParametersTest ex
SSLSocket controlSocket = (SSLSocket) controlContext.getSocketFactory().createSocket();
SSLServerSocket controlServerSocket = (SSLServerSocket) controlContext.getServerSocketFactory().createServerSocket();
-
SSLContextParameters scp = new SSLContextParameters();
SSLContextClientParameters sccp = new SSLContextClientParameters();
@@ -345,7 +357,7 @@ public class SSLContextParametersTest ex
assertTrue(Arrays.equals(controlEngine.getEnabledProtocols(), engine.getEnabledProtocols()));
assertEquals(0, socket.getEnabledProtocols().length);
- assertTrue(Arrays.equals(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols()));
+ checkProtocols(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols());
// Secure socket protocols filter on client params
filter = new FilterParameters();
@@ -358,8 +370,8 @@ public class SSLContextParametersTest ex
assertTrue(Arrays.equals(controlEngine.getEnabledProtocols(), engine.getEnabledProtocols()));
assertEquals(0, socket.getEnabledProtocols().length);
- assertTrue(Arrays.equals(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols()));
-
+ checkProtocols(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols());
+
// Sspp on client params overrides secure socket protocols filter on client
filter.getInclude().add(".*");
filter.getExclude().clear();
@@ -371,7 +383,7 @@ public class SSLContextParametersTest ex
assertTrue(Arrays.equals(controlEngine.getEnabledProtocols(), engine.getEnabledProtocols()));
assertEquals(0, socket.getEnabledProtocols().length);
- assertTrue(Arrays.equals(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols()));
+ checkProtocols(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols());
// Client session timeout only affects client session configuration
sccp.setSessionTimeout("12345");
@@ -469,7 +481,7 @@ public class SSLContextParametersTest ex
assertTrue(Arrays.equals(controlEngine.getEnabledProtocols(), engine.getEnabledProtocols()));
assertTrue(Arrays.equals(controlSocket.getEnabledProtocols(), socket.getEnabledProtocols()));
- assertTrue(Arrays.equals(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols()));
+ checkProtocols(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols());
// empty filter
@@ -494,8 +506,8 @@ public class SSLContextParametersTest ex
assertTrue(Arrays.equals(controlEngine.getEnabledProtocols(), engine.getEnabledProtocols()));
assertTrue(Arrays.equals(controlSocket.getEnabledProtocols(), socket.getEnabledProtocols()));
- assertTrue(Arrays.equals(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols()));
-
+ checkProtocols(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols());
+
// explicit filter with excludes (excludes overrides)
filter.getExclude().add(".*");
context = scp.createSSLContext();
@@ -543,7 +555,7 @@ public class SSLContextParametersTest ex
assertTrue(Arrays.equals(controlEngine.getEnabledProtocols(), engine.getEnabledProtocols()));
assertTrue(Arrays.equals(controlSocket.getEnabledProtocols(), socket.getEnabledProtocols()));
- assertTrue(Arrays.equals(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols()));
+ checkProtocols(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols());
// empty sspp
@@ -609,8 +621,8 @@ public class SSLContextParametersTest ex
assertTrue(Arrays.equals(controlEngine.getEnabledProtocols(), engine.getEnabledProtocols()));
assertTrue(Arrays.equals(controlSocket.getEnabledProtocols(), socket.getEnabledProtocols()));
- assertTrue(Arrays.equals(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols()));
-
+ checkProtocols(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols());
+
// empty filter
FilterParameters filter = new FilterParameters();
@@ -634,8 +646,8 @@ public class SSLContextParametersTest ex
assertTrue(Arrays.equals(controlEngine.getEnabledProtocols(), engine.getEnabledProtocols()));
assertTrue(Arrays.equals(controlSocket.getEnabledProtocols(), socket.getEnabledProtocols()));
- assertTrue(Arrays.equals(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols()));
-
+ checkProtocols(controlServerSocket.getEnabledProtocols(), serverSocket.getEnabledProtocols());
+
// explicit filter with excludes (excludes overrides)
filter.getExclude().add(".*");
context = scp.createSSLContext();
Modified: camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerTest.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerTest.java (original)
+++ camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerTest.java Fri Jun 24 21:56:22 2011
@@ -45,7 +45,7 @@ public class ApnsConsumerTest extends Ca
@Before
public void startup() throws InterruptedException {
- server = ApnsServerStub.prepareAndStartServer(FixedCertificates.TEST_GATEWAY_PORT, FixedCertificates.TEST_FEEDBACK_PORT);
+ server = ApnsUtils.prepareAndStartServer(FixedCertificates.TEST_GATEWAY_PORT, FixedCertificates.TEST_FEEDBACK_PORT);
}
@After
Modified: camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerTest.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerTest.java (original)
+++ camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerTest.java Fri Jun 24 21:56:22 2011
@@ -47,7 +47,7 @@ public class ApnsProducerTest extends Ca
@Before
public void startup() {
- server = ApnsServerStub.prepareAndStartServer(FixedCertificates.TEST_GATEWAY_PORT, FixedCertificates.TEST_FEEDBACK_PORT);
+ server = ApnsUtils.prepareAndStartServer(FixedCertificates.TEST_GATEWAY_PORT, FixedCertificates.TEST_FEEDBACK_PORT);
}
@After
Modified: camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerWithoutTokensHeaderTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerWithoutTokensHeaderTest.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerWithoutTokensHeaderTest.java (original)
+++ camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerWithoutTokensHeaderTest.java Fri Jun 24 21:56:22 2011
@@ -46,7 +46,7 @@ public class ApnsProducerWithoutTokensHe
@Before
public void startup() {
- server = ApnsServerStub.prepareAndStartServer(FixedCertificates.TEST_GATEWAY_PORT, FixedCertificates.TEST_FEEDBACK_PORT);
+ server = ApnsUtils.prepareAndStartServer(FixedCertificates.TEST_GATEWAY_PORT, FixedCertificates.TEST_FEEDBACK_PORT);
}
@After
Modified: camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/factory/ApnsServiceFactoryTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/factory/ApnsServiceFactoryTest.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/factory/ApnsServiceFactoryTest.java (original)
+++ camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/factory/ApnsServiceFactoryTest.java Fri Jun 24 21:56:22 2011
@@ -20,6 +20,7 @@ import com.notnoop.apns.ApnsService;
import com.notnoop.apns.utils.FixedCertificates;
import org.apache.camel.component.apns.model.ConnectionStrategy;
+import org.apache.camel.component.apns.util.ApnsUtils;
import org.junit.Assert;
import org.junit.Test;
@@ -27,7 +28,7 @@ import org.junit.Test;
public class ApnsServiceFactoryTest {
@Test
- public void testApnsServiceFactoryWithFixedCertificates() {
+ public void testApnsServiceFactoryWithFixedCertificates() throws Exception {
ApnsServiceFactory apnsServiceFactory = createApnsServiceFactoryWithFixedCertificates();
ApnsService apnsService = apnsServiceFactory.getApnsService();
@@ -35,7 +36,7 @@ public class ApnsServiceFactoryTest {
}
@Test(expected = IllegalArgumentException.class)
- public void testApnsServiceFactoryAsPool0() {
+ public void testApnsServiceFactoryAsPool0() throws Exception {
ApnsServiceFactory apnsServiceFactory = createApnsServiceFactoryWithFixedCertificatesAsPool(0);
ApnsService apnsService = apnsServiceFactory.getApnsService();
@@ -43,7 +44,7 @@ public class ApnsServiceFactoryTest {
}
@Test
- public void testApnsServiceFactoryAsPool1() {
+ public void testApnsServiceFactoryAsPool1() throws Exception {
ApnsServiceFactory apnsServiceFactory = createApnsServiceFactoryWithFixedCertificatesAsPool(1);
ApnsService apnsService = apnsServiceFactory.getApnsService();
@@ -55,19 +56,21 @@ public class ApnsServiceFactoryTest {
Assert.assertTrue(apnsService instanceof ApnsService);
}
- public static ApnsServiceFactory createApnsServiceFactoryWithFixedCertificates() {
+ public static ApnsServiceFactory createApnsServiceFactoryWithFixedCertificates()
+ throws Exception {
ApnsServiceFactory apnsServiceFactory = new ApnsServiceFactory();
apnsServiceFactory.setFeedbackHost(FixedCertificates.TEST_HOST);
apnsServiceFactory.setFeedbackPort(FixedCertificates.TEST_FEEDBACK_PORT);
apnsServiceFactory.setGatewayHost(FixedCertificates.TEST_HOST);
apnsServiceFactory.setGatewayPort(FixedCertificates.TEST_GATEWAY_PORT);
- apnsServiceFactory.setSslContext(FixedCertificates.clientContext());
+ apnsServiceFactory.setSslContext(ApnsUtils.clientContext());
return apnsServiceFactory;
}
- private ApnsServiceFactory createApnsServiceFactoryWithFixedCertificatesAsPool(int poolSize) {
+ private ApnsServiceFactory createApnsServiceFactoryWithFixedCertificatesAsPool(int poolSize)
+ throws Exception {
ApnsServiceFactory apnsServiceFactory = createApnsServiceFactoryWithFixedCertificates();
apnsServiceFactory.setConnectionStrategy(ConnectionStrategy.POOL);
Modified: camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/spring/SpringApnsConsumerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/spring/SpringApnsConsumerTest.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/spring/SpringApnsConsumerTest.java (original)
+++ camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/spring/SpringApnsConsumerTest.java Fri Jun 24 21:56:22 2011
@@ -52,7 +52,7 @@ public class SpringApnsConsumerTest exte
@Before
public void startup() throws InterruptedException {
- server = ApnsServerStub.prepareAndStartServer(FixedCertificates.TEST_GATEWAY_PORT, FixedCertificates.TEST_FEEDBACK_PORT);
+ server = ApnsUtils.prepareAndStartServer(FixedCertificates.TEST_GATEWAY_PORT, FixedCertificates.TEST_FEEDBACK_PORT);
}
@After
Modified: camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/util/ApnsUtils.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/util/ApnsUtils.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/util/ApnsUtils.java (original)
+++ camel/trunk/components/camel-apns/src/test/java/org/apache/camel/component/apns/util/ApnsUtils.java Fri Jun 24 21:56:22 2011
@@ -16,10 +16,25 @@
*/
package org.apache.camel.component.apns.util;
+import java.io.InputStream;
+import java.security.Provider;
+import java.security.Provider.Service;
+import java.security.SecureRandom;
+import java.security.Security;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Random;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.X509TrustManager;
+
import com.notnoop.apns.internal.ApnsFeedbackParsingUtilsAcessor;
import com.notnoop.apns.internal.Utilities;
+import com.notnoop.apns.utils.ApnsServerStub;
import com.notnoop.apns.utils.FixedCertificates;
import org.apache.camel.CamelContext;
@@ -45,8 +60,63 @@ public final class ApnsUtils {
return deviceToken;
}
-
- public static ApnsServiceFactory createDefaultTestConfiguration(CamelContext camelContext) {
+
+ public static ApnsServerStub prepareAndStartServer(int gatePort, int feedPort) {
+ InputStream stream = ClassLoader.getSystemResourceAsStream(FixedCertificates.SERVER_STORE);
+ SSLContext context = Utilities.newSSLContext(stream, FixedCertificates.SERVER_PASSWD,
+ "PKCS12", getAlgorithm());
+
+
+ ApnsServerStub server = new ApnsServerStub(
+ context.getServerSocketFactory(),
+ gatePort, feedPort);
+ server.start();
+ return server;
+ }
+
+ public static String getAlgorithm() {
+ List<String> keys = new LinkedList<String>();
+ List<String> trusts = new LinkedList<String>();
+ for (Provider p : Security.getProviders()) {
+ for (Service s : p.getServices()) {
+ if ("KeyManagerFactory".equals(s.getType())
+ && s.getAlgorithm().endsWith("509")) {
+ keys.add(s.getAlgorithm());
+ } else if ("TrustManagerFactory".equals(s.getType())
+ && s.getAlgorithm().endsWith("509")) {
+ trusts.add(s.getAlgorithm());
+ }
+ }
+ }
+ keys.retainAll(trusts);
+ return keys.get(0);
+ }
+
+ public static SSLContext clientContext() throws Exception {
+ InputStream stream = ClassLoader.getSystemResourceAsStream(FixedCertificates.CLIENT_STORE);
+ SSLContext context = Utilities.newSSLContext(stream,
+ FixedCertificates.CLIENT_PASSWD,
+ "PKCS12",
+ getAlgorithm());
+ context.init(null, new TrustManager[] {new X509TrustManager() {
+ public void checkClientTrusted(X509Certificate[] chain, String authType)
+ throws CertificateException {
+ }
+
+ public void checkServerTrusted(X509Certificate[] chain, String authType)
+ throws CertificateException {
+ }
+
+ public X509Certificate[] getAcceptedIssuers() {
+ return null;
+ }
+
+ }}, new SecureRandom());
+ return context;
+ }
+
+ public static ApnsServiceFactory createDefaultTestConfiguration(CamelContext camelContext)
+ throws Exception {
ApnsServiceFactory apnsServiceFactory = new ApnsServiceFactory(camelContext);
apnsServiceFactory.setFeedbackHost(FixedCertificates.TEST_HOST);
@@ -56,8 +126,7 @@ public final class ApnsUtils {
// apnsServiceFactory.setCertificatePath("classpath:/" +
// FixedCertificates.CLIENT_STORE);
// apnsServiceFactory.setCertificatePassword(FixedCertificates.CLIENT_PASSWD);
- apnsServiceFactory.setSslContext(FixedCertificates.clientContext());
-
+ apnsServiceFactory.setSslContext(clientContext());
return apnsServiceFactory;
}
Modified: camel/trunk/components/camel-apns/src/test/resources/org/apache/camel/component/apns/spring/SpringApnsConsumerTest-context.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-apns/src/test/resources/org/apache/camel/component/apns/spring/SpringApnsConsumerTest-context.xml?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-apns/src/test/resources/org/apache/camel/component/apns/spring/SpringApnsConsumerTest-context.xml (original)
+++ camel/trunk/components/camel-apns/src/test/resources/org/apache/camel/component/apns/spring/SpringApnsConsumerTest-context.xml Fri Jun 24 21:56:22 2011
@@ -36,7 +36,7 @@
<bean id="apnsService" factory-bean="apnsServiceFactory" factory-method="getApnsService"/>
- <bean id="sslContext" class="com.notnoop.apns.utils.FixedCertificates" factory-method="clientContext"/>
+ <bean id="sslContext" class="org.apache.camel.component.apns.util.ApnsUtils" factory-method="clientContext"/>
<bean id="apns" class="org.apache.camel.component.apns.ApnsComponent">
<property name="apnsService" ref="apnsService"/>
Modified: camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpServerTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpServerTestSupport.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpServerTestSupport.java (original)
+++ camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpServerTestSupport.java Fri Jun 24 21:56:22 2011
@@ -17,6 +17,9 @@
package org.apache.camel.component.file.remote.sftp;
import java.security.NoSuchAlgorithmException;
+import java.security.Provider;
+import java.security.Provider.Service;
+import java.security.Security;
import java.util.Arrays;
import org.apache.camel.component.file.remote.BaseServerTestSupport;
@@ -45,7 +48,24 @@ public class SftpServerTestSupport exten
public void setUp() throws Exception {
deleteDirectory(FTP_ROOT_DIR);
+
+
canTest = false;
+ for (Provider p : Security.getProviders()) {
+ for (Service s : p.getServices()) {
+ if ("SunX509".equalsIgnoreCase(s.getAlgorithm())) {
+ canTest = true;
+ }
+ }
+ }
+ if (!canTest) {
+ String name = System.getProperty("java.vendor");
+ System.out.println("SunX509 is not avail on this jdk ["
+ + name + "] Testing is skipped!");
+ return;
+ }
+ canTest = false;
+
try {
super.setUp();
Modified: camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java (original)
+++ camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java Fri Jun 24 21:56:22 2011
@@ -47,14 +47,30 @@ import static org.apache.hadoop.io.Seque
import static org.apache.hadoop.io.SequenceFile.createWriter;
public class HdfsConsumerTest extends CamelTestSupport {
+ //Hadoop doesn't run on IBM JDK
+ private static final boolean SKIP = System.getProperty("java.vendor").contains("IBM");
+
@Override
public boolean isUseRouteBuilder() {
return false;
}
+
+ @Before
+ public void setUp() throws Exception {
+ if (SKIP) {
+ return;
+ }
+ super.setUp();
+ }
+
@Test
public void testSimpleConsumer() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
final Path file = new Path(new File("target/test/test-camel-normal-file").getAbsolutePath());
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(file.toUri(), conf);
@@ -79,6 +95,10 @@ public class HdfsConsumerTest extends Ca
@Test
public void testReadBoolean() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
final Path file = new Path(new File("target/test/test-camel-boolean").getAbsolutePath());
Configuration conf = new Configuration();
FileSystem fs1 = FileSystem.get(file.toUri(), conf);
@@ -108,6 +128,10 @@ public class HdfsConsumerTest extends Ca
@Test
public void testReadByte() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
final Path file = new Path(new File("target/test/test-camel-byte").getAbsolutePath());
Configuration conf = new Configuration();
FileSystem fs1 = FileSystem.get(file.toUri(), conf);
@@ -138,6 +162,10 @@ public class HdfsConsumerTest extends Ca
@Test
public void testReadFloat() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
final Path file = new Path(new File("target/test/test-camel-float").getAbsolutePath());
Configuration conf = new Configuration();
FileSystem fs1 = FileSystem.get(file.toUri(), conf);
@@ -168,6 +196,9 @@ public class HdfsConsumerTest extends Ca
@Test
public void testReadDouble() throws Exception {
+ if (SKIP) {
+ return;
+ }
final Path file = new Path(new File("target/test/test-camel-double").getAbsolutePath());
Configuration conf = new Configuration();
FileSystem fs1 = FileSystem.get(file.toUri(), conf);
@@ -198,6 +229,10 @@ public class HdfsConsumerTest extends Ca
@Test
public void testReadInt() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
final Path file = new Path(new File("target/test/test-camel-int").getAbsolutePath());
Configuration conf = new Configuration();
FileSystem fs1 = FileSystem.get(file.toUri(), conf);
@@ -228,6 +263,10 @@ public class HdfsConsumerTest extends Ca
@Test
public void testReadLong() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
final Path file = new Path(new File("target/test/test-camel-long").getAbsolutePath());
Configuration conf = new Configuration();
FileSystem fs1 = FileSystem.get(file.toUri(), conf);
@@ -258,6 +297,10 @@ public class HdfsConsumerTest extends Ca
@Test
public void testReadBytes() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
final Path file = new Path(new File("target/test/test-camel-bytes").getAbsolutePath());
Configuration conf = new Configuration();
FileSystem fs1 = FileSystem.get(file.toUri(), conf);
@@ -288,6 +331,10 @@ public class HdfsConsumerTest extends Ca
@Test
public void testReadString() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
final Path file = new Path(new File("target/test/test-camel-string").getAbsolutePath());
Configuration conf = new Configuration();
FileSystem fs1 = FileSystem.get(file.toUri(), conf);
@@ -318,6 +365,10 @@ public class HdfsConsumerTest extends Ca
@Test
public void testReadStringArrayFile() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
final Path file = new Path(new File("target/test/test-camel-string").getAbsolutePath());
Configuration conf = new Configuration();
FileSystem fs1 = FileSystem.get(file.toUri(), conf);
@@ -350,6 +401,10 @@ public class HdfsConsumerTest extends Ca
@Override
public void tearDown() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
super.tearDown();
Thread.sleep(100);
Configuration conf = new Configuration();
Modified: camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerConsumerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerConsumerTest.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerConsumerTest.java (original)
+++ camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerConsumerTest.java Fri Jun 24 21:56:22 2011
@@ -27,10 +27,21 @@ import org.apache.camel.test.junit4.Came
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
+import org.junit.Before;
import org.junit.Test;
public class HdfsProducerConsumerTest extends CamelTestSupport {
+ //Hadoop doesn't run on IBM JDK
+ private static final boolean SKIP = System.getProperty("java.vendor").contains("IBM");
+ @Before
+ public void setUp() throws Exception {
+ if (SKIP) {
+ return;
+ }
+ super.setUp();
+ }
+
@Override
public boolean isUseRouteBuilder() {
return false;
@@ -38,6 +49,9 @@ public class HdfsProducerConsumerTest ex
@Test
public void testSimpleSplitWriteRead() throws Exception {
+ if (SKIP) {
+ return;
+ }
final Path file = new Path(new File("target/test/test-camel-simple-write-file").getAbsolutePath());
context.addRoutes(new RouteBuilder() {
@@ -67,6 +81,10 @@ public class HdfsProducerConsumerTest ex
@Override
public void tearDown() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
super.tearDown();
Thread.sleep(100);
Configuration conf = new Configuration();
Modified: camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerFileWriteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerFileWriteTest.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerFileWriteTest.java (original)
+++ camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerFileWriteTest.java Fri Jun 24 21:56:22 2011
@@ -36,12 +36,27 @@ import org.apache.hadoop.io.SequenceFile
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.util.ReflectionUtils;
+import org.junit.Before;
import org.junit.Test;
public class HdfsProducerFileWriteTest extends CamelTestSupport {
+ //Hadoop doesn't run on IBM JDK
+ private static final boolean SKIP = System.getProperty("java.vendor").contains("IBM");
+ @Before
+ public void setUp() throws Exception {
+ if (SKIP) {
+ return;
+ }
+ super.setUp();
+ }
+
@Test
public void testSimpleWriteFile() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
final Path file = new Path(new File("target/test/test-camel-simple-write-file").getAbsolutePath());
deleteDirectory("target/file-batch1");
@@ -77,6 +92,10 @@ public class HdfsProducerFileWriteTest e
@Test
public void testSequenceWriteFile() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
final Path file = new Path(new File("target/test/test-camel-simple-write-file1").getAbsolutePath());
deleteDirectory("target/file-batch2");
@@ -116,6 +135,10 @@ public class HdfsProducerFileWriteTest e
@Test
public void testSequenceKeyWriteFile() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
final Path file = new Path(new File("target/test/test-camel-simple-write-file2").getAbsolutePath());
deleteDirectory("target/file-batch3");
@@ -157,6 +180,10 @@ public class HdfsProducerFileWriteTest e
@Test
public void testMapKeyWriteFile() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
final Path file = new Path(new File("target/test/test-camel-simple-write-file1").getAbsolutePath());
deleteDirectory("target/file-batch4");
@@ -197,6 +224,10 @@ public class HdfsProducerFileWriteTest e
@Test
public void testSequenceKeyWriteBigFile() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
final Path file = new Path(new File("target/test/test-camel-simple-write-file1").getAbsolutePath());
deleteDirectory("target/file-batch5");
@@ -239,6 +270,10 @@ public class HdfsProducerFileWriteTest e
@Override
public void tearDown() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
super.tearDown();
Configuration conf = new Configuration();
Path dir = new Path("target/test");
Modified: camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerSplitTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerSplitTest.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerSplitTest.java (original)
+++ camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerSplitTest.java Fri Jun 24 21:56:22 2011
@@ -28,12 +28,23 @@ import org.apache.hadoop.conf.Configurat
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IOUtils;
+import org.junit.Before;
import org.junit.Test;
public class HdfsProducerSplitTest extends CamelTestSupport {
-
+ //Hadoop doesn't run on IBM JDK
+ private static final boolean SKIP = System.getProperty("java.vendor").contains("IBM");
+
private static final Path BASE_FILE = new Path(new File("target/test/test-camel-simple-write-BASE_FILE").getAbsolutePath());
+ @Before
+ public void setUp() throws Exception {
+ if (SKIP) {
+ return;
+ }
+ super.setUp();
+ }
+
@Test
public void testSimpleWriteFileWithMessageSplit() throws Exception {
doTest(1);
@@ -46,6 +57,10 @@ public class HdfsProducerSplitTest exten
@Test
public void testSimpleWriteFileWithIdleSplit() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
for (int i = 0; i < 3; ++i) {
template.sendBody("direct:start3", "CIAO" + i);
Thread.sleep(2000);
@@ -75,6 +90,10 @@ public class HdfsProducerSplitTest exten
}
private void doTest(int routeNr) throws Exception {
+ if (SKIP) {
+ return;
+ }
+
for (int i = 0; i < 10; ++i) {
template.sendBody("direct:start" + routeNr, "CIAO" + i);
}
@@ -95,6 +114,10 @@ public class HdfsProducerSplitTest exten
@Override
public void tearDown() throws Exception {
+ if (SKIP) {
+ return;
+ }
+
super.tearDown();
Thread.sleep(100);
Configuration conf = new Configuration();
Modified: camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerTest.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerTest.java (original)
+++ camel/trunk/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsProducerTest.java Fri Jun 24 21:56:22 2011
@@ -37,14 +37,28 @@ import org.apache.hadoop.io.SequenceFile
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.util.ReflectionUtils;
+import org.junit.Before;
import org.junit.Test;
public class HdfsProducerTest extends CamelTestSupport {
private static final Path TEMP_DIR = new Path(new File("target/test/").getAbsolutePath());
+ //Hadoop doesn't run on IBM JDK
+ private static final boolean SKIP = System.getProperty("java.vendor").contains("IBM");
+
+ @Before
+ public void setUp() throws Exception {
+ if (SKIP) {
+ return;
+ }
+ super.setUp();
+ }
@Test
public void testProducer() throws Exception {
+ if (SKIP) {
+ return;
+ }
for (int i = 0; i < 10; ++i) {
template.sendBody("direct:start1", "PAPPO" + i);
}
@@ -65,6 +79,9 @@ public class HdfsProducerTest extends Ca
@Test
public void testWriteBoolean() throws Exception {
+ if (SKIP) {
+ return;
+ }
Boolean aBoolean = true;
template.sendBody("direct:write_boolean", aBoolean);
stopCamelContext();
@@ -81,6 +98,9 @@ public class HdfsProducerTest extends Ca
@Test
public void testWriteByte() throws Exception {
+ if (SKIP) {
+ return;
+ }
byte aByte = 8;
template.sendBody("direct:write_byte", aByte);
stopCamelContext();
@@ -97,6 +117,9 @@ public class HdfsProducerTest extends Ca
@Test
public void testWriteInt() throws Exception {
+ if (SKIP) {
+ return;
+ }
int anInt = 1234;
template.sendBody("direct:write_int", anInt);
stopCamelContext();
@@ -113,6 +136,9 @@ public class HdfsProducerTest extends Ca
@Test
public void testWriteFloat() throws Exception {
+ if (SKIP) {
+ return;
+ }
float aFloat = 12.34f;
template.sendBody("direct:write_float", aFloat);
stopCamelContext();
@@ -129,6 +155,9 @@ public class HdfsProducerTest extends Ca
@Test
public void testWriteDouble() throws Exception {
+ if (SKIP) {
+ return;
+ }
double aDouble = 12.34d;
template.sendBody("direct:write_double", aDouble);
stopCamelContext();
@@ -145,6 +174,9 @@ public class HdfsProducerTest extends Ca
@Test
public void testWriteLong() throws Exception {
+ if (SKIP) {
+ return;
+ }
long aLong = 1234567890;
template.sendBody("direct:write_long", aLong);
stopCamelContext();
@@ -161,6 +193,9 @@ public class HdfsProducerTest extends Ca
@Test
public void testWriteText() throws Exception {
+ if (SKIP) {
+ return;
+ }
String txt = "CIAO MONDO !";
template.sendBody("direct:write_text1", txt);
stopCamelContext();
@@ -177,6 +212,9 @@ public class HdfsProducerTest extends Ca
@Test
public void testWriteTextWithKey() throws Exception {
+ if (SKIP) {
+ return;
+ }
String txtKey = "THEKEY";
String txtValue = "CIAO MONDO !";
template.sendBodyAndHeader("direct:write_text2", txtValue, "KEY", txtKey);
@@ -194,6 +232,9 @@ public class HdfsProducerTest extends Ca
@Test
public void testMapWriteTextWithKey() throws Exception {
+ if (SKIP) {
+ return;
+ }
String txtKey = "THEKEY";
String txtValue = "CIAO MONDO !";
template.sendBodyAndHeader("direct:write_text3", txtValue, "KEY", txtKey);
@@ -211,6 +252,9 @@ public class HdfsProducerTest extends Ca
@Test
public void testArrayWriteText() throws Exception {
+ if (SKIP) {
+ return;
+ }
String txtValue = "CIAO MONDO !";
template.sendBody("direct:write_text4", txtValue);
stopCamelContext();
@@ -225,6 +269,9 @@ public class HdfsProducerTest extends Ca
@Test
public void testBloomMapWriteText() throws Exception {
+ if (SKIP) {
+ return;
+ }
String txtKey = "THEKEY";
String txtValue = "CIAO MONDO !";
template.sendBodyAndHeader("direct:write_text5", txtValue, "KEY", txtKey);
@@ -242,6 +289,9 @@ public class HdfsProducerTest extends Ca
@Override
public void tearDown() throws Exception {
+ if (SKIP) {
+ return;
+ }
super.tearDown();
Thread.sleep(100);
Configuration conf = new Configuration();
Modified: camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsServerTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsServerTestSupport.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsServerTestSupport.java (original)
+++ camel/trunk/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsServerTestSupport.java Fri Jun 24 21:56:22 2011
@@ -34,7 +34,7 @@ public abstract class HttpsServerTestSup
protected static final String KEYSTORE_PATH = "./src/test/resources/localhost.ks";
protected static final File KEYSTORE = new File(KEYSTORE_PATH);
- protected static final String SECURE_SOCKET_PROTOCOL = "SSL";
+ protected static final String SECURE_SOCKET_PROTOCOL = "TLS";
protected static final String PASSWORD = "changeit";
@Before
Modified: camel/trunk/components/camel-tagsoup/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-tagsoup/pom.xml?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-tagsoup/pom.xml (original)
+++ camel/trunk/components/camel-tagsoup/pom.xml Fri Jun 24 21:56:22 2011
@@ -103,6 +103,21 @@
</plugin>
</plugins>
</build>
+ <dependencies>
+
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>${xalan-version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
</profile>
</profiles>
Modified: camel/trunk/components/camel-web/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/pom.xml?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-web/pom.xml (original)
+++ camel/trunk/components/camel-web/pom.xml Fri Jun 24 21:56:22 2011
@@ -551,7 +551,7 @@
<id>unpack</id>
<phase>generate-sources</phase>
<goals>
- <goal>unpack</goal>
+ <goal>copy</goal>
</goals>
</execution>
</executions>
@@ -578,7 +578,7 @@
<id>unpack</id>
<phase>generate-sources</phase>
<goals>
- <goal>unpack</goal>
+ <goal>copy</goal>
</goals>
</execution>
</executions>
Modified: camel/trunk/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityConcurrencyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityConcurrencyTest.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityConcurrencyTest.java (original)
+++ camel/trunk/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityConcurrencyTest.java Fri Jun 24 21:56:22 2011
@@ -22,20 +22,38 @@ import java.util.concurrent.Executors;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.xml.security.encryption.XMLCipher;
+import org.apache.xml.security.encryption.XMLEncryptionException;
import org.junit.Test;
/**
* @version
*/
public class XMLSecurityConcurrencyTest extends CamelTestSupport {
+ private static final boolean HAS_3DES;
+ static {
+ boolean ok = false;
+ try {
+ XMLCipher.getInstance(XMLCipher.TRIPLEDES_KeyWrap);
+ ok = true;
+ } catch (XMLEncryptionException e) {
+ }
+ HAS_3DES = ok;
+ }
@Test
public void testNoConcurrentProducers() throws Exception {
+ if (!HAS_3DES) {
+ return;
+ }
doSendMessages(1, 1);
}
@Test
public void testConcurrentProducers() throws Exception {
+ if (!HAS_3DES) {
+ return;
+ }
doSendMessages(10, 5);
}
Modified: camel/trunk/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java (original)
+++ camel/trunk/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java Fri Jun 24 21:56:22 2011
@@ -22,6 +22,7 @@ import java.net.URL;
import java.security.KeyStore;
import java.util.Map;
+import javax.crypto.Cipher;
import javax.xml.transform.OutputKeys;
import org.w3c.dom.Document;
@@ -35,12 +36,24 @@ import org.apache.camel.component.mock.M
import org.apache.camel.converter.jaxp.XmlConverter;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.apache.xml.security.encryption.XMLCipher;
+import org.apache.xml.security.encryption.XMLEncryptionException;
import org.junit.Test;
/**
* Unit test of the encryptXML data format.
*/
public class XMLSecurityDataFormatTest extends CamelTestSupport {
+ private static final boolean HAS_3DES;
+ static {
+ boolean ok = false;
+ try {
+ XMLCipher.getInstance(XMLCipher.TRIPLEDES_KeyWrap);
+ ok = true;
+ } catch (XMLEncryptionException e) {
+ }
+ HAS_3DES = ok;
+ }
+
private static final String XML_FRAGMENT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<cheesesites>"
+ "<netherlands>"
@@ -144,6 +157,9 @@ public class XMLSecurityDataFormatTest e
@Test
public void testFullPayloadXMLEncryption() throws Exception {
+ if (!HAS_3DES) {
+ return;
+ }
context.addRoutes(new RouteBuilder() {
public void configure() {
from("direct:start")
@@ -156,6 +172,9 @@ public class XMLSecurityDataFormatTest e
@Test
public void testPartialPayloadXMLContentEncryption() throws Exception {
+ if (!HAS_3DES) {
+ return;
+ }
context.addRoutes(new RouteBuilder() {
public void configure() {
from("direct:start")
@@ -168,6 +187,9 @@ public class XMLSecurityDataFormatTest e
@Test
public void testPartialPayloadMultiNodeXMLContentEncryption() throws Exception {
+ if (!HAS_3DES) {
+ return;
+ }
context.addRoutes(new RouteBuilder() {
public void configure() {
from("direct:start")
@@ -180,6 +202,9 @@ public class XMLSecurityDataFormatTest e
@Test
public void testPartialPayloadXMLElementEncryptionWithKey() throws Exception {
+ if (!HAS_3DES) {
+ return;
+ }
context.addRoutes(new RouteBuilder() {
public void configure() {
from("direct:start")
@@ -278,6 +303,9 @@ public class XMLSecurityDataFormatTest e
*/
@Test
public void testFullPayloadXMLDecryption() throws Exception {
+ if (!HAS_3DES) {
+ return;
+ }
context.addRoutes(new RouteBuilder() {
public void configure() {
from("direct:start")
@@ -290,6 +318,9 @@ public class XMLSecurityDataFormatTest e
@Test
public void testPartialPayloadXMLContentDecryption() throws Exception {
+ if (!HAS_3DES) {
+ return;
+ }
context.addRoutes(new RouteBuilder() {
public void configure() {
from("direct:start")
@@ -302,6 +333,9 @@ public class XMLSecurityDataFormatTest e
@Test
public void testPartialPayloadMultiNodeXMLContentDecryption() throws Exception {
+ if (!HAS_3DES) {
+ return;
+ }
context.addRoutes(new RouteBuilder() {
public void configure() {
from("direct:start")
@@ -314,6 +348,9 @@ public class XMLSecurityDataFormatTest e
@Test
public void testPartialPayloadXMLElementDecryptionWithKey() throws Exception {
+ if (!HAS_3DES) {
+ return;
+ }
context.addRoutes(new RouteBuilder() {
public void configure() {
from("direct:start")
Modified: camel/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=1139452&r1=1139451&r2=1139452&view=diff
==============================================================================
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Fri Jun 24 21:56:22 2011
@@ -153,7 +153,7 @@
<woodstox-version>4.1.1</woodstox-version>
<xbean-spring-version>3.5</xbean-spring-version>
<xstream-version>1.3.1</xstream-version>
- <xmlsec-version>1.4.4</xmlsec-version>
+ <xmlsec-version>1.4.5</xmlsec-version>
<xerces-version>2.9.1</xerces-version>
<xalan-version>2.7.1</xalan-version>
<xmlbeans-version>2.5.0</xmlbeans-version>