You can check the Google Guava presentation I did for work.
Wednesday, February 12, 2014
Friday, December 27, 2013
spring integration tutorial
I was checking if we could migrate some of our project's code to Spring Integration and I found a very good tutorial with a not-so-basic example.
Check this two part tutorial:
Spring Integration part 1
Spring Integration part 2
Check this two part tutorial:
Spring Integration part 1
Spring Integration part 2
Wednesday, November 20, 2013
sonarqube presentation
I did a SonarQube presentation at work. Feel free to check and use it as you like here.
at
16:24
Labels:
architecture,
bug,
checkstyle,
coding rules,
complexity,
design,
documentation,
duplication,
findbugs,
pmd,
sonarqube,
unit test
Wednesday, July 17, 2013
java.lang.illegalstateexception: missing behavior definition for the preceding method call
I have the following exception while mocking a final method with PowerMock.
My previous code was:
java.lang.illegalStateException: missing behavior definition for the preceding method call
My previous code was:
ReloadableResourceBundleMessageSource mockMessage =
createMock(ReloadableResourceBundleMessageSource.class);
expect(mockMessage.getMessage("text",
null, Locale.ENGLISH)).andReturn("error_message");
replay(mockMessage);
Then I realized that createMock() and replay() belongs to EasyMock not PowerMock.
I explicitly did these calls:
ReloadableResourceBundleMessageSource mockMessage =
PowerMock.createMock(ReloadableResourceBundleMessageSource .class);
expect(mockMessage.getMessage("text",
null, Locale.ENGLISH)).andReturn("error_message");
PowerMock.replay(mockMessage);
But that's not enough. For PowerMock to work, you'll also need to add few annotations before the class definition.
@RunWith(PowerMockRunner.class) @PrepareForTest(ReloadableResourceBundleMessageSource.class)
Notice that @PrepareForTest can also be defined just before the test method.
After these fixes my test begins to work.
Sunday, July 14, 2013
non-parseable settings in maven
I saw a very odd error while building our project with maven.
[ERROR] Error executing Maven. [ERROR] 1 problem was encountered while building the effective settings [FATAL] Non-parseable settings C:\Program Files (x86)\Apache\apache-maven-3.0.5\conf\settings.xml: entity reference names can not start with character '<' (position: START_TAG seen ...Nothing in the project changed so it shouldn't spit me an error. Then I saw the error line and remembered that I changed my corporate password and put it in the settings.xml because our corporate proxy need it for working. So if you see a similar error, keep in mind that this is because and invalid character in the xml file. My password contained an ampersand and thus I had this issue.myPassword<... @12:33) @ C:\Program Files (x86)\Apache\apache-maven-3.0.5\conf\settings.xml, line 12, column 33
Subscribe to:
Posts (Atom)