This is an automated email from the ASF dual-hosted git repository.
orpiske 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 35da7ca95df CAMEL-18928: removed component camel-johnzon
35da7ca95df is described below
commit 35da7ca95df5b294038f17dd5d7465788bb9e87b
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Mon Jan 16 15:26:14 2023 +0100
CAMEL-18928: removed component camel-johnzon
---
components/camel-johnzon/pom.xml | 73 -------
.../src/main/docs/johnzon-dataformat.adoc | 52 -----
.../camel/component/johnzon/JohnzonConstants.java | 25 ---
.../camel/component/johnzon/JohnzonDataFormat.java | 233 ---------------------
.../johnzon/JohnzonAttributeOrderTest.java | 79 -------
.../component/johnzon/JohnzonDataFormatTest.java | 87 --------
.../johnzon/JohnzonJsonDataFormatTest.java | 38 ----
.../component/johnzon/JohnzonMarshalTest.java | 88 --------
.../component/johnzon/JohnzonSkipNullTest.java | 55 -----
.../apache/camel/component/johnzon/NumberPojo.java | 134 ------------
.../johnzon/SpringJohnzonJsonDataFormatTest.java | 75 -------
.../camel/component/johnzon/TestOtherPojo.java | 40 ----
.../apache/camel/component/johnzon/TestPojo.java | 45 ----
.../src/test/resources/log4j2.properties | 28 ---
.../johnzon/SpringJohnzonJsonDataFormatTest.xml | 63 ------
components/pom.xml | 2 +-
docs/components/modules/dataformats/nav.adoc | 1 -
.../dataformats/pages/johnzon-dataformat.adoc | 1 -
18 files changed, 1 insertion(+), 1118 deletions(-)
diff --git a/components/camel-johnzon/pom.xml b/components/camel-johnzon/pom.xml
deleted file mode 100644
index d6f18b8717f..00000000000
--- a/components/camel-johnzon/pom.xml
+++ /dev/null
@@ -1,73 +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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.camel</groupId>
- <artifactId>components</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>camel-johnzon</artifactId>
- <packaging>jar</packaging>
- <name>Camel :: Johnzon</name>
- <description>Camel Johnzon support</description>
-
- <properties>
- </properties>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-support</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.johnzon</groupId>
- <artifactId>johnzon-core</artifactId>
- <version>${johnzon-version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.johnzon</groupId>
- <artifactId>johnzon-mapper</artifactId>
- <version>${johnzon-version}</version>
- </dependency>
- <dependency>
- <groupId>jakarta.json</groupId>
- <artifactId>jakarta.json-api</artifactId>
- <version>${jakarta-json-api-version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- testing -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-spring-junit5</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/components/camel-johnzon/src/main/docs/johnzon-dataformat.adoc
b/components/camel-johnzon/src/main/docs/johnzon-dataformat.adoc
deleted file mode 100644
index 9ab502cc4da..00000000000
--- a/components/camel-johnzon/src/main/docs/johnzon-dataformat.adoc
+++ /dev/null
@@ -1,52 +0,0 @@
-= JSON Johnzon DataFormat
-:doctitle: JSON Johnzon
-:shortname: johnzon
-:artifactid: camel-johnzon
-:description: Marshal POJOs to JSON and back using Johnzon
-:since: 2.18
-:supportlevel: Stable
-//Manually maintained attributes
-:camel-spring-boot-name: johnzon
-
-*Since Camel {since}*
-
-Johnzon is a Data Format which uses the
-http://johnzon.apache.org/[Johnzon Library]
-
-[source,java]
--------------------------------
-from("activemq:My.Queue").
- marshal().json(JsonLibrary.Johnzon).
- to("mqseries:Another.Queue");
--------------------------------
-
-== Johnzon Options
-
-
-
-// dataformat options: START
-include::partial$dataformat-options.adoc[]
-// dataformat options: END
-
-
-== Dependencies
-
-To use Johnzon in your camel routes you need to add the dependency
-on *camel-johnzon* which implements this data format.
-
-If you use maven you could just add the following to your pom.xml,
-substituting the version number for the latest & greatest release (see
-the download page for the latest versions).
-
-[source,xml]
-----------------------------------------------------------
-<dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-johnzon</artifactId>
- <version>x.x.x</version>
- <!-- use the same version as your Camel core version -->
-</dependency>
-----------------------------------------------------------
-
-
-include::spring-boot:partial$starter.adoc[]
diff --git
a/components/camel-johnzon/src/main/java/org/apache/camel/component/johnzon/JohnzonConstants.java
b/components/camel-johnzon/src/main/java/org/apache/camel/component/johnzon/JohnzonConstants.java
deleted file mode 100644
index 9458e05f355..00000000000
---
a/components/camel-johnzon/src/main/java/org/apache/camel/component/johnzon/JohnzonConstants.java
+++ /dev/null
@@ -1,25 +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.component.johnzon;
-
-public final class JohnzonConstants {
-
- public static final String UNMARSHAL_TYPE = "CamelJohnzonUnmarshalType";
-
- private JohnzonConstants() {
- }
-}
diff --git
a/components/camel-johnzon/src/main/java/org/apache/camel/component/johnzon/JohnzonDataFormat.java
b/components/camel-johnzon/src/main/java/org/apache/camel/component/johnzon/JohnzonDataFormat.java
deleted file mode 100644
index b127cc94386..00000000000
---
a/components/camel-johnzon/src/main/java/org/apache/camel/component/johnzon/JohnzonDataFormat.java
+++ /dev/null
@@ -1,233 +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.component.johnzon;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Comparator;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.CamelContextAware;
-import org.apache.camel.Exchange;
-import org.apache.camel.spi.DataFormat;
-import org.apache.camel.spi.DataFormatName;
-import org.apache.camel.spi.Metadata;
-import org.apache.camel.spi.annotations.Dataformat;
-import org.apache.camel.support.service.ServiceSupport;
-import org.apache.camel.util.ObjectHelper;
-import org.apache.johnzon.mapper.Mapper;
-import org.apache.johnzon.mapper.MapperBuilder;
-import org.apache.johnzon.mapper.reflection.JohnzonParameterizedType;
-
-/**
- * Marshal POJOs to JSON and back using <a
href="http://johnzon.apache.org/">Johnzon</a>
- */
-@Dataformat("johnzon")
-@Metadata(includeProperties =
"unmarshalType,unmarshalTypeName,objectMapper,prettyPrint")
-public class JohnzonDataFormat extends ServiceSupport implements DataFormat,
DataFormatName, CamelContextAware {
-
- private CamelContext camelContext;
- private Mapper objectMapper;
- private String unmarshalTypeName;
- private Class<?> unmarshalType;
- private JohnzonParameterizedType parameterizedType;
- private Comparator<String> attributeOrder;
- private boolean prettyPrint;
- private String encoding;
- private boolean skipEmptyArray;
- private boolean skipNull;
-
- public JohnzonDataFormat() {
- this(Object.class);
- }
-
- /**
- * Use the default Johnzon {@link Mapper} and with a custom unmarshal type
- *
- * @param unmarshalType the custom unmarshal type
- */
- public JohnzonDataFormat(Class<?> unmarshalType) {
- this(null, unmarshalType);
- }
-
- /**
- * Use the default Johnzon {@link Mapper} and with a custom parameterized
type
- *
- * @param parameterizedType the custom parameterized type
- */
- public JohnzonDataFormat(JohnzonParameterizedType parameterizedType) {
- this(null, parameterizedType);
- }
-
- /**
- * Use a custom Johnzon mapper and unmarshal type
- *
- * @param mapper the custom mapper
- * @param unmarshalType the custom unmarshal type
- */
- public JohnzonDataFormat(Mapper mapper, Class<?> unmarshalType) {
- this.objectMapper = mapper;
- this.unmarshalType = unmarshalType;
- }
-
- /**
- * Use a custom Johnzon mapper and unmarshal type
- *
- * @param mapper the custom mapper
- * @param parameterizedType the JohnzonParameterizedType type
- */
- public JohnzonDataFormat(Mapper mapper, JohnzonParameterizedType
parameterizedType) {
- this.objectMapper = mapper;
- this.parameterizedType = parameterizedType;
- }
-
- @Override
- public void setCamelContext(CamelContext camelContext) {
- this.camelContext = camelContext;
- }
-
- @Override
- public CamelContext getCamelContext() {
- return camelContext;
- }
-
- @Override
- public String getDataFormatName() {
- return "johnzon";
- }
-
- public Mapper getObjectMapper() {
- return objectMapper;
- }
-
- public void setObjectMapper(Mapper objectMapper) {
- this.objectMapper = objectMapper;
- }
-
- public Class<?> getUnmarshalType() {
- return unmarshalType;
- }
-
- public void setUnmarshalType(Class<?> unmarshalType) {
- this.unmarshalType = unmarshalType;
- }
-
- public String getUnmarshalTypeName() {
- return unmarshalTypeName;
- }
-
- public void setUnmarshalTypeName(String unmarshalTypeName) {
- this.unmarshalTypeName = unmarshalTypeName;
- }
-
- public JohnzonParameterizedType getParameterizedType() {
- return parameterizedType;
- }
-
- public void setParameterizedType(JohnzonParameterizedType
parameterizedType) {
- this.parameterizedType = parameterizedType;
- }
-
- public boolean isPrettyPrint() {
- return prettyPrint;
- }
-
- public void setPrettyPrint(boolean prettyPrint) {
- this.prettyPrint = prettyPrint;
- }
-
- public String getEncoding() {
- return encoding;
- }
-
- public void setEncoding(String encoding) {
- this.encoding = encoding;
- }
-
- public boolean isSkipEmptyArray() {
- return skipEmptyArray;
- }
-
- public void setSkipEmptyArray(boolean skipEmptyArray) {
- this.skipEmptyArray = skipEmptyArray;
- }
-
- public boolean isSkipNull() {
- return skipNull;
- }
-
- public void setSkipNull(boolean skipNull) {
- this.skipNull = skipNull;
- }
-
- public Comparator<String> getAttributeOrder() {
- return attributeOrder;
- }
-
- public void setAttributeOrder(Comparator<String> attributeOrder) {
- this.attributeOrder = attributeOrder;
- }
-
- @Override
- public void marshal(Exchange exchange, Object graph, OutputStream stream)
throws Exception {
- objectMapper.writeObject(graph, stream);
- }
-
- @Override
- public Object unmarshal(Exchange exchange, InputStream stream) throws
Exception {
- // is there a header with the unmarshal type?
- Class<?> clazz = unmarshalType;
- String type =
exchange.getIn().getHeader(JohnzonConstants.UNMARSHAL_TYPE, String.class);
- if (type != null) {
- clazz =
exchange.getContext().getClassResolver().resolveMandatoryClass(type);
- }
- if (parameterizedType != null) {
- return this.objectMapper.readCollection(stream, parameterizedType);
- } else {
- return this.objectMapper.readObject(stream, clazz);
- }
- }
-
- @Override
- protected void doInit() throws Exception {
- if (unmarshalTypeName != null && (unmarshalType == null ||
unmarshalType == Object.class)) {
- unmarshalType =
camelContext.getClassResolver().resolveClass(unmarshalTypeName);
- }
- }
-
- @Override
- protected void doStart() throws Exception {
- if (objectMapper == null) {
- MapperBuilder builder = new MapperBuilder();
- builder.setPretty(prettyPrint);
- builder.setSkipNull(skipNull);
- builder.setSkipEmptyArray(skipEmptyArray);
- if (ObjectHelper.isNotEmpty(encoding)) {
- builder.setEncoding(encoding);
- }
- if (ObjectHelper.isNotEmpty(attributeOrder)) {
- builder.setAttributeOrder(attributeOrder);
- }
- objectMapper = builder.build();
- }
- }
-
- @Override
- protected void doStop() throws Exception {
- // noop
- }
-}
diff --git
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonAttributeOrderTest.java
b/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonAttributeOrderTest.java
deleted file mode 100644
index e9aa5df1a1d..00000000000
---
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonAttributeOrderTest.java
+++ /dev/null
@@ -1,79 +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.component.johnzon;
-
-import java.math.BigDecimal;
-import java.util.Comparator;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-public class JohnzonAttributeOrderTest extends CamelTestSupport {
-
- final String expectedJson
- =
"{\"bool\":true,\"bg\":123.123,\"doubleNumber\":123.123,\"intNumber\":123,\"floatNumber\":123.0,\"longNumber\":123}";
-
- @Test
- public void testMarshalAndUnmarshalMap() throws Exception {
- NumberPojo nc = new NumberPojo();
- nc.setBg(new BigDecimal("123.123"));
- nc.setDoubleNumber(123.123);
- nc.setBool(true);
- nc.setFloatNumber(123);
- nc.setLongNumber(123L);
- nc.setIntNumber(123);
-
- MockEndpoint mock = getMockEndpoint("mock:reverse");
- mock.expectedMessageCount(1);
- mock.message(0).body().isInstanceOf(NumberPojo.class);
- mock.message(0).body().isEqualTo(nc);
-
- Object marshalled = template.requestBody("direct:in", nc);
- String marshalledAsString =
context.getTypeConverter().convertTo(String.class, marshalled);
- assertEquals(expectedJson, marshalledAsString);
-
- template.sendBody("direct:back", marshalled);
-
- mock.assertIsSatisfied();
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
-
- @Override
- public void configure() {
- final Comparator<String> attributeOrder = new
Comparator<String>() {
- @Override
- public int compare(final String o1, final String o2) {
- return expectedJson.indexOf(o1) -
expectedJson.indexOf(o2);
- }
- };
- JohnzonDataFormat format = new
JohnzonDataFormat(NumberPojo.class);
- format.setAttributeOrder(attributeOrder);
-
- from("direct:in").marshal(format);
- from("direct:back").unmarshal(format).to("mock:reverse");
- }
- };
- }
-
-}
diff --git
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonDataFormatTest.java
b/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonDataFormatTest.java
deleted file mode 100644
index b07e5f78fb3..00000000000
---
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonDataFormatTest.java
+++ /dev/null
@@ -1,87 +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.component.johnzon;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.camel.impl.DefaultCamelContext;
-import org.apache.camel.support.DefaultExchange;
-import org.apache.johnzon.mapper.reflection.JohnzonParameterizedType;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-public class JohnzonDataFormatTest {
-
- @Test
- public void testString() throws Exception {
- testJson("\"A string\"", "A string", String.class, null);
- }
-
- @Test
- public void testMap() throws Exception {
- testJson("{\"value\":123}", Collections.singletonMap("value", 123),
Map.class, null);
- }
-
- @Test
- public void testList() throws Exception {
- JohnzonParameterizedType type = new
JohnzonParameterizedType(List.class, Map.class);
- testJson("[{\"value\":123}]",
- new
ArrayList<>(Collections.singletonList(Collections.singletonMap("value", 123))),
null, type);
- }
-
- @Test
- public void testArray() throws Exception {
- testJson("{\"value\":123}", new ArrayList<String>(), ArrayList.class,
null);
- }
-
- @Test
- public void testSkipEmptyArray() throws Exception {
- JohnzonParameterizedType type = new
JohnzonParameterizedType(ArrayList.class, ArrayList.class);
- testJson("[{\"value\":123}]",
- new
ArrayList<>(Collections.singletonList(Collections.emptyList())), null, type);
- }
-
- private void testJson(String json, Object expected, Class<?>
unmarshalType, JohnzonParameterizedType parameterizedType)
- throws Exception {
- Object unmarshalled;
- JohnzonDataFormat johnzonDataFormat = null;
-
- try {
- if (unmarshalType != null) {
- johnzonDataFormat = new JohnzonDataFormat(unmarshalType);
- } else {
- johnzonDataFormat = new JohnzonDataFormat(parameterizedType);
- }
- johnzonDataFormat.setSkipEmptyArray(true);
- johnzonDataFormat.doStart();
- try (InputStream in = new ByteArrayInputStream(json.getBytes())) {
- unmarshalled = johnzonDataFormat.unmarshal(new
DefaultExchange(new DefaultCamelContext()), in);
- }
- assertEquals(expected, unmarshalled);
- } finally {
- if (johnzonDataFormat != null) {
- johnzonDataFormat.close();
- }
- }
- }
-}
diff --git
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonJsonDataFormatTest.java
b/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonJsonDataFormatTest.java
deleted file mode 100644
index 8121ff10e04..00000000000
---
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonJsonDataFormatTest.java
+++ /dev/null
@@ -1,38 +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.component.johnzon;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.model.dataformat.JsonLibrary;
-
-public class JohnzonJsonDataFormatTest extends JohnzonMarshalTest {
-
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:in").marshal().json(JsonLibrary.Johnzon);
-
from("direct:back").unmarshal().json(JsonLibrary.Johnzon).to("mock:reverse");
-
- from("direct:inPojo").marshal().json(JsonLibrary.Johnzon);
- from("direct:backPojo").unmarshal().json(JsonLibrary.Johnzon,
TestPojo.class).to("mock:reversePojo");
- }
- };
- }
-
-}
diff --git
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonMarshalTest.java
b/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonMarshalTest.java
deleted file mode 100644
index c9d9ec0b868..00000000000
---
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonMarshalTest.java
+++ /dev/null
@@ -1,88 +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.component.johnzon;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-public class JohnzonMarshalTest extends CamelTestSupport {
-
- @Test
- public void testMarshalAndUnmarshalMap() throws Exception {
- Map<String, Object> in = new HashMap<>();
- in.put("name", "Camel");
-
- MockEndpoint mock = getMockEndpoint("mock:reverse");
- mock.expectedMessageCount(1);
- mock.message(0).body().isInstanceOf(Map.class);
- mock.message(0).body().isEqualTo(in);
-
- Object marshalled = template.requestBody("direct:in", in);
- String marshalledAsString =
context.getTypeConverter().convertTo(String.class, marshalled);
- assertEquals("{\"name\":\"Camel\"}", marshalledAsString);
-
- template.sendBody("direct:back", marshalled);
-
- mock.assertIsSatisfied();
- }
-
- @Test
- public void testMarshalAndUnmarshalPojo() throws Exception {
- TestPojo in = new TestPojo();
- in.setName("Camel");
-
- MockEndpoint mock = getMockEndpoint("mock:reversePojo");
- mock.expectedMessageCount(1);
- mock.message(0).body().isInstanceOf(TestPojo.class);
- mock.message(0).body().isEqualTo(in);
-
- Object marshalled = template.requestBody("direct:inPojo", in);
- String marshalledAsString =
context.getTypeConverter().convertTo(String.class, marshalled);
- assertEquals("{\"name\":\"Camel\"}", marshalledAsString);
-
- template.sendBody("direct:backPojo", marshalled);
-
- mock.assertIsSatisfied();
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
-
- @Override
- public void configure() {
- JohnzonDataFormat format = new JohnzonDataFormat();
-
- from("direct:in").marshal(format);
- from("direct:back").unmarshal(format).to("mock:reverse");
-
- JohnzonDataFormat formatPojo = new
JohnzonDataFormat(TestPojo.class);
-
- from("direct:inPojo").marshal(formatPojo);
-
from("direct:backPojo").unmarshal(formatPojo).to("mock:reversePojo");
- }
- };
- }
-
-}
diff --git
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonSkipNullTest.java
b/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonSkipNullTest.java
deleted file mode 100644
index d608d408606..00000000000
---
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/JohnzonSkipNullTest.java
+++ /dev/null
@@ -1,55 +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.component.johnzon;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-
-public class JohnzonSkipNullTest extends CamelTestSupport {
-
- @Test
- public void testMmarshalPojo() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:marshal");
- mock.expectedMessageCount(1);
- mock.message(0).body(String.class).isEqualTo("{\"name\":\"Camel\"}");
-
- TestOtherPojo pojo = new TestOtherPojo();
- pojo.setName("Camel");
- pojo.setCountry(null);
-
- template.sendBody("direct:marshal", pojo);
-
- MockEndpoint.assertIsSatisfied(context);
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
-
- @Override
- public void configure() {
- JohnzonDataFormat format = new JohnzonDataFormat();
- format.setSkipNull(true);
-
- from("direct:marshal").marshal(format).to("mock:marshal");
- }
- };
- }
-
-}
diff --git
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/NumberPojo.java
b/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/NumberPojo.java
deleted file mode 100644
index 3a9f132ed62..00000000000
---
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/NumberPojo.java
+++ /dev/null
@@ -1,134 +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.component.johnzon;
-
-import java.math.BigDecimal;
-
-public class NumberPojo {
- private BigDecimal bg;
- private int intNumber;
- private long longNumber;
- private double doubleNumber;
- private float floatNumber;
- private boolean bool;
-
- public BigDecimal getBg() {
- return bg;
- }
-
- public void setBg(final BigDecimal bg) {
- this.bg = bg;
- }
-
- public int getIntNumber() {
- return intNumber;
- }
-
- public void setIntNumber(final int intNumber) {
- this.intNumber = intNumber;
- }
-
- public long getLongNumber() {
- return longNumber;
- }
-
- public void setLongNumber(final long longNumber) {
- this.longNumber = longNumber;
- }
-
- public double getDoubleNumber() {
- return doubleNumber;
- }
-
- public void setDoubleNumber(final double doubleNumber) {
- this.doubleNumber = doubleNumber;
- }
-
- public float getFloatNumber() {
- return floatNumber;
- }
-
- public void setFloatNumber(final float floatNumber) {
- this.floatNumber = floatNumber;
- }
-
- public boolean isBool() {
- return bool;
- }
-
- public void setBool(final boolean bool) {
- this.bool = bool;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((bg == null) ? 0 : bg.hashCode());
- result = prime * result + (bool ? 1231 : 1237);
- long temp;
- temp = Double.doubleToLongBits(doubleNumber);
- result = prime * result + (int) (temp ^ (temp >>> 32));
- result = prime * result + Float.floatToIntBits(floatNumber);
- result = prime * result + intNumber;
- result = prime * result + (int) (longNumber ^ (longNumber >>> 32));
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final NumberPojo other = (NumberPojo) obj;
- if (bg == null) {
- if (other.bg != null) {
- return false;
- }
- } else if (!bg.equals(other.bg)) {
- return false;
- }
- if (bool != other.bool) {
- return false;
- }
- if (Double.doubleToLongBits(doubleNumber) !=
Double.doubleToLongBits(other.doubleNumber)) {
- return false;
- }
- if (Float.floatToIntBits(floatNumber) !=
Float.floatToIntBits(other.floatNumber)) {
- return false;
- }
- if (intNumber != other.intNumber) {
- return false;
- }
- if (longNumber != other.longNumber) {
- return false;
- }
- return true;
- }
-
- @Override
- public String toString() {
- return "NumberPojo [bg=" + bg + ", intNumber=" + intNumber + ",
longNumber=" + longNumber + ", doubleNumber="
- + doubleNumber + ", floatNumber=" + floatNumber + ", bool=" +
bool + "]";
- }
-}
diff --git
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/SpringJohnzonJsonDataFormatTest.java
b/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/SpringJohnzonJsonDataFormatTest.java
deleted file mode 100644
index 720ef6ae73e..00000000000
---
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/SpringJohnzonJsonDataFormatTest.java
+++ /dev/null
@@ -1,75 +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.component.johnzon;
-
-import java.util.HashMap;
-import java.util.Map;
-
-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.AbstractXmlApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-public class SpringJohnzonJsonDataFormatTest extends CamelSpringTestSupport {
-
- @Test
- public void testMarshalAndUnmarshalMap() throws Exception {
- Map<String, Object> in = new HashMap<>();
- in.put("name", "Camel");
-
- MockEndpoint mock = getMockEndpoint("mock:reverse");
- mock.expectedMessageCount(1);
- mock.message(0).body().isInstanceOf(Map.class);
- mock.message(0).body().isEqualTo(in);
-
- Object marshalled = template.requestBody("direct:in", in);
- String marshalledAsString =
context.getTypeConverter().convertTo(String.class, marshalled);
- assertEquals("{\"name\":\"Camel\"}", marshalledAsString);
-
- template.sendBody("direct:back", marshalled);
-
- mock.assertIsSatisfied();
- }
-
- @Test
- public void testMarshalAndUnmarshalPojo() throws Exception {
- TestPojo in = new TestPojo();
- in.setName("Camel");
-
- MockEndpoint mock = getMockEndpoint("mock:reversePojo");
- mock.expectedMessageCount(1);
- mock.message(0).body().isInstanceOf(TestPojo.class);
- mock.message(0).body().isEqualTo(in);
-
- Object marshalled = template.requestBody("direct:inPojo", in);
- String marshalledAsString =
context.getTypeConverter().convertTo(String.class, marshalled);
- assertEquals("{\"name\":\"Camel\"}", marshalledAsString);
-
- template.sendBody("direct:backPojo", marshalled);
-
- mock.assertIsSatisfied();
- }
-
- @Override
- protected AbstractXmlApplicationContext createApplicationContext() {
- return new
ClassPathXmlApplicationContext("org/apache/camel/component/johnzon/SpringJohnzonJsonDataFormatTest.xml");
- }
-
-}
diff --git
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/TestOtherPojo.java
b/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/TestOtherPojo.java
deleted file mode 100644
index 37dca1112b1..00000000000
---
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/TestOtherPojo.java
+++ /dev/null
@@ -1,40 +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.component.johnzon;
-
-public class TestOtherPojo {
-
- private String name;
- private String country;
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getCountry() {
- return country;
- }
-
- public void setCountry(String country) {
- this.country = country;
- }
-
-}
diff --git
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/TestPojo.java
b/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/TestPojo.java
deleted file mode 100644
index 65ac58df872..00000000000
---
a/components/camel-johnzon/src/test/java/org/apache/camel/component/johnzon/TestPojo.java
+++ /dev/null
@@ -1,45 +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.component.johnzon;
-
-public class TestPojo {
-
- private String name;
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public boolean equals(Object obj) {
- return this.name.equals(((TestPojo) obj).getName());
- }
-
- @Override
- public int hashCode() {
- return name != null ? name.hashCode() : 0;
- }
-
- @Override
- public String toString() {
- return "TestPojo[" + name + "]";
- }
-}
diff --git a/components/camel-johnzon/src/test/resources/log4j2.properties
b/components/camel-johnzon/src/test/resources/log4j2.properties
deleted file mode 100644
index f3373d13dd1..00000000000
--- a/components/camel-johnzon/src/test/resources/log4j2.properties
+++ /dev/null
@@ -1,28 +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.
-## ---------------------------------------------------------------------------
-
-appender.file.type = File
-appender.file.name = file
-appender.file.fileName = target/camel-johnzon-test.log
-appender.file.layout.type = PatternLayout
-appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
-appender.out.type = Console
-appender.out.name = out
-appender.out.layout.type = PatternLayout
-appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
-rootLogger.level = INFO
-rootLogger.appenderRef.file.ref = file
diff --git
a/components/camel-johnzon/src/test/resources/org/apache/camel/component/johnzon/SpringJohnzonJsonDataFormatTest.xml
b/components/camel-johnzon/src/test/resources/org/apache/camel/component/johnzon/SpringJohnzonJsonDataFormatTest.xml
deleted file mode 100644
index b531d6206a1..00000000000
---
a/components/camel-johnzon/src/test/resources/org/apache/camel/component/johnzon/SpringJohnzonJsonDataFormatTest.xml
+++ /dev/null
@@ -1,63 +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 id="camel" xmlns="http://camel.apache.org/schema/spring">
-
- <!-- we define the json johnzon data formats to be used -->
- <dataFormats>
- <!-- this uses the default unmarshal type that is a Map based -->
- <json id="johnzon" library="Johnzon"/>
- <!-- and this one uses our own TestPojo class as unmarshal type -->
- <json id="pojo" library="Johnzon"
unmarshalType="org.apache.camel.component.johnzon.TestPojo"/>
- </dataFormats>
-
- <route>
- <from uri="direct:in"/>
- <marshal><custom ref="johnzon"/></marshal>
- </route>
-
- <route>
- <from uri="direct:back"/>
- <unmarshal><custom ref="johnzon"/></unmarshal>
- <to uri="mock:reverse"/>
- </route>
-
- <route>
- <from uri="direct:inPojo"/>
- <marshal><custom ref="pojo"/></marshal>
- </route>
-
- <route>
- <from uri="direct:backPojo"/>
- <unmarshal><custom ref="pojo"/></unmarshal>
- <to uri="mock:reversePojo"/>
- </route>
-
- </camelContext>
- <!-- END SNIPPET: e1 -->
-
-</beans>
diff --git a/components/pom.xml b/components/pom.xml
index d6a9a400013..f10c6fea59e 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -180,7 +180,7 @@
<module>camel-jgroups</module>
<module>camel-jira</module>
<module>camel-jmx</module>
- <!--module>camel-johnzon</module-->
+
<module>camel-jolt</module>
<module>camel-joor</module>
<module>camel-jpa</module>
diff --git a/docs/components/modules/dataformats/nav.adoc
b/docs/components/modules/dataformats/nav.adoc
index 3e44a3796c2..5cb3976443e 100644
--- a/docs/components/modules/dataformats/nav.adoc
+++ b/docs/components/modules/dataformats/nav.adoc
@@ -24,7 +24,6 @@
** xref:fastjson-dataformat.adoc[JSON Fastjson]
** xref:gson-dataformat.adoc[JSON Gson]
** xref:jackson-dataformat.adoc[JSON Jackson]
-** xref:johnzon-dataformat.adoc[JSON Johnzon]
** xref:jsonb-dataformat.adoc[JSON JSON-B]
** xref:jsonApi-dataformat.adoc[JSonApi]
** xref:lzf-dataformat.adoc[LZF Deflate Compression]
diff --git a/docs/components/modules/dataformats/pages/johnzon-dataformat.adoc
b/docs/components/modules/dataformats/pages/johnzon-dataformat.adoc
deleted file mode 120000
index e6f53ca9c42..00000000000
--- a/docs/components/modules/dataformats/pages/johnzon-dataformat.adoc
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../components/camel-johnzon/src/main/docs/johnzon-dataformat.adoc
\ No newline at end of file