diff --git a/cloudfoundry/cf-manifests/partitioning-consumer1-manifest.yml b/cloudfoundry/cf-manifests/partitioning-consumer1-manifest.yml deleted file mode 100644 index 474e9ea..0000000 --- a/cloudfoundry/cf-manifests/partitioning-consumer1-manifest.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -applications: -- name: partitioning-consumer1 - host: partitioning-consumer1 - memory: 2G - disk_quota: 2G - instances: 1 - path: /tmp/partitioning-consumer-rabbit.jar - env: - SPRING_APPLICATION_JSON: '{"maven": { "remote-repositories": { "repo1": { "url": "https://repo.spring.io/libs-snapshot"} } } }' - LOGGING_FILE: partconsumer1.log - MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE: logfile -services: -- scst-rabbit \ No newline at end of file diff --git a/cloudfoundry/cf-manifests/partitioning-consumer2-manifest.yml b/cloudfoundry/cf-manifests/partitioning-consumer2-manifest.yml deleted file mode 100644 index 89f5d15..0000000 --- a/cloudfoundry/cf-manifests/partitioning-consumer2-manifest.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -applications: -- name: partitioning-consumer2 - host: partitioning-consumer2 - memory: 2G - disk_quota: 2G - instances: 1 - path: /tmp/partitioning-consumer-rabbit.jar - env: - SPRING_APPLICATION_JSON: '{"maven": { "remote-repositories": { "repo1": { "url": "https://repo.spring.io/libs-snapshot"} } } }' - LOGGING_FILE: partconsumer2.log - MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE: logfile - SPRING_CLOUD_STREAM_BINDINGS_INPUT_CONSUMER_INSTANCEINDEX: 1 -services: -- scst-rabbit \ No newline at end of file diff --git a/cloudfoundry/cf-manifests/partitioning-consumer3-manifest.yml b/cloudfoundry/cf-manifests/partitioning-consumer3-manifest.yml deleted file mode 100644 index 516c30b..0000000 --- a/cloudfoundry/cf-manifests/partitioning-consumer3-manifest.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -applications: -- name: partitioning-consumer3 - host: partitioning-consumer3 - memory: 2G - disk_quota: 2G - instances: 1 - path: /tmp/partitioning-consumer-rabbit.jar - env: - SPRING_APPLICATION_JSON: '{"maven": { "remote-repositories": { "repo1": { "url": "https://repo.spring.io/libs-snapshot"} } } }' - LOGGING_FILE: partconsumer3.log - MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE: logfile - SPRING_CLOUD_STREAM_BINDINGS_INPUT_CONSUMER_INSTANCEINDEX: 2 -services: -- scst-rabbit \ No newline at end of file diff --git a/cloudfoundry/cf-manifests/partitioning-consumer4-manifest.yml b/cloudfoundry/cf-manifests/partitioning-consumer4-manifest.yml deleted file mode 100644 index 0b2cdef..0000000 --- a/cloudfoundry/cf-manifests/partitioning-consumer4-manifest.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -applications: -- name: partitioning-consumer4 - host: partitioning-consumer4 - memory: 2G - disk_quota: 2G - instances: 1 - path: /tmp/partitioning-consumer-rabbit.jar - env: - SPRING_APPLICATION_JSON: '{"maven": { "remote-repositories": { "repo1": { "url": "https://repo.spring.io/libs-snapshot"} } } }' - LOGGING_FILE: partconsumer4.log - MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE: logfile - SPRING_CLOUD_STREAM_BINDINGS_INPUT_CONSUMER_INSTANCEINDEX: 3 -services: -- scst-rabbit \ No newline at end of file diff --git a/cloudfoundry/cf-manifests/partitioning-producer-manifest.yml b/cloudfoundry/cf-manifests/partitioning-producer-manifest.yml deleted file mode 100644 index 3ce9be2..0000000 --- a/cloudfoundry/cf-manifests/partitioning-producer-manifest.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -applications: -- name: partitioning-producer - host: partitioning-producer - memory: 2G - disk_quota: 2G - instances: 1 - path: /tmp/partitioning-producer-rabbit.jar - env: - SPRING_APPLICATION_JSON: '{"maven": { "remote-repositories": { "repo1": { "url": "https://repo.spring.io/libs-snapshot"} } } }' - LOGGING_FILE: partproducer.log - MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE: logfile -services: -- scst-rabbit \ No newline at end of file diff --git a/cloudfoundry/cf-manifests/uppercase-processor-manifest.yml b/cloudfoundry/cf-manifests/uppercase-processor-manifest.yml deleted file mode 100644 index 5c772dc..0000000 --- a/cloudfoundry/cf-manifests/uppercase-processor-manifest.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -applications: -- name: uppercase-transformer - host: uppercase-transformer - memory: 2G - disk_quota: 2G - instances: 1 - path: /tmp/uppercase-transformer-rabbit.jar - env: - SPRING_APPLICATION_JSON: '{"maven": { "remote-repositories": { "repo1": { "url": "https://repo.spring.io/libs-snapshot"} } } }' - LOGGING_FILE: uppercase.log - MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE: logfile -services: -- scst-rabbit \ No newline at end of file diff --git a/cloudfoundry/runCFAcceptanceTests.sh b/cloudfoundry/runCFAcceptanceTests.sh index 302e6e2..4c0a75b 100755 --- a/cloudfoundry/runCFAcceptanceTests.sh +++ b/cloudfoundry/runCFAcceptanceTests.sh @@ -156,78 +156,6 @@ function prepare_ticktock_latest_with_rabbit_binder() { FULL_TICKTOCK_LOG_SINK_ROUTE=http://$TICKTOCK_LOG_SINK_ROUTE } -function prepare_uppercase_transformer_with_rabbit_binder() { - - wget -O /tmp/uppercase-transformer-rabbit.jar https://repo.spring.io/libs-snapshot-local/io/spring/cloud/stream/acceptance/uppercase-transformer-rabbit/0.0.1-SNAPSHOT/uppercase-transformer-rabbit-0.0.1-SNAPSHOT.jar - - if [ $6 == "skip-ssl-validation" ] - then - cf login -a $1 --skip-ssl-validation -u $2 -p $3 -o $4 -s $5 - else - cf login -a $1 -u $2 -p $3 -o $4 -s $5 - fi - - cf push -f ./cf-manifests/uppercase-processor-manifest.yml - - cf app uppercase-transformer > /tmp/uppercase-route.txt - - UPPERCASE_PROCESSOR_ROUTE=`grep routes /tmp/uppercase-route.txt | awk '{ print $2 }'` - - FULL_UPPERCASE_ROUTE=http://$UPPERCASE_PROCESSOR_ROUTE -} - -function prepare_partitioning_test_with_rabbit_binder() { - - wget -O /tmp/partitioning-producer-rabbit.jar https://repo.spring.io/libs-snapshot-local/io/spring/cloud/stream/acceptance/partitioning-producer-sample-rabbit/0.0.1-SNAPSHOT/partitioning-producer-sample-rabbit-0.0.1-SNAPSHOT.jar - wget -O /tmp/partitioning-consumer-rabbit.jar https://repo.spring.io/libs-snapshot-local/io/spring/cloud/stream/acceptance/partitioning-consumer-sample-rabbit/0.0.1-SNAPSHOT/partitioning-consumer-sample-rabbit-0.0.1-SNAPSHOT.jar - - if [ $6 == "skip-ssl-validation" ] - then - cf login -a $1 --skip-ssl-validation -u $2 -p $3 -o $4 -s $5 - else - cf login -a $1 -u $2 -p $3 -o $4 -s $5 - fi - - cf push -f ./cf-manifests/partitioning-producer-manifest.yml - - cf app partitioning-producer > /tmp/part-producer-route.txt - - PARTITIONING_PRODUCER_ROUTE=`grep routes /tmp/part-producer-route.txt | awk '{ print $2 }'` - - FULL_PARTITIONING_PRODUCER_ROUTE=http://$PARTITIONING_PRODUCER_ROUTE - - # consumer 1 - - cf push -f ./cf-manifests/partitioning-consumer1-manifest.yml - - cf app partitioning-consumer1 > /tmp/part-consumer1-route.txt - - PARTITIONING_CONSUMER1_ROUTE=`grep routes /tmp/part-consumer1-route.txt | awk '{ print $2 }'` - - FULL_PARTITIONING_CONSUMER1_ROUTE=http://$PARTITIONING_CONSUMER1_ROUTE - - #consumer 2 - - cf push -f ./cf-manifests/partitioning-consumer2-manifest.yml - - cf app partitioning-consumer2 > /tmp/part-consumer2-route.txt - - PARTITIONING_CONSUMER2_ROUTE=`grep routes /tmp/part-consumer2-route.txt | awk '{ print $2 }'` - - FULL_PARTITIONING_CONSUMER2_ROUTE=http://$PARTITIONING_CONSUMER2_ROUTE - - #consumer 3 - - cf push -f ./cf-manifests/partitioning-consumer3-manifest.yml - - cf app partitioning-consumer3 > /tmp/part-consumer3-route.txt - - PARTITIONING_CONSUMER3_ROUTE=`grep routes /tmp/part-consumer3-route.txt | awk '{ print $2 }'` - - FULL_PARTITIONING_CONSUMER3_ROUTE=http://$PARTITIONING_CONSUMER3_ROUTE - -} - #Main script starting SECONDS=0 @@ -364,79 +292,6 @@ rm /tmp/ticktock-log-sink-route.txt rm /tmp/ticktock-time-source.jar rm /tmp/ticktock-log-sink.jar -if [ "$BUILD_RETURN_VALUE" != 0 ] -then - echo "Early exit due to test failure in ticktock tests" - duration=$SECONDS - - echo "Total time: Build took $(($duration / 60)) minutes and $(($duration % 60)) seconds to complete." - - exit $BUILD_RETURN_VALUE -fi - - -echo "Prepare artifacts for uppercase transformer testing" - -prepare_uppercase_transformer_with_rabbit_binder $1 $2 $3 $4 $5 $6 - -pushd ../spring-cloud-stream-acceptance-tests - -../mvnw clean package -Dtest=UppercaseTransformerAcceptanceTests -Dmaven.test.skip=false -Duppercase.processor.route=$FULL_UPPERCASE_ROUTE -BUILD_RETURN_VALUE=$? - -popd - -cf stop uppercase-transformer - -cf delete uppercase-transformer -f - -cf logout - -rm /tmp/uppercase-route.txt - -rm /tmp/uppercase-transformer-rabbit.jar - -if [ "$BUILD_RETURN_VALUE" != 0 ] -then - echo "Early exit due to test failure in uppercase transformer" - duration=$SECONDS - - echo "Total time: Build took $(($duration / 60)) minutes and $(($duration % 60)) seconds to complete." - - exit $BUILD_RETURN_VALUE -fi - -echo "Prepare artifacts for partitions testing" - -prepare_partitioning_test_with_rabbit_binder $1 $2 $3 $4 $5 $6 - -pushd ../spring-cloud-stream-acceptance-tests - -../mvnw clean package -Dtest=PartitioningAcceptanceTests -Dmaven.test.skip=false -Duppercase.processor.route=$FULL_UPPERCASE_ROUTE -Dpartitioning.producer.route=$FULL_PARTITIONING_PRODUCER_ROUTE -Dpartitioning.consumer1.route=$FULL_PARTITIONING_CONSUMER1_ROUTE -Dpartitioning.consumer2.route=$FULL_PARTITIONING_CONSUMER2_ROUTE -Dpartitioning.consumer3.route=$FULL_PARTITIONING_CONSUMER3_ROUTE -BUILD_RETURN_VALUE=$? - -popd - -cf stop partitioning-producer -cf stop partitioning-consumer1 -cf stop partitioning-consumer2 -cf stop partitioning-consumer3 - -cf delete partitioning-producer -f -cf delete partitioning-consumer1 -f -cf delete partitioning-consumer2 -f -cf delete partitioning-consumer3 -f - -cf logout - -rm /tmp/part-producer-route.txt -rm /tmp/part-consumer1-route.txt -rm /tmp/part-consumer2-route.txt -rm /tmp/part-consumer3-route.txt - -rm /tmp/partitioning-producer-rabbit.jar -rm /tmp/partitioning-consumer-rabbit.jar - duration=$SECONDS echo "Cumulative Build Time Across All Tests: Build took $(($duration / 60)) minutes and $(($duration % 60)) seconds to complete." diff --git a/kubernetes/k8s-templates/partitioning-consumer1-sample-kafka-svc-lb.yaml b/kubernetes/k8s-templates/partitioning-consumer1-sample-kafka-svc-lb.yaml deleted file mode 100644 index 195dcae..0000000 --- a/kubernetes/k8s-templates/partitioning-consumer1-sample-kafka-svc-lb.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: partitioning-consumer1-sample-kafka - labels: - app: partitioning-consumer1-sample-kafka - type: acceptance-tests - component: partitioning-consumer1-sample-kafka -spec: - type: LoadBalancer - ports: - - port: 80 - name: partitioning-consumer1-sample-kafka-port - targetPort: 8080 - protocol: TCP - selector: - app: partitioning-consumer1-sample-kafka - type: acceptance-tests - component: partitioning-consumer1-sample-kafka diff --git a/kubernetes/k8s-templates/partitioning-consumer1-sample-kafka.yaml b/kubernetes/k8s-templates/partitioning-consumer1-sample-kafka.yaml deleted file mode 100644 index 40853af..0000000 --- a/kubernetes/k8s-templates/partitioning-consumer1-sample-kafka.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: partitioning-consumer1-sample-kafka - labels: - app: partitioning-consumer1-sample-kafka - type: acceptance-tests - component: partitioning-consumer1-sample-kafka -spec: - replicas: 1 - template: - metadata: - labels: - app: partitioning-consumer1-sample-kafka - type: acceptance-tests - component: partitioning-consumer1-sample-kafka - spec: - containers: - - name: partitioning-consumer1-sample - image: springcloudstream/partitioning-consumer-sample-kafka:latest - ports: - - containerPort: 8080 - env: - - name: SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS - value: kafka:9092 - - name: SPRING_CLOUD_STREAM_KAFKA_BINDER_ZKNODES - value: kafka-zk:2181 - - name: LOGGING_FILE - value: partitioning-consumer1-sample-kafka.log - - name: MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE - value: logfile,health,info - - name: SPRING_CLOUD_STREAMAPP_SECURITY_ENABLED - value: "false" - livenessProbe: - httpGet: - path: /actuator/health - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 60 - readinessProbe: - httpGet: - path: /actuator/info - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 10 diff --git a/kubernetes/k8s-templates/partitioning-consumer2-sample-kafka-svc-lb.yaml b/kubernetes/k8s-templates/partitioning-consumer2-sample-kafka-svc-lb.yaml deleted file mode 100644 index d1c1a36..0000000 --- a/kubernetes/k8s-templates/partitioning-consumer2-sample-kafka-svc-lb.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: partitioning-consumer2-sample-kafka - labels: - app: partitioning-consumer2-sample-kafka - type: acceptance-tests - component: partitioning-consumer2-sample-kafka -spec: - type: LoadBalancer - ports: - - port: 80 - name: partitioning-consumer2-sample-kafka-port - targetPort: 8080 - protocol: TCP - selector: - app: partitioning-consumer2-sample-kafka - type: acceptance-tests - component: partitioning-consumer2-sample-kafka diff --git a/kubernetes/k8s-templates/partitioning-consumer2-sample-kafka.yaml b/kubernetes/k8s-templates/partitioning-consumer2-sample-kafka.yaml deleted file mode 100644 index ac69a48..0000000 --- a/kubernetes/k8s-templates/partitioning-consumer2-sample-kafka.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: partitioning-consumer2-sample-kafka - labels: - app: partitioning-consumer2-sample-kafka - type: acceptance-tests - component: partitioning-consumer2-sample-kafka -spec: - replicas: 1 - template: - metadata: - labels: - app: partitioning-consumer2-sample-kafka - type: acceptance-tests - component: partitioning-consumer2-sample-kafka - spec: - containers: - - name: partitioning-consumer2-sample - image: springcloudstream/partitioning-consumer-sample-kafka:latest - ports: - - containerPort: 8080 - env: - - name: SPRING_CLOUD_STREAM_BINDINGS_INPUT_CONSUMER_INSTANCEINDEX - value: "1" - - name: SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS - value: kafka:9092 - - name: SPRING_CLOUD_STREAM_KAFKA_BINDER_ZKNODES - value: kafka-zk:2181 - - name: LOGGING_FILE - value: partitioning-consumer2-sample-kafka.log - - name: MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE - value: logfile,health,info - - name: SPRING_CLOUD_STREAMAPP_SECURITY_ENABLED - value: "false" - livenessProbe: - httpGet: - path: /actuator/health - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 60 - readinessProbe: - httpGet: - path: /actuator/info - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 10 diff --git a/kubernetes/k8s-templates/partitioning-consumer3-sample-kafka-svc-lb.yaml b/kubernetes/k8s-templates/partitioning-consumer3-sample-kafka-svc-lb.yaml deleted file mode 100644 index a2f2f08..0000000 --- a/kubernetes/k8s-templates/partitioning-consumer3-sample-kafka-svc-lb.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: partitioning-consumer3-sample-kafka - labels: - app: partitioning-consumer3-sample-kafka - type: acceptance-tests - component: partitioning-consumer3-sample-kafka -spec: - type: LoadBalancer - ports: - - port: 80 - name: partitioning-consumer3-sample-kafka-port - targetPort: 8080 - protocol: TCP - selector: - app: partitioning-consumer3-sample-kafka - type: acceptance-tests - component: partitioning-consumer3-sample-kafka diff --git a/kubernetes/k8s-templates/partitioning-consumer3-sample-kafka.yaml b/kubernetes/k8s-templates/partitioning-consumer3-sample-kafka.yaml deleted file mode 100644 index 5a141cb..0000000 --- a/kubernetes/k8s-templates/partitioning-consumer3-sample-kafka.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: partitioning-consumer3-sample-kafka - labels: - app: partitioning-consumer3-sample-kafka - type: acceptance-tests - component: partitioning-consumer3-sample-kafka -spec: - replicas: 1 - template: - metadata: - labels: - app: partitioning-consumer3-sample-kafka - type: acceptance-tests - component: partitioning-consumer3-sample-kafka - spec: - containers: - - name: partitioning-consumer3-sample - image: springcloudstream/partitioning-consumer-sample-kafka:latest - ports: - - containerPort: 8080 - env: - - name: SPRING_CLOUD_STREAM_BINDINGS_INPUT_CONSUMER_INSTANCEINDEX - value: "2" - - name: SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS - value: kafka:9092 - - name: SPRING_CLOUD_STREAM_KAFKA_BINDER_ZKNODES - value: kafka-zk:2181 - - name: LOGGING_FILE - value: partitioning-consumer3-sample-kafka.log - - name: MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE - value: logfile,health,info - - name: SPRING_CLOUD_STREAMAPP_SECURITY_ENABLED - value: "false" - livenessProbe: - httpGet: - path: /actuator/health - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 60 - readinessProbe: - httpGet: - path: /actuator/info - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 10 diff --git a/kubernetes/k8s-templates/partitioning-producer-sample-kafka-svc-lb.yaml b/kubernetes/k8s-templates/partitioning-producer-sample-kafka-svc-lb.yaml deleted file mode 100644 index 18b844c..0000000 --- a/kubernetes/k8s-templates/partitioning-producer-sample-kafka-svc-lb.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: partitioning-producer-sample-kafka - labels: - app: partitioning-producer-sample-kafka - type: acceptance-tests - component: partitioning-producer-sample-kafka -spec: - type: LoadBalancer - ports: - - port: 80 - name: partitioning-producer-sample-kafka-port - targetPort: 8080 - protocol: TCP - selector: - app: partitioning-producer-sample-kafka - type: acceptance-tests - component: partitioning-producer-sample-kafka diff --git a/kubernetes/k8s-templates/partitioning-producer-sample-kafka.yaml b/kubernetes/k8s-templates/partitioning-producer-sample-kafka.yaml deleted file mode 100644 index 899b3a4..0000000 --- a/kubernetes/k8s-templates/partitioning-producer-sample-kafka.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: partitioning-producer-sample-kafka - labels: - app: partitioning-producer-sample-kafka - type: acceptance-tests - component: partitioning-producer-sample-kafka -spec: - replicas: 1 - template: - metadata: - labels: - app: partitioning-producer-sample-kafka - type: acceptance-tests - component: partitioning-producer-sample-kafka - spec: - containers: - - name: partitioning-producer-sample - image: springcloudstream/partitioning-producer-sample-kafka:latest - ports: - - containerPort: 8080 - env: - - name: SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS - value: kafka:9092 - - name: SPRING_CLOUD_STREAM_KAFKA_BINDER_ZKNODES - value: kafka-zk:2181 - - name: LOGGING_FILE - value: partitioning-producer-sample-kafka.log - - name: MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE - value: logfile,health,info - - name: SPRING_CLOUD_STREAMAPP_SECURITY_ENABLED - value: "false" - livenessProbe: - httpGet: - path: /actuator/health - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 60 - readinessProbe: - httpGet: - path: /actuator/info - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 10 diff --git a/spring-cloud-stream-acceptance-tests/src/test/java/sample/acceptance/tests/PartitioningAcceptanceTests.java b/spring-cloud-stream-acceptance-tests/src/test/java/sample/acceptance/tests/PartitioningAcceptanceTests.java deleted file mode 100644 index 85c6ff4..0000000 --- a/spring-cloud-stream-acceptance-tests/src/test/java/sample/acceptance/tests/PartitioningAcceptanceTests.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2018 the original author or authors. - * - * Licensed 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 - * - * https://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 sample.acceptance.tests; - -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -import static org.junit.Assert.fail; - -/** - * Do not run these tests as part of an IDE build or individually. - * These are acceptance tests for the spring cloud stream samples. - * The recommended way to run these tests are using the runAcceptanceTests.sh script in this module. - * More about running that script can be found in the README. - * - * @author Soby Chacko - */ -public class PartitioningAcceptanceTests extends AbstractAcceptanceTests { - - private static final Logger logger = LoggerFactory.getLogger(PartitioningAcceptanceTests.class); - - @Test - public void testPartitioningWith4ConsumersRabbit() throws Exception { - - Thread.sleep(10_000); - - String prodUrl = System.getProperty("partitioning.producer.route"); - - boolean foundLogs = waitForLogEntry("Partitioning producer", prodUrl, "Started PartProducerApplication in"); - if(!foundLogs) { - fail("Did not find the logging messages."); - } - - String consumer1Url = System.getProperty("partitioning.consumer1.route"); - String consumer2Url = System.getProperty("partitioning.consumer2.route"); - String consumer3Url = System.getProperty("partitioning.consumer3.route"); - //String consumer4Url = System.getProperty("partitioning.consumer4.route"); - - Future future1 = verifyPartitions("Partitioning Consumer-1", consumer1Url, - "f received from partition partitioned.destination.myGroup-0", - "g received from partition partitioned.destination.myGroup-0", - "h received from partition partitioned.destination.myGroup-0"); - Future future2 = verifyPartitions("Partitioning Consumer-2", consumer2Url, - "fo received from partition partitioned.destination.myGroup-1", - "go received from partition partitioned.destination.myGroup-1", - "ho received from partition partitioned.destination.myGroup-1"); - Future future3 = verifyPartitions("Partitioning Consumer-3",consumer3Url, - "foo received from partition partitioned.destination.myGroup-2", - "goo received from partition partitioned.destination.myGroup-2", - "hoo received from partition partitioned.destination.myGroup-2"); -// Future future4 = verifyPartitions("Partitioning Consumer-4",consumer4Url, -// "fooz received from partition partitioned.destination.myGroup-3", -// "gooz received from partition partitioned.destination.myGroup-3", -// "hooz received from partition partitioned.destination.myGroup-3"); - - verifyResults(future1, future2, future3); - } - - private Future verifyPartitions(String consumer1Msg, String consumerRoute, - String... entries) { - - ExecutorService executorService = Executors.newSingleThreadExecutor(); - - Future submit = executorService.submit(() -> { - boolean found = waitForLogEntry(consumer1Msg, consumerRoute, entries); - if (!found) { - fail("Could not find the test data in the logs"); - } - }); - - executorService.shutdown(); - return submit; - } - - private void verifyResults(Future... futures) throws Exception { - for (Future future : futures) { - try { - future.get(); - } - catch (Exception e) { - throw e; - } - } - } -} diff --git a/spring-cloud-stream-acceptance-tests/src/test/java/sample/acceptance/tests/PartitioningKafkaAcceptanceTests.java b/spring-cloud-stream-acceptance-tests/src/test/java/sample/acceptance/tests/PartitioningKafkaAcceptanceTests.java deleted file mode 100644 index f8278f1..0000000 --- a/spring-cloud-stream-acceptance-tests/src/test/java/sample/acceptance/tests/PartitioningKafkaAcceptanceTests.java +++ /dev/null @@ -1,72 +0,0 @@ -package sample.acceptance.tests; - -import org.junit.Test; - -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -import static org.junit.Assert.fail; - -public class PartitioningKafkaAcceptanceTests extends AbstractAcceptanceTests { - - - @Test - public void testPartitioningWith3ConsumersKafka() throws Exception { - - Thread.sleep(10_000); - - String prodUrl = System.getProperty("partitioning.producer.route"); - - boolean foundLogs = waitForLogEntry("Partitioning producer", prodUrl, "Started PartProducerApplication in"); - if(!foundLogs) { - fail("Did not find the logging messages."); - } - - String consumer1Url = System.getProperty("partitioning.consumer1.route"); - String consumer2Url = System.getProperty("partitioning.consumer2.route"); - String consumer3Url = System.getProperty("partitioning.consumer3.route"); - - Future future1 = verifyPartitions("Partitioning Consumer-1", consumer1Url, - "f received from partition 0", - "g received from partition 0", - "h received from partition 0"); - Future future2 = verifyPartitions("Partitioning Consumer-2", consumer2Url, - "fo received from partition 1", - "go received from partition 1", - "ho received from partition 1"); - Future future3 = verifyPartitions("Partitioning Consumer-3", consumer3Url, - "foo received from partition 2", - "goo received from partition 2", - "hoo received from partition 2"); - - verifyResults(future1, future2, future3); - } - - private Future verifyPartitions(String consumerMsg, String consumerRoute, - String... entries) { - - ExecutorService executorService = Executors.newSingleThreadExecutor(); - - Future submit = executorService.submit(() -> { - boolean found = waitForLogEntry(consumerMsg, consumerRoute, entries); - if (!found) { - fail("Could not find the test data in the logs"); - } - }); - - executorService.shutdown(); - return submit; - } - - private void verifyResults(Future... futures) throws Exception { - for (Future future : futures) { - try { - future.get(); - } - catch (Exception e) { - throw e; - } - } - } -} diff --git a/spring-cloud-stream-acceptance-tests/src/test/java/sample/acceptance/tests/TickTock13AcceptanceTests.java b/spring-cloud-stream-acceptance-tests/src/test/java/sample/acceptance/tests/TickTock13AcceptanceTests.java deleted file mode 100644 index 1fc0068..0000000 --- a/spring-cloud-stream-acceptance-tests/src/test/java/sample/acceptance/tests/TickTock13AcceptanceTests.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2018 the original author or authors. - * - * Licensed 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 - * - * https://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 sample.acceptance.tests; - -import org.junit.Test; - -import static org.junit.Assert.fail; - -/** - * @author Soby Chacko - */ -public class TickTock13AcceptanceTests extends AbstractAcceptanceTests { - - @Test - public void testTickTock13Rabbit() { - - String timeSourceUrl = System.getProperty("time.source.route"); - String logSinkUrl = System.getProperty("log.sink.route"); - - boolean foundLogs = waitForLogEntry(true, "Time Source", timeSourceUrl, "Started TimeSource"); - if(!foundLogs) { - fail("Did not find the time source started logging message."); - } - - foundLogs = waitForLogEntry(true,"Log Sink", logSinkUrl, "Started LogSink"); - if(!foundLogs) { - fail("Did not find the log sink started logging message."); - } - - foundLogs = waitForLogEntry(true,"Log Sink", logSinkUrl, "TICKTOCK - TIMESTAMP:"); - if(!foundLogs) { - fail("Did not find the ticktock messages in log sink"); - } - } - -} diff --git a/spring-cloud-stream-acceptance-tests/src/test/java/sample/acceptance/tests/UppercaseTransformerAcceptanceTests.java b/spring-cloud-stream-acceptance-tests/src/test/java/sample/acceptance/tests/UppercaseTransformerAcceptanceTests.java deleted file mode 100644 index 55c1bef..0000000 --- a/spring-cloud-stream-acceptance-tests/src/test/java/sample/acceptance/tests/UppercaseTransformerAcceptanceTests.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2018 the original author or authors. - * - * Licensed 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 - * - * https://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 sample.acceptance.tests; - -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.junit.Assert.fail; - -/** - * Do not run these tests as part of an IDE build or individually. - * These are acceptance tests for the spring cloud stream samples. - * The recommended way to run these tests are using the runAcceptanceTests.sh script in this module. - * More about running that script can be found in the README. - * - * @author Soby Chacko - */ -public class UppercaseTransformerAcceptanceTests extends AbstractAcceptanceTests { - - private static final Logger logger = LoggerFactory.getLogger(UppercaseTransformerAcceptanceTests.class); - - @Test - public void testUppercaseTransformerRabbit() { - - String url = System.getProperty("uppercase.processor.route"); - - boolean foundLogs = waitForLogEntry("Uppercase Transformer", url, "Started UppercaseTransformerApplication in", - "Data received: FOO", "Data received: BAR"); - if(!foundLogs) { - fail("Did not find the logging messages."); - } - } -}