File tree Expand file tree Collapse file tree 2 files changed +71
-0
lines changed 
java/uk/co/real_logic/sbe/generation/csharp Expand file tree Collapse file tree 2 files changed +71
-0
lines changed Original file line number Diff line number Diff line change 1+ package  uk .co .real_logic .sbe .generation .csharp ;
2+ 
3+ import  static  uk .co .real_logic .sbe .xml .XmlSchemaParser .parse ;
4+ 
5+ import  org .agrona .generation .StringWriterOutputManager ;
6+ import  org .junit .Test ;
7+ 
8+ import  uk .co .real_logic .sbe .TestUtil ;
9+ import  uk .co .real_logic .sbe .ir .Ir ;
10+ import  uk .co .real_logic .sbe .xml .IrGenerator ;
11+ import  uk .co .real_logic .sbe .xml .MessageSchema ;
12+ import  uk .co .real_logic .sbe .xml .ParserOptions ;
13+ 
14+ public  class  Issue567GroupSizeTest 
15+ {
16+ 
17+  @ Test (expected  = Exception .class )
18+  public  void  shouldThrowWhenUsingATypeThatIsNotConstrainedToFitInAnIntAsTheGroupSize () throws  Exception 
19+  {
20+  // Arrange 
21+  final  ParserOptions  options  = ParserOptions .builder ().stopOnError (true ).build ();
22+  final  MessageSchema  schema  = parse (TestUtil .getLocalResource ("issue567-invalid.xml" ), options );
23+  final  IrGenerator  irg  = new  IrGenerator ();
24+  final  Ir  ir  = irg .generate (schema );
25+ 
26+  final  StringWriterOutputManager  outputManager  = new  StringWriterOutputManager ();
27+  outputManager .setPackageName (ir .applicableNamespace ());
28+  final  CSharpGenerator  generator  = new  CSharpGenerator (ir , outputManager );
29+ 
30+  // Act + Assert 
31+  generator .generate ();
32+  }
33+ 
34+ }
Original file line number Diff line number Diff line change 1+ <?xml  version =" 1.0"  encoding =" UTF-8"  standalone =" yes" 
2+ <sbe : messageSchema  xmlns : sbe =" http://fixprotocol.io/2016/sbe" 
3+  package =" issue567" 
4+  id =" 567" 
5+  version =" 0" 
6+  semanticVersion =" 5.2" 
7+  description =" issue 567 example where group size doesn't fit in an int32" 
8+  byteOrder =" littleEndian" 
9+  <types >
10+  <composite  name =" messageHeader" description =" Message identifiers and length of message root" 
11+  <type  name =" blockLength" primitiveType =" uint16" 
12+  <type  name =" templateId" primitiveType =" uint16" 
13+  <type  name =" schemaId" primitiveType =" uint16" 
14+  <type  name =" version" primitiveType =" uint16" 
15+  </composite >
16+  <composite  name =" groupSizeEncoding" description =" Repeating group dimensions" 
17+  <type  name =" blockLength" primitiveType =" uint16" 
18+  <type  name =" numInGroup" primitiveType =" uint32" 
19+  </composite >
20+  <composite  name =" varStringEncoding" 
21+  <type  name =" length" primitiveType =" uint32" maxValue =" 1073741824" 
22+  <type  name =" varData" primitiveType =" uint8" length =" 0" characterEncoding =" UTF-8" 
23+  </composite >
24+  <composite  name =" varDataEncoding" 
25+  <type  name =" length" primitiveType =" uint32" maxValue =" 1073741824" 
26+  <type  name =" varData" primitiveType =" uint8" length =" 0" 
27+  </composite >
28+  </types >
29+  <types >
30+  <composite  name =" issue567Element" description =" element for group exposing issue 567" 
31+  <type  name =" id" primitiveType =" int32" 
32+  </composite >
33+  </types >
34+  <sbe : message  name =" issue567" id =" 1" description =" issue 560 test" 
35+  <field  name =" groupField" id =" 1" type =" issue567Element" 
36+  </sbe : message >
37+ </sbe : messageSchema >
                         You can’t perform that action at this time. 
           
                  
0 commit comments