[jbosstools-dev] Testing the CA

Victor V. Rubezhny vrubezhny at exadel.com
Wed Dec 12 08:00:08 EST 2007


Hi Max.

Den asked me to answer on Automated Test Case creation possibility for
content assistant.

Amoung the JUnit test cases we have the one that tests OpenOn's region types
recognition. This tests contains the informatin for the specified file
region types and calls the OpenOn "detector" on each character position in
that file to ensure that the region types are properly detected.

So, for the CA we can create something like this. Because of algorithm of CA
invokation is closed deep inside ContentAssistant and
CompletionProposalPopup classes we have to write the same algorithm to get
the CA Processor for the source viewer and text position specified and then
aquire the processor for proposals.

There are some difficulties because of UI staff (there are too many private
and package local/internal classes in CA which need to, but cannot be
accessed from outside (from test case code)) but I think it's possible to
get the proposals for some test file.

The big question is how the test case can ensure that the proposal list
returned is the right proposals? There are too many variations for the
proposal set (depending on the JBoss and 3rd-party plugins installed and
project configuration it is possible to get a different set of proposals).

Best Regards,
Victor Rubezhny




More information about the jbosstools-dev mailing list