Home » Author Archives: Marco Castigliego (page 2)

Author Archives: Marco Castigliego

Even in the jdk there is bad code

java-logo

Java 7, TreeSet and NullPointerException. Recently I tried to compile with java 7 a project developed with java 6. Lot of fun happened during tests execution, tests that in java 6 were  running smoothly, with java 7, they were strangely failing! So, I had to understand why and this is what I discovered… The context first: In that project I have a ...

Read More »

Easy testing SLAs on distributed components with grep4j

java-interview-questions-answers

So your distributed architecture looks something like the picture below and you just have received a requirement from the business to make sure that the SLAs of the messages sent by the Producer and then traveling to the downstream systems (consumers) must be fast and never slower than 400 milliseconds. Requirement says : The Latency of a message sent from ...

Read More »

Pool of ssh connections using Apache KeyedObjectPool

apache-commons-logo

I found the org.apache.commons.pool extremely useful and robust, but not well documented. So, I’ll try to help a bit here explaining how to use an Apache KeyedObjectPool. What is a KeyedObjectPool? It’s a map that contains a pool of instances of multiple types. Each type may be accessed using an arbitrary key. In this example I’ll create a pool of ...

Read More »

JUnit4 Parameterized and Theories Examples

junit-logo

I always relied on TestNG to pass parameters to test methods in order to give a bit of flexibility to my tests or suites. However, the same flexibility can be achieved using JUnit4. To use it it’s simple:               package com.marco.test; import java.util.Arrays; import java.util.Collection; import junit.framework.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import ...

Read More »

Software Development tips and tricks

software-development-2-logo

These are just some tips and tricks I learnt over my career that I’d like to share. This list does not contains silver bullets and it doesn’t pretend to be complete or be an absolute truth. It’s just a list that I hope may be helpful for someone. 1 ) Push the coding to the last This point can be ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close