Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c0172d3

Browse files
committed
added initial repeating group with vardata test and test schema.
1 parent 66cc7f2 commit c0172d3

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright 2015 Real Logic Ltd.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package uk.co.real_logic.sbe.xml;
17+
18+
import org.junit.Test;
19+
import uk.co.real_logic.sbe.TestUtil;
20+
21+
import static uk.co.real_logic.sbe.xml.XmlSchemaParser.parse;
22+
23+
public class GroupWithDataTest
24+
{
25+
@Test
26+
public void shouldParseSchemaSuccessfully()
27+
throws Exception
28+
{
29+
parse(TestUtil.getLocalResource("group-with-data-schema.xml"), ParserOptions.DEFAULT);
30+
}
31+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<messageSchema package="repeating-groups-with-data"
3+
id="1"
4+
semanticVersion="5.2"
5+
description="Unit Test"
6+
byteOrder="littleEndian">
7+
<types>
8+
<type name="Symbol" description="Symbol" length="20" primitiveType="char" semanticType="char"/>
9+
<composite name="messageHeader" description="Message identifiers and length of message root">
10+
<type name="blockLength" primitiveType="uint16"/>
11+
<type name="templateId" primitiveType="uint16"/>
12+
<type name="schemaId" primitiveType="uint16"/>
13+
<type name="version" primitiveType="uint16"/>
14+
</composite>
15+
<composite name="groupSizeEncoding" description="Repeating group dimensions">
16+
<type name="blockLength" primitiveType="uint16"/>
17+
<type name="numInGroup" primitiveType="uint8" semanticType="NumInGroup"/>
18+
</composite>
19+
<composite name="varDataEncoding" semanticType="Length">
20+
<type name="length" primitiveType="uint8" semanticType="Length"/>
21+
<type name="varData" primitiveType="char" semanticType="data"/>
22+
</composite>
23+
</types>
24+
<message name="TestMessage1" id="1" description="TestMessage" blockLength="16">
25+
<field name="Tag1" id="1" type="uint32" semanticType="int"/>
26+
<group name="Entries" id="2" dimensionType="groupSizeEncoding">
27+
<field name="TagGroup1" id="3" type="Symbol"/>
28+
<field name="TagGroup2" id="4" type="int64" semanticType="int"/>
29+
<data type="varDataEncoding" name="varDataField" id="1404"/>
30+
</group>
31+
</message>
32+
<message name="TestMessage2" id="2" description="TestMessage2" blockLength="16">
33+
<field name="Tag1" id="1" type="uint32" semanticType="int"/>
34+
<group name="Entries" id="2" dimensionType="groupSizeEncoding">
35+
<field name="TagGroup1" id="3" type="Symbol"/>
36+
<group name="NestedEntries" id="4" dimensionType="groupSizeEncoding">
37+
<field name="TagGroup2" id="5" type="int64" semanticType="int"/>
38+
<data type="varDataEncoding" name="varDataFieldNested" id="6"/>
39+
</group>
40+
<data type="varDataEncoding" name="varDataField" id="7"/>
41+
</group>
42+
</message>
43+
</messageSchema>

0 commit comments

Comments
 (0)