camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject camel git commit: CAMEL-8695 Update apns library to 1.0.0.Beta6
Date Mon, 11 May 2015 19:48:13 GMT
Repository: camel
Updated Branches:
  refs/heads/master a38f5af92 -> 8b5b1abf4


CAMEL-8695 Update apns library to 1.0.0.Beta6


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8b5b1abf
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8b5b1abf
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8b5b1abf

Branch: refs/heads/master
Commit: 8b5b1abf43b24ea8b1afc5f0a92b28a652360704
Parents: a38f5af
Author: Andrea Cosentino <ancosen@gmail.com>
Authored: Mon May 11 21:44:57 2015 +0200
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Mon May 11 21:44:57 2015 +0200

----------------------------------------------------------------------
 .../apns/ApnsConsumerIdleMessageTest.java       |  3 +-
 .../camel/component/apns/ApnsConsumerTest.java  |  5 ++--
 .../camel/component/apns/ApnsProducerTest.java  | 12 ++++----
 .../ApnsProducerWithoutTokensHeaderTest.java    |  7 +++--
 .../apns/factory/ApnsServiceFactoryTest.java    | 10 +++----
 .../apns/spring/SpringApnsConsumerTest.java     |  5 ++--
 .../camel/component/apns/util/ApnsUtils.java    | 12 ++++----
 .../component/apns/util/TestConstants.java      | 31 ++++++++++++++++++++
 parent/pom.xml                                  |  4 +--
 9 files changed, 62 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/8b5b1abf/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerIdleMessageTest.java
----------------------------------------------------------------------
diff --git a/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerIdleMessageTest.java
b/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerIdleMessageTest.java
index 55b3cc9..eaeaaad 100644
--- a/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerIdleMessageTest.java
+++ b/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerIdleMessageTest.java
@@ -24,6 +24,7 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.apns.factory.ApnsServiceFactory;
 import org.apache.camel.component.apns.util.ApnsUtils;
+import org.apache.camel.component.apns.util.TestConstants;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.After;
@@ -42,7 +43,7 @@ public class ApnsConsumerIdleMessageTest extends CamelTestSupport {
 
     @Before
     public void startup() throws InterruptedException {
-        server = ApnsUtils.prepareAndStartServer(FixedCertificates.TEST_GATEWAY_PORT, FixedCertificates.TEST_FEEDBACK_PORT);
+        server = ApnsUtils.prepareAndStartServer(TestConstants.TEST_GATEWAY_PORT, TestConstants.TEST_FEEDBACK_PORT);
     }
 
     @After

http://git-wip-us.apache.org/repos/asf/camel/blob/8b5b1abf/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerTest.java
b/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerTest.java
index 0aa36ff..e07b2af 100644
--- a/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerTest.java
+++ b/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsConsumerTest.java
@@ -25,6 +25,7 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.apns.factory.ApnsServiceFactory;
 import org.apache.camel.component.apns.model.InactiveDevice;
 import org.apache.camel.component.apns.util.ApnsUtils;
+import org.apache.camel.component.apns.util.TestConstants;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.After;
@@ -41,7 +42,7 @@ public class ApnsConsumerTest extends CamelTestSupport {
 
     @Before
     public void startup() throws InterruptedException {
-        server = ApnsUtils.prepareAndStartServer(FixedCertificates.TEST_GATEWAY_PORT, FixedCertificates.TEST_FEEDBACK_PORT);
+        server = ApnsUtils.prepareAndStartServer(TestConstants.TEST_GATEWAY_PORT, TestConstants.TEST_FEEDBACK_PORT);
     }
 
     @After
@@ -60,7 +61,7 @@ public class ApnsConsumerTest extends CamelTestSupport {
         mock.message(0).body().isInstanceOf(InactiveDevice.class);
 
         byte[] feedBackBytes = ApnsUtils.generateFeedbackBytes(deviceTokenBytes);
-        server.toSend.write(feedBackBytes);
+        server.getToSend().write(feedBackBytes);
 
         Thread.sleep(1000);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/8b5b1abf/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerTest.java
b/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerTest.java
index c130c76..4842a36 100644
--- a/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerTest.java
+++ b/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerTest.java
@@ -20,7 +20,6 @@ import com.notnoop.apns.APNS;
 import com.notnoop.apns.ApnsService;
 import com.notnoop.apns.EnhancedApnsNotification;
 import com.notnoop.apns.utils.ApnsServerStub;
-import com.notnoop.apns.utils.FixedCertificates;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
@@ -28,6 +27,7 @@ import org.apache.camel.component.apns.factory.ApnsServiceFactory;
 import org.apache.camel.component.apns.model.ApnsConstants;
 import org.apache.camel.component.apns.model.MessageType;
 import org.apache.camel.component.apns.util.ApnsUtils;
+import org.apache.camel.component.apns.util.TestConstants;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.After;
 import org.junit.Before;
@@ -44,7 +44,7 @@ public class ApnsProducerTest extends CamelTestSupport {
 
     @Before
     public void startup() {
-        server = ApnsUtils.prepareAndStartServer(FixedCertificates.TEST_GATEWAY_PORT, FixedCertificates.TEST_FEEDBACK_PORT);
+        server = ApnsUtils.prepareAndStartServer(TestConstants.TEST_GATEWAY_PORT, TestConstants.TEST_FEEDBACK_PORT);
     }
 
     @After
@@ -62,8 +62,8 @@ public class ApnsProducerTest extends CamelTestSupport {
 
         template.sendBody("direct:test", message);
 
-        server.messages.acquire();
-        assertArrayEquals(apnsNotification.marshall(), server.received.toByteArray());
+        server.getMessages().acquire();
+        assertArrayEquals(apnsNotification.marshall(), server.getReceived().toByteArray());
     }
 
 
@@ -78,8 +78,8 @@ public class ApnsProducerTest extends CamelTestSupport {
 
         template.sendBody("direct:testWithApnsNotification", apnsNotification);
 
-        server.messages.acquire();
-        assertArrayEquals(apnsNotification.marshall(), server.received.toByteArray());
+        server.getMessages().acquire();
+        assertArrayEquals(apnsNotification.marshall(), server.getReceived().toByteArray());
 
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/8b5b1abf/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerWithoutTokensHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerWithoutTokensHeaderTest.java
b/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerWithoutTokensHeaderTest.java
index 3ecaf31..8a3a98d 100644
--- a/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerWithoutTokensHeaderTest.java
+++ b/components/camel-apns/src/test/java/org/apache/camel/component/apns/ApnsProducerWithoutTokensHeaderTest.java
@@ -26,6 +26,7 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.apns.factory.ApnsServiceFactory;
 import org.apache.camel.component.apns.util.ApnsUtils;
+import org.apache.camel.component.apns.util.TestConstants;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.After;
 import org.junit.Before;
@@ -42,7 +43,7 @@ public class ApnsProducerWithoutTokensHeaderTest extends CamelTestSupport
{
 
     @Before
     public void startup() {
-        server = ApnsUtils.prepareAndStartServer(FixedCertificates.TEST_GATEWAY_PORT, FixedCertificates.TEST_FEEDBACK_PORT);
+        server = ApnsUtils.prepareAndStartServer(TestConstants.TEST_GATEWAY_PORT, TestConstants.TEST_FEEDBACK_PORT);
     }
 
     @After
@@ -60,8 +61,8 @@ public class ApnsProducerWithoutTokensHeaderTest extends CamelTestSupport
{
 
         template.sendBody("direct:test", message);
 
-        server.messages.acquire();
-        assertArrayEquals(apnsNotification.marshall(), server.received.toByteArray());
+        server.getMessages().acquire();
+        assertArrayEquals(apnsNotification.marshall(), server.getReceived().toByteArray());
     }
 
     protected CamelContext createCamelContext() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/8b5b1abf/components/camel-apns/src/test/java/org/apache/camel/component/apns/factory/ApnsServiceFactoryTest.java
----------------------------------------------------------------------
diff --git a/components/camel-apns/src/test/java/org/apache/camel/component/apns/factory/ApnsServiceFactoryTest.java
b/components/camel-apns/src/test/java/org/apache/camel/component/apns/factory/ApnsServiceFactoryTest.java
index 84361e1..187e3cb 100644
--- a/components/camel-apns/src/test/java/org/apache/camel/component/apns/factory/ApnsServiceFactoryTest.java
+++ b/components/camel-apns/src/test/java/org/apache/camel/component/apns/factory/ApnsServiceFactoryTest.java
@@ -21,7 +21,7 @@ import com.notnoop.apns.utils.FixedCertificates;
 
 import org.apache.camel.component.apns.model.ConnectionStrategy;
 import org.apache.camel.component.apns.util.ApnsUtils;
-
+import org.apache.camel.component.apns.util.TestConstants;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -60,10 +60,10 @@ public class ApnsServiceFactoryTest {
         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.setFeedbackHost(TestConstants.TEST_HOST);
+        apnsServiceFactory.setFeedbackPort(TestConstants.TEST_FEEDBACK_PORT);
+        apnsServiceFactory.setGatewayHost(TestConstants.TEST_HOST);
+        apnsServiceFactory.setGatewayPort(TestConstants.TEST_GATEWAY_PORT);
         apnsServiceFactory.setSslContextParameters(ApnsUtils.clientContext());
 
         return apnsServiceFactory;

http://git-wip-us.apache.org/repos/asf/camel/blob/8b5b1abf/components/camel-apns/src/test/java/org/apache/camel/component/apns/spring/SpringApnsConsumerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-apns/src/test/java/org/apache/camel/component/apns/spring/SpringApnsConsumerTest.java
b/components/camel-apns/src/test/java/org/apache/camel/component/apns/spring/SpringApnsConsumerTest.java
index 534dda4..7d7aca0 100644
--- a/components/camel-apns/src/test/java/org/apache/camel/component/apns/spring/SpringApnsConsumerTest.java
+++ b/components/camel-apns/src/test/java/org/apache/camel/component/apns/spring/SpringApnsConsumerTest.java
@@ -23,6 +23,7 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.component.apns.model.InactiveDevice;
 import org.apache.camel.component.apns.util.ApnsUtils;
+import org.apache.camel.component.apns.util.TestConstants;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.After;
 import org.junit.Assert;
@@ -48,7 +49,7 @@ public class SpringApnsConsumerTest extends AbstractJUnit4SpringContextTests
{
 
     @Before
     public void startup() throws InterruptedException {
-        server = ApnsUtils.prepareAndStartServer(FixedCertificates.TEST_GATEWAY_PORT, FixedCertificates.TEST_FEEDBACK_PORT);
+        server = ApnsUtils.prepareAndStartServer(TestConstants.TEST_GATEWAY_PORT, TestConstants.TEST_FEEDBACK_PORT);
     }
 
     @After
@@ -66,7 +67,7 @@ public class SpringApnsConsumerTest extends AbstractJUnit4SpringContextTests
{
         mock.message(0).body().isInstanceOf(InactiveDevice.class);
 
         byte[] feedBackBytes = ApnsUtils.generateFeedbackBytes(deviceTokenBytes);
-        server.toSend.write(feedBackBytes);
+        server.getToSend().write(feedBackBytes);
 
         Thread.sleep(1000);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/8b5b1abf/components/camel-apns/src/test/java/org/apache/camel/component/apns/util/ApnsUtils.java
----------------------------------------------------------------------
diff --git a/components/camel-apns/src/test/java/org/apache/camel/component/apns/util/ApnsUtils.java
b/components/camel-apns/src/test/java/org/apache/camel/component/apns/util/ApnsUtils.java
index 74f090d..fc74b83 100644
--- a/components/camel-apns/src/test/java/org/apache/camel/component/apns/util/ApnsUtils.java
+++ b/components/camel-apns/src/test/java/org/apache/camel/component/apns/util/ApnsUtils.java
@@ -65,7 +65,7 @@ public final class ApnsUtils {
     
     public static ApnsServerStub prepareAndStartServer(int gatePort, int feedPort) {
         InputStream stream = ClassLoader.getSystemResourceAsStream(FixedCertificates.SERVER_STORE);
-        SSLContext context = Utilities.newSSLContext(stream, FixedCertificates.SERVER_PASSWD,

+        SSLContext context = Utilities.newSSLContext(stream, FixedCertificates.SERVER_PASSWORD,

                                                      "PKCS12", getAlgorithm());
 
         
@@ -101,7 +101,7 @@ public final class ApnsUtils {
 
         final KeyManagersParameters kmp = new KeyManagersParameters();
         kmp.setKeyStore(ksp);
-        kmp.setKeyPassword(FixedCertificates.CLIENT_PASSWD);
+        kmp.setKeyPassword(FixedCertificates.CLIENT_PASSWORD);
         kmp.setAlgorithm(getAlgorithm());
 
         final SSLContextParameters contextParameters = new SSLContextParameters();
@@ -133,10 +133,10 @@ public final class ApnsUtils {
         throws Exception {
         ApnsServiceFactory apnsServiceFactory = new ApnsServiceFactory(camelContext);
 
-        apnsServiceFactory.setFeedbackHost(FixedCertificates.TEST_HOST);
-        apnsServiceFactory.setFeedbackPort(FixedCertificates.TEST_FEEDBACK_PORT);
-        apnsServiceFactory.setGatewayHost(FixedCertificates.TEST_HOST);
-        apnsServiceFactory.setGatewayPort(FixedCertificates.TEST_GATEWAY_PORT);
+        apnsServiceFactory.setFeedbackHost(TestConstants.TEST_HOST);
+        apnsServiceFactory.setFeedbackPort(TestConstants.TEST_FEEDBACK_PORT);
+        apnsServiceFactory.setGatewayHost(TestConstants.TEST_HOST);
+        apnsServiceFactory.setGatewayPort(TestConstants.TEST_GATEWAY_PORT);
         // apnsServiceFactory.setCertificatePath("classpath:/" +
         // FixedCertificates.CLIENT_STORE);
         // apnsServiceFactory.setCertificatePassword(FixedCertificates.CLIENT_PASSWD);

http://git-wip-us.apache.org/repos/asf/camel/blob/8b5b1abf/components/camel-apns/src/test/java/org/apache/camel/component/apns/util/TestConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-apns/src/test/java/org/apache/camel/component/apns/util/TestConstants.java
b/components/camel-apns/src/test/java/org/apache/camel/component/apns/util/TestConstants.java
new file mode 100644
index 0000000..7d2b7d5
--- /dev/null
+++ b/components/camel-apns/src/test/java/org/apache/camel/component/apns/util/TestConstants.java
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.apns.util;
+
+/**
+ * Interface with address and port to point inside tests
+ */
+public final class TestConstants {
+
+    public static final int TEST_GATEWAY_PORT = 7654;
+    public static final int TEST_FEEDBACK_PORT = 7843;
+    public static final String TEST_HOST = "localhost";
+    
+    private TestConstants() {
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8b5b1abf/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 7dc6a2e..a120879 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -235,8 +235,8 @@
     <jasper-bundle-version>6.0.36_1</jasper-bundle-version>
     <jasypt-bundle-version>1.9.2_1</jasypt-bundle-version>
     <jasypt-version>1.9.2</jasypt-version>
-    <java-apns-bundle-version>0.2.3_1</java-apns-bundle-version>
-    <java-apns-version>0.2.3</java-apns-version>
+    <java-apns-bundle-version>1.0.0.Beta6_1</java-apns-bundle-version>
+    <java-apns-version>1.0.0.Beta6</java-apns-version>
     <javacrumbs-version>0.22</javacrumbs-version>
     <javassist-bundle-version>3.12.1.GA_3</javassist-bundle-version>
     <javax.el-api-version>2.2.4</javax.el-api-version>


Mime
View raw message