[rfc][icedtea-web] PluginAppletViewer unit tests with test extensions for mocking plugin input&output pipes
adomurad at redhat.com
Mon Mar 11 14:21:16 PDT 2013
This is an attempt to enable unit testing of hard-to-test parts of
It introduces a new class 'PluginPipeMock' that allows the requests
coming from the plugin to be read one-by-one, and the ability to send
This is possible thanks to that fact that PluginStreamHandler takes
arbitrary and InputStream&OutputStream.
Attached are unit tests for PluginAppletViewer.eval,
PluginAppletViewer.call, PluginAppletViewer.toString and
responsibilities from the Java-side of things are tested.
It may be worth looking into using iostream's on the C++ side and
mocking them similarly (for the unfamiliar, they are also classes that
can be inherited from, so a similar approach can be taken).
Even better would be to provide the C++ side with some NPAPI-enabled
stuff with unit tests.
2013-XX-XX Adam Domurad <adomurad at redhat.com>
(stamps/test-extensions-compile.stamp): Make plugin classes available
to test extensions
New, helper for doing asynchronous calls with a given timeout. Returns
an exit code.
* tests/test-extensions/sun/applet/PluginPipeMessages.java: New, helper
for verifying plugin messages and getting the reference number.
* tests/netx/unit/sun/applet/PluginAppletViewerTest.java: New, uses
* tests/test-extensions/sun/applet/mock/PluginPipeMock.java: New,
for getting the plugin requests and mocking the replies.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 16442 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130311/28557979/test-liveconnect-messages.patch
More information about the distro-pkg-dev