Skip to content

Commit 9b2945c

Browse files
add validation tests
1 parent 45565f2 commit 9b2945c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/java/uk/co/real_logic/sbe/generation/java/JavaGeneratorTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import uk.co.real_logic.sbe.xml.MessageSchema;
2727
import uk.co.real_logic.sbe.xml.ParserOptions;
2828

29+
import java.io.IOException;
2930
import java.lang.reflect.Method;
3031
import java.nio.ByteOrder;
3132

@@ -218,4 +219,15 @@ public void shouldGenerateBasicMessage() throws Exception
218219
final Integer count = (Integer)groupFlyweight.getClass().getDeclaredMethod("count").invoke(groupFlyweight);
219220
assertThat(count, is(Integer.valueOf(0)));
220221
}
222+
223+
@Test(expected = IllegalArgumentException.class)
224+
public void shouldValidateMissingBufferClass() throws IOException {
225+
new JavaGenerator(ir, "dasdsads", outputManager);
226+
}
227+
228+
@Test(expected = IllegalArgumentException.class)
229+
public void shouldValidateNotImplementedBufferClass() throws IOException {
230+
new JavaGenerator(ir, "java.nio.ByteBuffer", outputManager);
231+
}
232+
221233
}

0 commit comments

Comments
 (0)