Thursday, 18 June 2009
Executing TestNG tests relying on @Parameters from Eclipse
If you wanna run TestNG tests relying on @Parameters like the one below from Eclipse, you need to pass some value for the 'basedir' parameter, otherwise Eclipse will complain:
@Test(groups = "unit", enabled = true, testName = "loaders.bdbje.BdbjeCacheStoreIntegrationTest")
public class BdbjeCacheStoreIntegrationTest extends BaseCacheStoreTest {
private String tmpDirectory;
@BeforeTest
@Parameters({"basedir"})
protected void setUpTempDir(String basedir) {
tmpDirectory = basedir + TestingUtil.TEST_PATH + File.separator + getClass().getSimpleName();
}
...
Having looked around on the web, it’s not clear how to do this and some people even seem to claim that it’s not doable. However, having looked at how Maven deals with this, you simply have to pass the parameter as system property and it will work. So, if you wanna run BdbjeCacheStoreIntegrationTest from Eclipse, simply pass a system property like this:
-Dbasedir=/home/galder/tmp
Otherwise, Eclipse will moan with a message like this:
org.testng.TestNGException:
Parameter 'basedir' is required by @Configuration on method setUpTempDir
Tags: ide testing
Saturday, 13 June 2009
High-five for Alpha5
I’ve just released Infinispan 4.0.0.ALPHA5. Yes, I know you were expecting Beta1 already, but it is taking a little longer than anticipated. Anyway, Alpha5 has got some cool new stuff you’d definitely want to check out.
-
Migration scripts for EHCache
-
Internal performance improvements
-
Newer, faster JBoss Marshalling
As you know, your feedback is important to us, so please do download and try out what will hopefully be the last Alpha before we start releasing Betas.
Cheers Manik
Tags: release alpha
Tuesday, 09 June 2009
Blogger and syntax highlighting of code
If you happen to write a lot of tech articles on Blogger and frequently use code examples, it can be frustrating that Blogger has no built-in support for syntax highlighting. After some frustrating initial experiments with my own styles for code snippets, I found this excellent article:
http://abhisanoujam.blogspot.com/2008/12/blogger-syntax-highlighting.html In no time flat, I have converted all of my previous blog posts and they are now properly highlighted, complete with line numbers. :-) Lovely stuff.
Cheers Manik
Tags: syntax highlighting blogger
Tuesday, 02 June 2009
Pimp your desktop with an Infinispan wallpaper!
Tags: creative wallpaper
Tuesday, 02 June 2009
Another alpha for Infinispan
What’s new? Galder Zamarreño’s recent contribution of ripping out the marshalling framework Infinispan "inherited" from JBoss Cache and replacing it with JBoss Marshalling has made the marshalling code much leaner, more modular and more testable, and comes with a nifty performance boost too. What’s also interesting is that he has overcome issues with object stream caching (see my blog on the subject) by using JBoss Marshalling streams which can be reset. This too provides a very handy performance boost for short lived streams. (See ISPN-42, ISPN-84)
Mircea Markus has put together a bunch of migration scripts to migrate your JBoss Cache 3.x configuration to Infinispan. More migration scripts are on their way. (See ISPN-53, ISPN-54)
Vladimir Blagojevic has contributed the new lock() API - which allows for explicit, eager cluster-wide locks. (See ISPN-48)
Heiko Rupp has contributed the early days of a JOPR plugin, allowing Infinispan instances to be managed by JBoss AS 5.1.0’s embedded console as well as other environments. Read his guide to managing Infinispan with JOPR for more details.
And I’ve implemented some enhancements to the Future API. Now, rather than returning Futures, the xxxAsync() methods return a NotifyingFuture. NotifyingFuture extends Future, adding the ability to register a notifier such that the caller can be notified when the Future completes. Note that Future completion could mean any of successful completion, exception or cancellation, so the listener should check the state of the Future using get() on notification. For example:
NotifyingFuture<Void> f = cache.clearAsync().attachListener(new FutureListener<Void>() {
public void futureDone(Future<Void> f) {
if (f.get() && !f.isCancelled()) {
System.out.println("clear operation succeeded");
}
}
});
The full change log for this release is available on JIRA. Download this release, and provide feedback on the Infinispan user forums.
Onward to Beta1!
Enjoy, Manik
Tags: release