-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better parsing of comments in XML documents (https://issues.redhat.co…
- Loading branch information
Showing
3 changed files
with
137 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
<!-- | ||
XML file to test comments (https://issues.redhat.com/browse/JGRP-2692) | ||
author: Bela Ban | ||
<!-- This is a nested comment --> | ||
--> | ||
<config xmlns="urn:org:jgroups" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups.xsd" | ||
> | ||
<SHARED_LOOPBACK | ||
<!--mcast_port="${jgroups.udp.mcast_port:45588}"--> | ||
<!--thread_pool.min_threads="0" | ||
thread_pool.max_threads="200"--> <!-- weird XML shit but JGroups is happy to eat it:-) --> | ||
thread_pool.keep_alive_time="30000"/> | ||
<RED/> | ||
<LOCAL_PING /> | ||
<MERGE3 max_interval="30000" | ||
min_interval="10000"/> | ||
<!-- | ||
<FD_SOCK2/> | ||
<FD_ALL3/> | ||
--> | ||
<VERIFY_SUSPECT2 timeout="1500" /> | ||
<BARRIER /> | ||
<pbcast.NAKACK2 xmit_interval="500"/> | ||
<UNICAST3 xmit_interval="500" /> | ||
<pbcast.STABLE desired_avg_gossip="50000" | ||
max_bytes="4M"/> | ||
<pbcast.GMS print_local_addr="true" join_timeout="5"/> | ||
|
||
<UFC max_credits="10M" | ||
<!-- comments inside of XML elements are accepted by the JGroups XML parser --> | ||
min_threshold="0.4"/> | ||
<MFC max_credits="10M" | ||
min_threshold="0.4"/> | ||
<FRAG2 frag_size="60K" /> | ||
<!--FRAG2 frag_size="60K" /> | ||
<pbcast.STATE_TRANSFER /--> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
tests/junit-functional/org/jgroups/tests/XmlParseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.jgroups.tests; | ||
|
||
import org.jgroups.Global; | ||
import org.jgroups.JChannel; | ||
import org.testng.annotations.Test; | ||
|
||
/** | ||
* Tests XML file ./conf/comment-test.xml. This file contains invalid XML, but the JGroups parser is more lenient and | ||
* accepts almost all XML, e.g. nested comments, comments within attributes etc. | ||
* @author Bela Ban | ||
* @since 5.2.15 | ||
*/ | ||
@Test(groups= Global.FUNCTIONAL) | ||
public class XmlParseTest { | ||
public void testXML() throws Exception { | ||
try(JChannel ch=new JChannel("comment-test.xml").name("X")) { | ||
ch.connect(getClass().getSimpleName()); | ||
assert ch.isConnected(); | ||
} | ||
} | ||
} |