views:

28

answers:

1

I am writing a lot of unit tests these days. And I want to minimize the amount of typing I have to do.

So I have created several Eclipse coding templates.

Most of them work fine. But, recently I want to do a bit more advanced stuff.

I use EasyMock and when writing expectations , I find myself writing stuff over and over again. I want a code template that is context-aware of the objects, and once selected, i want it to present me with the methods of this object.

So far, I have this template, and it works fine (it shows me all objects that are in my test):

EasyMock.expect(${a:var}.${cursor});

It will write me the EasyMock.expect part, and then present me with a list of objects I can select. Once selected, I get a dot and the cursor at the right, so all I need to do is press CTRL-SPACE in order to see the methods of this object.

What I want is to be presented with this list of methods.

Is this possible? And if yes, how? I can't find any solution. Perhaps there is no such template variable yet?

A: 
EasyMock.expect(${a:var}${cursor});

And then type a dot after selecting it (instead of pressing ctrl-space), which will automatically trigger content-assist

Professor_Calculus