Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ committed Mar 21, 2024
1 parent 9a6352f commit 584e139
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void testReadEvent() throws IOException, ClassNotFoundException {
}

@Test
void testReadByte() throws IOException {
void testReadByte() throws IOException, ClassNotFoundException {
FrameworkModel frameworkModel = new FrameworkModel();
Serialization serialization =
frameworkModel.getExtensionLoader(Serialization.class).getExtension("hessian2");
Expand All @@ -219,6 +219,19 @@ void testReadByte() throws IOException {
objectOutput.writeObject((byte) 11);
objectOutput.flushBuffer();

byte[] bytes = outputStream.toByteArray();
ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
ObjectInput objectInput = serialization.deserialize(url, inputStream);
Assertions.assertEquals((byte) 11, objectInput.readObject());
}

// write byte, read byte
{
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ObjectOutput objectOutput = serialization.serialize(url, outputStream);
objectOutput.writeByte((byte) 11);
objectOutput.flushBuffer();

byte[] bytes = outputStream.toByteArray();
ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
ObjectInput objectInput = serialization.deserialize(url, inputStream);
Expand Down

0 comments on commit 584e139

Please sign in to comment.