Index: trunk/objectmq/src/omq/common/broker/Broker.java
===================================================================
--- trunk/objectmq/src/omq/common/broker/Broker.java	(revision 36)
+++ trunk/objectmq/src/omq/common/broker/Broker.java	(revision 37)
@@ -2,4 +2,6 @@
 
 import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.Properties;
 
@@ -30,7 +32,18 @@
 	private static Channel channel;
 	private static boolean clientStarted = false;
-
-	public static void initBroker(Properties env) throws Exception {
+	private static boolean connectionClosed = false;
+	// TODO ask Pedro if it can be only one object in the map (an object can
+	// have multiple threads in the same broker -see environment-)
+	private static Map<String, RemoteObject> remoteObjs;
+
+	/**
+	 * Initializes a new Broker with the environment called by reference
+	 * 
+	 * @param env
+	 * @throws Exception
+	 */
+	public static synchronized void initBroker(Properties env) throws Exception {
 		if (Environment.isVoid()) {
+			remoteObjs = new HashMap<String, RemoteObject>();
 			Environment.setEnvironment(env);
 			connection = OmqConnectionFactory.getNewConnection(env);
@@ -44,16 +57,51 @@
 				throw new InitBrokerException("The connection didn't work");
 			}
-		}
-	}
-
-	// TODO: what happens if the connection is not set
+		} else {
+			throw new InitBrokerException("Broker already started");
+		}
+	}
+
+	public static void stopBroker() throws Exception {
+		// Stop the client
+		if (clientStarted) {
+			ResponseListener.stopResponseListner();
+			EventDispatcher.stopEventDispatcher();
+		}
+		// Stop all the remote objects working
+		for (String reference : remoteObjs.keySet()) {
+			unbind(reference);
+		}
+		// Close the connection once all the listeners are died
+		closeConnection();
+	}
+
+	/**
+	 * @return Broker's connection
+	 * @throws Exception
+	 */
 	public static Connection getConnection() throws Exception {
 		return connection;
 	}
 
+	public static void closeConnection() throws IOException {
+		connectionClosed = true;
+		connection.close();
+	}
+
+	/**
+	 * 
+	 * @return Broker's channel
+	 * @throws Exception
+	 */
 	public static Channel getChannel() throws Exception {
 		return channel;
 	}
 
+	/**
+	 * Creates a new channel using the Broker's connection
+	 * 
+	 * @return newChannel
+	 * @throws IOException
+	 */
 	public static Channel getNewChannel() throws IOException {
 		return connection.createChannel();
@@ -85,4 +133,5 @@
 			Properties environment = Environment.getEnvironment();
 			remote.startRemoteObject(reference, environment);
+			remoteObjs.put(reference, remote);
 		} catch (Exception e) {
 			throw new RemoteException(e);
@@ -90,5 +139,11 @@
 	}
 
-	public static void unbind(String reference) throws RemoteException {
+	public static void unbind(String reference) throws RemoteException, IOException {
+		if (remoteObjs.containsKey(reference)) {
+			RemoteObject remote = remoteObjs.get(reference);
+			remote.kill();
+		} else {
+			throw new RemoteException("The object referenced by 'reference' does not exist in the Broker");
+		}
 
 	}
@@ -98,4 +153,11 @@
 	}
 
+	/**
+	 * This method ensures the client will have only one ResponseListener and
+	 * only one EventDispatcher. Both with the same environment.
+	 * 
+	 * @param environment
+	 * @throws Exception
+	 */
 	private static synchronized void initClient(Properties environment) throws Exception {
 		if (ResponseListener.isVoid()) {
@@ -107,4 +169,11 @@
 	}
 
+	/**
+	 * This method sends an event with its information
+	 * 
+	 * @param event
+	 * @throws IOException
+	 * @throws SerializerException
+	 */
 	public static void trigger(Event event) throws IOException, SerializerException {
 		String UID = event.getTopic();
@@ -119,5 +188,13 @@
 	}
 
+	/**
+	 * This function is used to send a ping message to see if the connection
+	 * works
+	 * 
+	 * @param env
+	 * @throws Exception
+	 */
 	public static void tryConnection(Properties env) throws Exception {
+		System.out.println("hola");
 		Channel channel = connection.createChannel();
 		String message = "ping";
@@ -148,35 +225,40 @@
 	}
 
+	/**
+	 * This method adds a ShutdownListener to the Broker's connection. When this
+	 * connection falls, a new connection will be created and this will also
+	 * have the listener.
+	 */
 	private static void addFaultTolerance() {
 		connection.addShutdownListener(new ShutdownListener() {
 			@Override
 			public void shutdownCompleted(ShutdownSignalException cause) {
-
-				if (cause.isHardError()) {
-					if (connection.isOpen()) {
+				if (!connectionClosed)
+					if (cause.isHardError()) {
+						if (connection.isOpen()) {
+							try {
+								connection.close();
+							} catch (IOException e) {
+								e.printStackTrace();
+							}
+						}
 						try {
-							connection.close();
-						} catch (IOException e) {
+							Properties env = Environment.getEnvironment();
+							connection = OmqConnectionFactory.getNewWorkingConnection(env);
+							channel = connection.createChannel();
+							addFaultTolerance();
+						} catch (Exception e) {
 							e.printStackTrace();
 						}
-					}
-					try {
-						Properties env = Environment.getEnvironment();
-						connection = OmqConnectionFactory.getNewWorkingConnection(env);
-						channel = connection.createChannel();
-						addFaultTolerance();
-					} catch (Exception e) {
-						e.printStackTrace();
-					}
-				} else {
-					Channel channel = (Channel) cause.getReference();
-					if (channel.isOpen()) {
-						try {
-							channel.close();
-						} catch (IOException e) {
-							e.printStackTrace();
+					} else {
+						Channel channel = (Channel) cause.getReference();
+						if (channel.isOpen()) {
+							try {
+								channel.close();
+							} catch (IOException e) {
+								e.printStackTrace();
+							}
 						}
 					}
-				}
 			}
 		});
Index: trunk/objectmq/src/omq/server/InvocationThread.java
===================================================================
--- trunk/objectmq/src/omq/server/InvocationThread.java	(revision 36)
+++ trunk/objectmq/src/omq/server/InvocationThread.java	(revision 37)
@@ -69,5 +69,5 @@
 			}
 
-		}
+		}System.out.println("Invocation Thread dies!!");
 	}
 
Index: trunk/objectmq/src/omq/server/RemoteObject.java
===================================================================
--- trunk/objectmq/src/omq/server/RemoteObject.java	(revision 36)
+++ trunk/objectmq/src/omq/server/RemoteObject.java	(revision 37)
@@ -129,6 +129,6 @@
 
 	public void kill() throws IOException {
+		killed = true;
 		interrupt();
-		killed = true;
 		channel.close();
 		remoteWrapper.stopRemoteWrapper();
Index: trunk/objectmq/test/faultToleranceTest/ClientTest.java
===================================================================
--- trunk/objectmq/test/faultToleranceTest/ClientTest.java	(revision 37)
+++ trunk/objectmq/test/faultToleranceTest/ClientTest.java	(revision 37)
@@ -0,0 +1,67 @@
+package faultToleranceTest;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Properties;
+
+import omq.common.broker.Broker;
+import omq.common.util.ParameterQueue;
+import omq.common.util.Serializer;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import calculatorTest.Calculator;
+
+public class ClientTest {
+	private static Calculator remoteCalc;
+
+	@BeforeClass
+	public static void startClient() throws Exception {
+		Properties env = new Properties();
+		env.setProperty(ParameterQueue.USER_NAME, "guest");
+		env.setProperty(ParameterQueue.USER_PASS, "guest");
+
+		// Set host info of rabbimq (where it is)
+		env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
+		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
+		env.setProperty(ParameterQueue.DURABLE_QUEUES, "false");
+		env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);
+		env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
+
+		// Set info about where the message will be sent
+		env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
+		// env.setProperty(ParameterQueue.DEBUGFILE, "c:\\middlewareDebug");
+
+		// Set info about the queue & the exchange where the ResponseListener
+		// will listen to.
+		env.setProperty(ParameterQueue.RPC_REPLY_QUEUE, "reply_queue");
+		env.setProperty(ParameterQueue.EVENT_REPLY_QUEUE, "event_queue");
+		env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "5000");
+
+		Broker.initBroker(env);
+		remoteCalc = (Calculator) Broker.lookup("calculator1", Calculator.class);
+	}
+
+	@Test
+	public void toleranceTest() throws Exception {
+		int x = 10;
+		int y = 20;
+		int sum = 10 + 20;
+
+		int sync = remoteCalc.add(x, y);
+
+		String password = "unpc";
+		String[] command = { "/bin/bash", "-c", "echo " + password + " | sudo -S service rabbitmq-server restart" };
+
+		Runtime runtime = Runtime.getRuntime();
+		runtime.exec(command);
+
+		Thread.sleep(15000);
+		int resp = remoteCalc.add(x, y);
+
+		assertEquals(sum, sync);
+		assertEquals(sum, resp);
+	}
+
+}
Index: trunk/objectmq/test/faultToleranceTest/ServerTest.java
===================================================================
--- trunk/objectmq/test/faultToleranceTest/ServerTest.java	(revision 37)
+++ trunk/objectmq/test/faultToleranceTest/ServerTest.java	(revision 37)
@@ -0,0 +1,36 @@
+package faultToleranceTest;
+
+import java.util.Properties;
+
+import omq.common.broker.Broker;
+import omq.common.util.ParameterQueue;
+import omq.common.util.Serializer;
+import calculatorTest.CalculatorImpl;
+
+public class ServerTest {
+	private static CalculatorImpl calc;
+
+	public static void main(String[] args) throws Exception {
+		Properties env = new Properties();
+		env.setProperty(ParameterQueue.USER_NAME, "guest");
+		env.setProperty(ParameterQueue.USER_PASS, "guest");
+
+		// Get host info of rabbimq (where it is)
+		env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
+		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
+		env.setProperty(ParameterQueue.DURABLE_QUEUES, "false");
+		env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);
+		env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
+
+		// Set info about where the message will be sent
+		env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
+		env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000");
+
+		calc = new CalculatorImpl();
+
+		Broker.initBroker(env);
+		Broker.bind("calculator1", calc);
+
+		System.out.println("Server started");
+	}
+}
Index: trunk/objectmq/test/multiThreadTest/Car.java
===================================================================
--- trunk/objectmq/test/multiThreadTest/Car.java	(revision 37)
+++ trunk/objectmq/test/multiThreadTest/Car.java	(revision 37)
@@ -0,0 +1,37 @@
+package multiThreadTest;
+
+import java.util.List;
+
+import omq.Remote;
+import omq.client.annotation.AsyncMethod;
+import omq.client.annotation.RemoteInterface;
+import omq.client.annotation.SyncMethod;
+import omq.exception.RemoteException;
+
+@RemoteInterface
+public interface Car extends Remote {
+	@AsyncMethod
+	public void setPlate(String plate);
+
+	@SyncMethod(timeout = 1500)
+	public String getPlate();
+
+	@AsyncMethod
+	public void setHP(int hp);
+
+	@SyncMethod(timeout = 1500)
+	public int getHP();
+
+	@AsyncMethod
+	public void setRims(List<Rim> rims);
+
+	@SyncMethod(timeout = 3000)
+	public List<Rim> getRims();
+
+	@AsyncMethod
+	public void setMobile(String mobile) throws RemoteException;
+
+	@SyncMethod
+	public String getMobile();
+
+}
Index: trunk/objectmq/test/multiThreadTest/CarImpl.java
===================================================================
--- trunk/objectmq/test/multiThreadTest/CarImpl.java	(revision 37)
+++ trunk/objectmq/test/multiThreadTest/CarImpl.java	(revision 37)
@@ -0,0 +1,60 @@
+package multiThreadTest;
+
+import java.util.List;
+
+import omq.common.broker.Broker;
+import omq.exception.RemoteException;
+import omq.server.RemoteObject;
+
+public class CarImpl extends RemoteObject implements Car {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private String plate;
+	private int hp;
+	private List<Rim> rims;
+	private Mobile mobile;
+
+	@Override
+	public void setPlate(String plate) {
+		this.plate = plate;
+	}
+
+	@Override
+	public String getPlate() {
+		return plate;
+	}
+
+	@Override
+	public void setHP(int hp) {
+		this.hp = hp;
+	}
+
+	@Override
+	public int getHP() {
+		return hp;
+	}
+
+	@Override
+	public void setRims(List<Rim> rims) {
+		this.rims = rims;
+	}
+
+	@Override
+	public List<Rim> getRims() {
+		return rims;
+	}
+
+	@Override
+	public void setMobile(String mobile) throws RemoteException {
+		this.mobile = (Mobile) Broker.lookup(mobile, Mobile.class);
+	}
+
+	@Override
+	public String getMobile() {
+		return mobile.getRef();
+	}
+
+}
Index: trunk/objectmq/test/multiThreadTest/CarThread.java
===================================================================
--- trunk/objectmq/test/multiThreadTest/CarThread.java	(revision 37)
+++ trunk/objectmq/test/multiThreadTest/CarThread.java	(revision 37)
@@ -0,0 +1,51 @@
+package multiThreadTest;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import omq.common.broker.Broker;
+
+public class CarThread extends Thread {
+	private String name;
+	private String tfn;
+	private Object lock;
+
+	public CarThread(String name, String tfn, Object lock) {
+		this.name = name;
+		this.tfn = tfn;
+		this.lock = lock;
+	}
+
+	@Override
+	public void run() {
+		try {
+			Car car = (Car) Broker.lookup(name, Car.class);
+			car.setHP(1001);
+			car.setPlate("California 125");
+			List<Rim> rims = new ArrayList<Rim>();
+			rims.add(new Rim("asdf", 17));
+			rims.add(new Rim("qwer", 21));
+			car.setRims(rims);
+
+			Thread.sleep(1000);
+			
+			System.out.println("HP -> " + car.getHP());
+			System.out.println("Plate -> " + car.getPlate());
+			for (Rim r : car.getRims()) {
+				System.out.println("Rim -> " + r.getModel() + ", " + r.getInch());
+			}
+
+			Mobile mobile = (Mobile) Broker.lookup(tfn, Mobile.class);
+			synchronized (lock) {
+				lock.wait(2000);
+				List<String> messages = mobile.getMessages();
+				for (String m : messages) {
+					System.out.println("Message -> " + m);
+				}
+			}
+
+		} catch (Exception e) {
+
+		}
+	}
+}
Index: trunk/objectmq/test/multiThreadTest/ClientTest.java
===================================================================
--- trunk/objectmq/test/multiThreadTest/ClientTest.java	(revision 37)
+++ trunk/objectmq/test/multiThreadTest/ClientTest.java	(revision 37)
@@ -0,0 +1,41 @@
+package multiThreadTest;
+
+import java.util.Properties;
+
+import omq.common.broker.Broker;
+import omq.common.util.ParameterQueue;
+
+public class ClientTest {
+
+	public static void main(String[] args) throws Exception {
+		Properties env = new Properties();
+		env.setProperty(ParameterQueue.USER_NAME, "guest");
+		env.setProperty(ParameterQueue.USER_PASS, "guest");
+
+		// Set host info of rabbimq (where it is)
+		env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
+		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
+		// env.setProperty(ParameterQueue.SERIALIZERNAME,
+		// "omq.common.util.Serializers.GsonImp");
+		env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
+
+		// Set info about where the message will be sent
+		env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
+		// Set info about the queue & the exchange where the ResponseListener
+		// will listen to.
+		env.setProperty(ParameterQueue.RPC_REPLY_QUEUE, "reply_queue");
+		env.setProperty(ParameterQueue.EVENT_REPLY_QUEUE, "event_queue");
+
+		Broker.initBroker(env);
+
+		String car = "audi";
+		String tfn = "aifon";
+		Object lock = new Object();
+		CarThread t1 = new CarThread(car, tfn, lock);
+		MobileThread t2 = new MobileThread(tfn, lock);
+
+		t1.start();
+		t2.start();
+		
+	}
+}
Index: trunk/objectmq/test/multiThreadTest/Mobile.java
===================================================================
--- trunk/objectmq/test/multiThreadTest/Mobile.java	(revision 37)
+++ trunk/objectmq/test/multiThreadTest/Mobile.java	(revision 37)
@@ -0,0 +1,19 @@
+package multiThreadTest;
+
+import java.util.List;
+
+import omq.Remote;
+import omq.client.annotation.AsyncMethod;
+import omq.client.annotation.RemoteInterface;
+import omq.client.annotation.SyncMethod;
+
+@RemoteInterface
+public interface Mobile extends Remote {
+	@AsyncMethod
+	public void sendMessage(String message);
+	
+	@SyncMethod
+	public List<String> getMessages();
+	
+	
+}
Index: trunk/objectmq/test/multiThreadTest/MobileImpl.java
===================================================================
--- trunk/objectmq/test/multiThreadTest/MobileImpl.java	(revision 37)
+++ trunk/objectmq/test/multiThreadTest/MobileImpl.java	(revision 37)
@@ -0,0 +1,26 @@
+package multiThreadTest;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import omq.server.RemoteObject;
+
+public class MobileImpl extends RemoteObject implements Mobile {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private List<String> messages = new ArrayList<String>();
+
+	@Override
+	public synchronized void sendMessage(String message) {
+		System.out.println("Message received " + this.getRef() + " -> " + message);
+		messages.add(message);
+	}
+
+	@Override
+	public List<String> getMessages() {
+		return messages;
+	}
+
+}
Index: trunk/objectmq/test/multiThreadTest/MobileThread.java
===================================================================
--- trunk/objectmq/test/multiThreadTest/MobileThread.java	(revision 37)
+++ trunk/objectmq/test/multiThreadTest/MobileThread.java	(revision 37)
@@ -0,0 +1,28 @@
+package multiThreadTest;
+
+import omq.common.broker.Broker;
+
+public class MobileThread extends Thread {
+	private String name;
+	private Object lock;
+
+	public MobileThread(String name, Object lock) {
+		this.name = name;
+		this.lock = lock;
+	}
+
+	@Override
+	public void run() {
+		try {
+			Mobile mobile = (Mobile) Broker.lookup(name, Mobile.class);
+			synchronized (lock) {
+				mobile.sendMessage("Hello this is Sergi");
+				mobile.sendMessage("and this is a test");
+				Thread.sleep(1000);
+				lock.notify();
+			}
+		} catch (Exception e) {
+
+		}
+	}
+}
Index: trunk/objectmq/test/multiThreadTest/Rim.java
===================================================================
--- trunk/objectmq/test/multiThreadTest/Rim.java	(revision 37)
+++ trunk/objectmq/test/multiThreadTest/Rim.java	(revision 37)
@@ -0,0 +1,39 @@
+package multiThreadTest;
+
+import java.io.Serializable;
+
+public class Rim implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	private String model;
+	private int inch;
+
+	public Rim() {
+	}
+
+	public Rim(String model, int inch) {
+		this.model = model;
+		this.inch = inch;
+	}
+
+	public String getModel() {
+		return model;
+	}
+
+	public void setModel(String model) {
+		this.model = model;
+	}
+
+	public int getInch() {
+		return inch;
+	}
+
+	public void setInch(int inch) {
+		this.inch = inch;
+	}
+
+}
Index: trunk/objectmq/test/multiThreadTest/ServerTest.java
===================================================================
--- trunk/objectmq/test/multiThreadTest/ServerTest.java	(revision 37)
+++ trunk/objectmq/test/multiThreadTest/ServerTest.java	(revision 37)
@@ -0,0 +1,36 @@
+package multiThreadTest;
+
+import java.util.Properties;
+
+import omq.common.broker.Broker;
+import omq.common.util.ParameterQueue;
+
+public class ServerTest {
+
+	public static void main(String[] args) throws Exception {
+		Properties env = new Properties();
+		env.setProperty(ParameterQueue.USER_NAME, "guest");
+		env.setProperty(ParameterQueue.USER_PASS, "guest");
+
+		// Get host info of rabbimq (where it is)
+		env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
+		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
+		// env.setProperty(ParameterQueue.SERIALIZERNAME,
+		// "omq.common.util.Serializers.GsonImp");
+		env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
+		env.setProperty(ParameterQueue.NUM_THREADS, "4");
+
+		// Set info about where the message will be sent
+		env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
+		env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000");
+
+		String car = "audi";
+		String tfn = "aifon";
+
+		Broker.initBroker(env);
+		Broker.bind(car, new CarImpl());
+		Broker.bind(tfn, new MobileImpl());
+
+		System.out.println("Server started");
+	}
+}
Index: trunk/objectmq/test/stopBroker/BrokerKiller.java
===================================================================
--- trunk/objectmq/test/stopBroker/BrokerKiller.java	(revision 37)
+++ trunk/objectmq/test/stopBroker/BrokerKiller.java	(revision 37)
@@ -0,0 +1,11 @@
+package stopBroker;
+
+import omq.Remote;
+import omq.client.annotation.AsyncMethod;
+import omq.client.annotation.RemoteInterface;
+
+@RemoteInterface
+public interface BrokerKiller extends Remote {
+	@AsyncMethod
+	public void killServerBroker() throws Exception;
+}
Index: trunk/objectmq/test/stopBroker/BrokerKillerImpl.java
===================================================================
--- trunk/objectmq/test/stopBroker/BrokerKillerImpl.java	(revision 37)
+++ trunk/objectmq/test/stopBroker/BrokerKillerImpl.java	(revision 37)
@@ -0,0 +1,35 @@
+package stopBroker;
+
+import omq.client.annotation.AsyncMethod;
+import omq.common.broker.Broker;
+import omq.server.RemoteObject;
+
+public class BrokerKillerImpl extends RemoteObject implements BrokerKiller {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	@Override
+	@AsyncMethod
+	public void killServerBroker() throws Exception {
+		System.out.println("Kill broker");
+
+		// A remote method cannot stop the Broker because the stop method is
+		// thought to wait for the methods finish before it stops. For this
+		// reason it actually cannot stop itself
+		new Thread() {
+			public void run() {
+				try {
+					Thread.sleep(1000);
+					Broker.stopBroker();
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+			};
+		}.start();
+
+	}
+
+}
Index: trunk/objectmq/test/stopBroker/ClientTest.java
===================================================================
--- trunk/objectmq/test/stopBroker/ClientTest.java	(revision 37)
+++ trunk/objectmq/test/stopBroker/ClientTest.java	(revision 37)
@@ -0,0 +1,44 @@
+package stopBroker;
+
+import java.util.Properties;
+
+import omq.common.broker.Broker;
+import omq.common.util.ParameterQueue;
+import omq.common.util.Serializer;
+
+public class ClientTest {
+
+	/**
+	 * @param args
+	 * @throws Exception
+	 */
+	public static void main(String[] args) throws Exception {
+		Properties env = new Properties();
+		env.setProperty(ParameterQueue.USER_NAME, "guest");
+		env.setProperty(ParameterQueue.USER_PASS, "guest");
+
+		// Set host info of rabbimq (where it is)
+		env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
+		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
+		env.setProperty(ParameterQueue.DURABLE_QUEUES, "false");
+		env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);
+		env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
+
+		// Set info about where the message will be sent
+		env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
+		// env.setProperty(ParameterQueue.DEBUGFILE, "c:\\middlewareDebug");
+
+		// Set info about the queue & the exchange where the ResponseListener
+		// will listen to.
+		env.setProperty(ParameterQueue.RPC_REPLY_QUEUE, "reply_queue");
+		env.setProperty(ParameterQueue.EVENT_REPLY_QUEUE, "event_queue");
+		env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "5000");
+
+		Broker.initBroker(env);
+		BrokerKiller bk = (BrokerKiller) Broker.lookup("bk", BrokerKiller.class);
+
+		bk.killServerBroker();
+		Broker.stopBroker();
+	}
+
+}
Index: trunk/objectmq/test/stopBroker/ServerTest.java
===================================================================
--- trunk/objectmq/test/stopBroker/ServerTest.java	(revision 37)
+++ trunk/objectmq/test/stopBroker/ServerTest.java	(revision 37)
@@ -0,0 +1,36 @@
+package stopBroker;
+
+import java.util.Properties;
+
+import omq.common.broker.Broker;
+import omq.common.util.ParameterQueue;
+import omq.common.util.Serializer;
+
+public class ServerTest {
+
+	/**
+	 * @param args
+	 */
+	public static void main(String[] args) throws Exception {
+		Properties env = new Properties();
+		env.setProperty(ParameterQueue.USER_NAME, "guest");
+		env.setProperty(ParameterQueue.USER_PASS, "guest");
+
+		// Get host info of rabbimq (where it is)
+		env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
+		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
+		env.setProperty(ParameterQueue.DURABLE_QUEUES, "false");
+		env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);
+		env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
+
+		// Set info about where the message will be sent
+		env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
+		env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000");
+
+		BrokerKillerImpl bki = new BrokerKillerImpl();
+
+		Broker.initBroker(env);
+		Broker.bind("bk", bki);
+	}
+
+}
Index: trunk/objectmq/test/stopBroker/UnbindTest.java
===================================================================
--- trunk/objectmq/test/stopBroker/UnbindTest.java	(revision 37)
+++ trunk/objectmq/test/stopBroker/UnbindTest.java	(revision 37)
@@ -0,0 +1,43 @@
+package stopBroker;
+
+import java.util.Properties;
+
+import omq.common.broker.Broker;
+import omq.common.util.ParameterQueue;
+import omq.common.util.Serializer;
+import calculatorTest.CalculatorImpl;
+
+public class UnbindTest {
+	private static CalculatorImpl calc;
+
+	/**
+	 * @param args
+	 */
+	public static void main(String[] args) throws Exception {
+		Properties env = new Properties();
+		env.setProperty(ParameterQueue.USER_NAME, "guest");
+		env.setProperty(ParameterQueue.USER_PASS, "guest");
+
+		// Get host info of rabbimq (where it is)
+		env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
+		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
+		env.setProperty(ParameterQueue.DURABLE_QUEUES, "false");
+		env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);
+		env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
+
+		// Set info about where the message will be sent
+		env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
+		env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000");
+
+		String reference = "calculator1";
+		calc = new CalculatorImpl();
+
+		Broker.initBroker(env);
+		Broker.bind(reference, calc);
+
+		Broker.unbind(reference);
+
+		Broker.closeConnection();
+	}
+
+}
Index: trunk/objectmq/test/test/Client.java
===================================================================
--- trunk/objectmq/test/test/Client.java	(revision 36)
+++ trunk/objectmq/test/test/Client.java	(revision 37)
@@ -25,4 +25,4 @@
 
 	@AsyncMethod
-	public void sendContact(String contact) throws RemoteException;
+	public void addContact(String contact) throws RemoteException;
 }
Index: trunk/objectmq/test/test/ClientImpl.java
===================================================================
--- trunk/objectmq/test/test/ClientImpl.java	(revision 36)
+++ trunk/objectmq/test/test/ClientImpl.java	(revision 37)
@@ -53,5 +53,5 @@
 	@Override
 	@AsyncMethod
-	public void sendContact(String contact) throws RemoteException {
+	public void addContact(String contact) throws RemoteException {
 		if (!id.equalsIgnoreCase(contact) && !friendList.containsKey(contact)) {
 			Client client = (Client) Broker.lookup(contact, Client.class);
Index: trunk/objectmq/test/test/ClientTest.java
===================================================================
--- trunk/objectmq/test/test/ClientTest.java	(revision 37)
+++ trunk/objectmq/test/test/ClientTest.java	(revision 37)
@@ -0,0 +1,40 @@
+package test;
+
+import java.util.Properties;
+
+import omq.common.broker.Broker;
+import omq.common.util.ParameterQueue;
+import omq.common.util.Serializer;
+
+import org.junit.BeforeClass;
+
+public class ClientTest {
+	// private static Client user;
+
+	@BeforeClass
+	public static void startClient() throws Exception {
+		Properties env = new Properties();
+		env.setProperty(ParameterQueue.USER_NAME, "guest");
+		env.setProperty(ParameterQueue.USER_PASS, "guest");
+
+		// Set host info of rabbimq (where it is)
+		env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
+		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
+		env.setProperty(ParameterQueue.DURABLE_QUEUES, "false");
+		env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);
+		env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
+
+		// Set info about where the message will be sent
+		env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
+		// env.setProperty(ParameterQueue.DEBUGFILE, "c:\\middlewareDebug");
+
+		// Set info about the queue & the exchange where the ResponseListener
+		// will listen to.
+		env.setProperty(ParameterQueue.RPC_REPLY_QUEUE, "reply_queue");
+		env.setProperty(ParameterQueue.EVENT_REPLY_QUEUE, "event_queue");
+		env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "5000");
+
+		Broker.initBroker(env);
+	}
+
+}
Index: trunk/objectmq/test/test/ServerTest.java
===================================================================
--- trunk/objectmq/test/test/ServerTest.java	(revision 37)
+++ trunk/objectmq/test/test/ServerTest.java	(revision 37)
@@ -0,0 +1,36 @@
+package test;
+
+import java.util.Properties;
+
+import omq.common.broker.Broker;
+import omq.common.util.ParameterQueue;
+import omq.common.util.Serializer;
+
+public class ServerTest {
+
+	public static void main(String[] args) throws Exception {
+		Properties env = new Properties();
+		env.setProperty(ParameterQueue.USER_NAME, "guest");
+		env.setProperty(ParameterQueue.USER_PASS, "guest");
+
+		// Get host info of rabbimq (where it is)
+		env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
+		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
+		env.setProperty(ParameterQueue.DURABLE_QUEUES, "false");
+		env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);
+		env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
+
+		// Set info about where the message will be sent
+		env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
+		env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000");
+
+		ClientImpl c1 = new ClientImpl("Miki", "Hey, this is Miky");
+		ClientImpl c2 = new ClientImpl("Jack", "This is Jack");
+
+		Broker.initBroker(env);
+
+		Broker.bind(c1.getID(), c1);
+		Broker.bind(c2.getID(), c2);
+	}
+
+}
