Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 5.0.3 #146

Merged
merged 13 commits into from
Feb 21, 2025
2 changes: 1 addition & 1 deletion aggregate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>aggregate</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion amazon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>amazon</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>auth</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cookies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>cookies</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion csvtoxml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>csvtoxml</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion docconverter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>docconverter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion edi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>edi</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion edifact/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>edifact</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion edifactcommon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>edifactcommon</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion edifactdotweb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>edifactdotweb</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion edifactstandards/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>edifactstandards</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion encoder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>encoder</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion enrich/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>enrich</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion exceltoxml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>exceltoxml</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion flv/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>flv</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion formtoxml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>formtoxml</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion googledrive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>googledrive</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jsontoxmllegacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>jsontoxmllegacy</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class Constants {
);

public static final String INTERNAL_NULL_OBJECT_NODE_VALUE = "@NULL@";
public static final String JSON_NULL_VALUE = "json_null";
public static final String NULL_VALUE = "null";

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ public class TextType implements NodeTransaction {
@Override
public Element process(JsonToXmlConfiguration config) {
// extract child as a text

if(config.getJsonNode().isNull()) {
if(config.isTypeHints()) {
config.getElement().setAttribute(Constants.JSON_XML_ATTR_CLASS, Constants.JSON_XML_ATTR_TYPE_OBJECT);
config.getElement().setAttribute(Constants.NULL_VALUE, "true");
} else {
config.getElement().setAttribute(Constants.JSON_NULL_VALUE, "true");
}
return config.getElement();
}

Text textNode = config.getDocument().createTextNode(config.getJsonNode().asText());
config.getElement().appendChild(textNode);
if(config.getElement().hasAttribute(Constants.JSON_XML_ATTR_TYPE) || !config.isTypeHints()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,55 @@ public void testJsonXml_7_EATT() throws Exception {
);
}

/*****************************************
** Example 8
*****************************************/

@Test
public void testJsonXml_8_EARFF() throws Exception {
compareInputJsonFileWithOutputXmlFile(
"jsontoxmllegacy_Element_Array_Root",
"json-to-xml/example_8.json",
"json-to-xml/example_8_EARFF.xml"
);
}

@Test
public void testJsonXml_8_EARTF() throws Exception {
compareInputJsonFileWithOutputXmlFile(
"jsontoxmllegacy_Element_Array_Root_NamespaceLenient",
"json-to-xml/example_8.json",
"json-to-xml/example_8_EARTF.xml"
);
}

@Test
public void testJsonXml_8_EARFT() throws Exception {
compareInputJsonFileWithOutputXmlFile(
"jsontoxmllegacy_Element_Array_Root_TypeHints",
"json-to-xml/example_8.json",
"json-to-xml/example_8_EARFT.xml"
);
}

@Test
public void testJsonXml_8_EARTT() throws Exception {
compareInputJsonFileWithOutputXmlFile(
"jsontoxmllegacy_Element_Array_Root_NamespaceLenient_TypeHints",
"json-to-xml/example_8.json",
"json-to-xml/example_8_EARTT.xml"
);
}

@Test
public void testJsonXml_8_EATT() throws Exception {
compareInputJsonFileWithOutputXmlFile(
"jsontoxmllegacy_Element_Array_NamespaceLenient_TypeHints",
"json-to-xml/example_8.json",
"json-to-xml/example_8_EATT.xml"
);
}

private void compareInputJsonFileWithOutputXmlFile(String routeName, String inputJsonFile, String outputXmlFile)
throws IOException, InterruptedException {
String defaultJson = IOUtils.toString(classLoader.getResourceAsStream(inputJsonFile), StandardCharsets.UTF_8);
Expand Down
3 changes: 3 additions & 0 deletions jsontoxmllegacy/src/test/resources/json-to-xml/example_8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"test": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<root><test json_null="true"/></root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<test class="object" null="true"/>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<test json_null="true"/>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<test class="object" null="true"/>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<o>
<test class="object" null="true"/>
</o>
2 changes: 1 addition & 1 deletion mail/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>mail</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ public void marshal(Exchange exchange, Object graph, OutputStream stream)
}
}
}
mm.writeTo(stream, headers.toArray(new String[0]));
//mm.writeTo(stream, headers.toArray(new String[0]));
//Workaround to apply the body also for InOut exchanges
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
mm.writeTo(byteStream, headers.toArray(new String[0]));
exchange.getIn().setBody(byteStream.toString());
} else {
// keep the original data
InputStream is = ExchangeHelper.convertToMandatoryType(exchange, InputStream.class, graph);
Expand Down
2 changes: 1 addition & 1 deletion multipart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>multipart</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion oauth2token/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>oauth2token</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion oriflame/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>oriflame</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pdf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>pdf</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pdftotext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>custom-components</artifactId>
<groupId>org.assimbly</groupId>
<version>5.0.2</version>
<version>5.0.3</version>
</parent>

<artifactId>pdftotext</artifactId>
Expand Down
24 changes: 12 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<packaging>pom</packaging>
<name>custom-components</name>
<url>https://www.org.assimbly</url>
<version>5.0.2</version>
<version>5.0.3</version>

<modules>
<module>aggregate</module>
Expand Down Expand Up @@ -66,17 +66,17 @@
<maven.versions.rules>file:///${project.basedir}/rules.xml</maven.versions.rules>

<axiom.version>1.2.20</axiom.version>
<assimbly.version>5.0.2</assimbly.version>
<bouncycastle.version>1.79</bouncycastle.version>
<assimbly.version>5.0.3</assimbly.version>
<bouncycastle.version>1.80</bouncycastle.version>
<config-admin.version>1.9.26</config-admin.version>
<cxf.version>4.0.5</cxf.version>
<camel.version>4.8.1</camel.version>
<cxf.version>4.1.0</cxf.version>
<camel.version>4.10.0</camel.version>
<docconverter.version>1.12.1</docconverter.version>
<google.api.version>v3-rev20241027-2.0.0</google.api.version>
<google.api.version>v3-rev20250122-2.0.0</google.api.version>
<google.auth.version>1.5.0</google.auth.version>
<google.oauth.version>1.36.0</google.oauth.version>
<google.oauth.version>1.37.0</google.oauth.version>
<hapi.version>2.5.1</hapi.version>
<hibernate-core.version>6.6.3.Final</hibernate-core.version>
<hibernate-core.version>6.6.7.Final</hibernate-core.version>
<httpclient.version>4.5.14</httpclient.version>
<httpcomponents.version>4.5.14</httpcomponents.version>
<java-assist.version>3.29.2-GA</java-assist.version>
Expand All @@ -87,14 +87,14 @@
<jcifs.version>2.1.39</jcifs.version>
<libsodium-jna.version>1.0.5</libsodium-jna.version>
<mvel.version>2.5.2.Final</mvel.version>
<mime4j.version>0.8.11</mime4j.version>
<mime4j.version>0.8.12</mime4j.version>
<mockito.version>3.3.3</mockito.version>
<mockito-core.version>5.14.2</mockito-core.version>
<mockito-core.version>5.15.2</mockito-core.version>
<mockito-inline.version>5.2.0</mockito-inline.version>
<mongo.version>4.7.2</mongo.version>
<osgi.version>6.0.0</osgi.version>
<pdfbox.version>3.0.3</pdfbox.version>
<poi.version>5.3.0</poi.version>
<pdfbox.version>3.0.4</pdfbox.version>
<poi.version>5.4.0</poi.version>
<saaj-impl.version>3.0.4</saaj-impl.version>
<saxon.version>9.7.0-21</saxon.version>
<smooks.version>1.7.1</smooks.version>
Expand Down
Loading