Friday, March 22, 2013

Laptop Sony Vaio PCG-432L (aka PCG-SR33) specs

Now I have one. It has following specifications.
CPU: Intel Mobile Celeron processor 600 MHz
Memory (RAM): 64 MB, 1 of 2 slots occupied, max allowed should be 256 MB.
HDD: it does not have it, but it should be 10 GB.
Screen: don't know, should be 10.4" TFT with 800 x 600 px reso.
It has Microsoft Windows Millennium Edition licence sticker.


Thursday, March 14, 2013

java.lang.IllegalStateException: 0 matchers expected, 2 recorded.

There could be whatever java.lang.IllegalStateException: m matchers expected, n recorded.
If you are programmer like monkey with keyboard (like me currently, sadly) and you are getting this, there are few things you can check first:
1) it could be that this exception does not come from the place it says it comes, that is, real failing part was previous test and this happens in next test where it first saw call to expect(..) method;
2) in some cases expect(..)/ verify() does  not like to work with (MyObject) EasyMock.anyObject() - make sure you don't use EasyMock.anyObject() if you are getting this exception.

Tuesday, March 12, 2013

java.lang.IllegalStateException: missing behavior definition for the preceding method call

If you see this while writing unit test with EasyMock, make sure you didn't forget to call replay().

For example:

MyFirstObject myFirstObject = createMock(MyFirstObject.class);
MyObject my = new MyObject();
expect(myFistObject.myMethod()).andReturn(123).anyTimes();
assertEquals(456, my.myOtherMethod()); 


may cause this exception, but:

MyFirstObject myFirstObject = createMock(MyFirstObject.class);
MyObject my = new MyObject();
expect(myFirstObject.myMethod()).andReturn(123).anyTimes();
replay(myFistObject);
assertEquals(456, my.myOtherMethod());


does not throw this exception.

Saturday, March 9, 2013

Getting started

On a sunny Saturday eve (and eve was obviosly not sunny anymore), I decided to make a blog.
Currently I can't say more because there are limited amount of words I can say in a day.