File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
src/test/java/com/rabbitmq/client/impl Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .rabbitmq .client .impl ;
2+
3+ import org .junit .Test ;
4+
5+ import java .io .DataOutputStream ;
6+ import java .io .IOException ;
7+ import java .io .OutputStream ;
8+ import java .math .BigDecimal ;
9+ import java .util .ArrayDeque ;
10+ import java .util .Queue ;
11+
12+ public class ValueWriterTest {
13+ @ Test (expected = IllegalArgumentException .class ) public void writingOverlyLargeBigDecimalShouldFail () throws IOException {
14+ Queue <Byte > queue = new ArrayDeque <>();
15+
16+ OutputStream outputStream = new OutputStream () {
17+ @ Override
18+ public void write (int b ) {
19+ queue .add ((byte ) b );
20+ }
21+ };
22+
23+ DataOutputStream dataOutputStream = new DataOutputStream (outputStream );
24+
25+ ValueWriter valueWriter = new ValueWriter (dataOutputStream );
26+
27+ valueWriter .writeFieldValue (new BigDecimal (Integer .MAX_VALUE ).add (new BigDecimal (1 )));
28+
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments