// Tail packet
new byte[] {4, 5, 6});
}
};
ScreenDescription screen = new ScreenDescription();
final VncInitializer init = new VncInitializer("init", true, screen);
Element initSink = new MockSink("initSink") {
{
// Expect shared flag
bufs = ByteBuffer.convertByteArraysToByteBuffers(new byte[] {RfbConstants.SHARED_ACCESS});
}
};
Element mainSink = new MockSink("mainSink") {
{
// Expect two tail packets
bufs = ByteBuffer.convertByteArraysToByteBuffers(new byte[] {1, 2, 3}, new byte[] {4, 5, 6});
}
};
ByteBuffer[] emptyBuf = ByteBuffer.convertByteArraysToByteBuffers(new byte[] {});
Element encodingsSink = new MockSink("encodings", emptyBuf);
Element pixelFormatSink = new MockSink("pixel_format", emptyBuf);
Pipeline pipeline = new PipelineImpl("test");
pipeline.addAndLink(source, init, mainSink);
pipeline.add(encodingsSink, pixelFormatSink, initSink);
pipeline.link("init >otout", "initSink");
pipeline.link("init >" + CLIENT_SUPPORTED_ENCODINGS_ADAPTER_PAD, "encodings");
pipeline.link("init >" + CLIENT_PIXEL_FORMAT_ADAPTER_PAD, "pixel_format");
pipeline.runMainLoop("source", STDOUT, false, false);
if (!screen.isRGB888_32_LE())
System.err.println("Screen description was read incorrectly: " + screen + ".");
if (!desktopName.equals(screen.getDesktopName()))
System.err.println("Screen desktop name was read incorrectly: \"" + screen.getDesktopName() + "\".");
}