Monday, February 07, 2011

The Reddit Effect

Early this morning an old post of mine got voted up to the main page on Reddit. I may sift through the comments when my day settles down but I just want to show you the impact of the exposure, thanks to my Analytics page:

a 4147% growth. That's not 40x, that's 4000x, as evidenced by this next graph:


Looks like the Reddit comments wound up on my post's page. Do I really have to delete all the chaff?

Sunday, February 06, 2011

@RunAsJUnitTest, @RunAsPluginTest

After many idle months I'm starting to pick up work on the Workspace Mechanic for Eclipse, and that included finally publishing some of the tests that accompanied it.

And then, after starting to work on the tests some more, I realized I was missing something I used while writing plug-ins internally at Google, and so I copied them into the internal tests package. They're mostly documentation, but useful documentation. Here's the slightly reduced code for both of them. Their purpose should be clear:
/**
 * Declares that this test can be run as a JUnit test, and does not require
 * the trappings of running as an Eclipse plug-in test.
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface RunAsJUnitTest {
}
 
/**
* Declares that this test must be run as a plug-in test.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface RunAsPluginTest {
}
Nobody likes running tests in the plug-in container if he or she doesn't have to. Surely, I'd much rather run nice fast JUnit tests, particularly when I've separated out code specifically for fast unit tests.

Of course, without infrastructure to support these, they're little more than documentation, but documentation that has type completion in the IDE.

So, what do you think? Would it be reasonable to have Eclipse support annotations like these? Do you think these have merit, or are utterly worthless?