This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push: new 7e7f8681a07 CAMEL-20941: camel-parquet-avro: Added hadoop JARs needed to use this library. 7e7f8681a07 is described below commit 7e7f8681a0791c0e1385b7be94d0434acf24c698 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Wed Jul 3 19:43:37 2024 +0200 CAMEL-20941: camel-parquet-avro: Added hadoop JARs needed to use this library. --- components/camel-parquet-avro/pom.xml | 33 ++++--------- .../avro/SpringParquetAvroDataFormatRouteTest.java | 54 ---------------------- .../SpringParquetAvroDataFormatRouteTest.xml | 45 ------------------ 3 files changed, 10 insertions(+), 122 deletions(-) diff --git a/components/camel-parquet-avro/pom.xml b/components/camel-parquet-avro/pom.xml index 96b69f54a23..ade5b4ded88 100644 --- a/components/camel-parquet-avro/pom.xml +++ b/components/camel-parquet-avro/pom.xml @@ -49,18 +49,22 @@ <artifactId>parquet-common</artifactId> <version>${parquet-common-version}</version> </dependency> + <dependency> + <groupId>org.apache.parquet</groupId> + <artifactId>parquet-avro</artifactId> + <version>${parquet-avro-version}</version> + </dependency> + <!-- parquet need hadoop --> <dependency> <groupId>org.apache.hadoop</groupId> - <artifactId>hadoop-client</artifactId> + <artifactId>hadoop-common</artifactId> <version>${hadoop3-version}</version> - <scope>provided</scope> </dependency> - <dependency> - <groupId>org.apache.parquet</groupId> - <artifactId>parquet-avro</artifactId> - <version>${parquet-avro-version}</version> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-mapreduce-client-core</artifactId> + <version>${hadoop3-version}</version> </dependency> <!-- logging --> @@ -77,22 +81,5 @@ <artifactId>camel-test-junit5</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-spring-xml</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-test-spring-junit5</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>jakarta.xml.bind</groupId> - <artifactId>jakarta.xml.bind-api</artifactId> - <version>${jakarta-xml-bind-api-version}</version> - <optional>true</optional> - </dependency> </dependencies> </project> diff --git a/components/camel-parquet-avro/src/test/java/org/apache/camel/dataformat/parquet/avro/SpringParquetAvroDataFormatRouteTest.java b/components/camel-parquet-avro/src/test/java/org/apache/camel/dataformat/parquet/avro/SpringParquetAvroDataFormatRouteTest.java deleted file mode 100644 index 5f30d43e80e..00000000000 --- a/components/camel-parquet-avro/src/test/java/org/apache/camel/dataformat/parquet/avro/SpringParquetAvroDataFormatRouteTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.dataformat.parquet.avro; - -import java.util.Collection; -import java.util.List; - -import org.apache.camel.Exchange; -import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.test.spring.junit5.CamelSpringTestSupport; -import org.junit.jupiter.api.Test; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -import static org.junit.jupiter.api.Assertions.assertArrayEquals; - -public class SpringParquetAvroDataFormatRouteTest extends CamelSpringTestSupport { - - @Test - public void testSpringMarshalAndUnmarshalMap() throws Exception { - Collection<Pojo> in = List.of( - new Pojo(1, "airport"), - new Pojo(2, "penguin"), - new Pojo(3, "verb")); - MockEndpoint mock = getMockEndpoint("mock:reverse"); - mock.message(0).body().isEqualTo(in); - - Object marshalled = template.requestBody("direct:marshal", in); - template.sendBody("direct:unmarshal", marshalled); - mock.assertIsSatisfied(); - List<Exchange> receivedExchanges = mock.getReceivedExchanges(); - assertArrayEquals(in.toArray(), receivedExchanges.get(0).getIn().getBody(List.class).toArray()); - } - - @Override - protected AbstractApplicationContext createApplicationContext() { - return new ClassPathXmlApplicationContext("SpringParquetAvroDataFormatRouteTest.xml"); - } - -} diff --git a/components/camel-parquet-avro/src/test/resources/SpringParquetAvroDataFormatRouteTest.xml b/components/camel-parquet-avro/src/test/resources/SpringParquetAvroDataFormatRouteTest.xml deleted file mode 100644 index 42b91142434..00000000000 --- a/components/camel-parquet-avro/src/test/resources/SpringParquetAvroDataFormatRouteTest.xml +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd - "> - - <!-- START SNIPPET: e1 --> - <camelContext xmlns="http://camel.apache.org/schema/spring"> - <route> - <from uri="direct:marshal"/> - <marshal> - <parquetAvro unmarshalType="org.apache.camel.dataformat.parquet.avro.Pojo" /> - </marshal> - </route> - <route> - <from uri="direct:unmarshal"/> - <unmarshal> - <parquetAvro unmarshalType="org.apache.camel.dataformat.parquet.avro.Pojo" /> - </unmarshal> - <to uri="mock:reverse"/> - </route> - </camelContext> - <!-- END SNIPPET: e1 --> - -</beans>