package client;

import java.io.IOException;

import chat.ChatRoom;
import chat.Chatter;
import chat.TextChatter;

import junit.framework.TestCase;

public class TestClient extends TestCase {

	public static void main (String [] args) {
		ClientGestTopics s = new ClientGestTopics();
		Chatter bob = new TextChatter ("bob");
		Chatter joe = new TextChatter ("joe");
		
		try {
			s.setServer("localhost",1664);
			s.connect();
			System.out.println("Connection établie au GestTopics");
			s.creerTopic("java");
			ChatRoom cr = s.rejoindreTopic("java");
			cr.rejoindre(bob);
			//cr.rejoindre(joe);
			cr.poster("coucou",joe);
			System.in.read();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
