@Test
public void testLogging() throws Exception {

	final StringHandler logHandler = new StringHandler();
	RoboconfReturnListener listener = new RoboconfReturnListener();
	Logger logger = TestUtils.getInternalField( listener, "logger", Logger.class );
	Assert.assertNotNull( logger );
	logger.setUseParentHandlers( false );
	logger.addHandler( logHandler );
	Message msg = new MsgCmdGatherLogs();
	byte[] bytes = SerializationUtils.serializeObject( msg );
	// We have NOT the right logging level
	logger.setLevel( Level.SEVERE );
	listener.handleReturn( 0, "reply", "exchange", "routingKey", null, bytes );
	Assert.assertEquals( 0, logHandler.getLogs().length());
	// We have the right logging level
	logger.setLevel( Level.INFO );
	listener.handleReturn( 0, "reply", "exchange", "routingKey", null, bytes );
	Assert.assertNotSame( 0, logHandler.getLogs().length());
}