package Communication.Mocks;
import java.util.Timer;
import java.util.TimerTask;
import Communication.ChatProvider;
import Communication.GeneralConnection;
import Communication.Status;
import Control.Contact;
import Control.Interfaces.EventHandler;
/**
* A mock object emulating an MSN instance.
*
* @author Sebastian
*
*/
public class MSNSimulation extends GeneralConnection{
Timer timer;
public MSNSimulation(String uin, String password, EventHandler eventHandler, ChatProvider chatProvider) {
super(uin, password, ChatProvider.MSN, eventHandler);
}
public void connect() {
timer = new Timer();
timer.schedule(new TimerTask(){
public void run() {
eventHandler.addNewContact(new Contact("312234112", ChatProvider.MSN, Status.NotAvailable, "Simon", ""));
eventHandler.addNewContact(new Contact("342366432",
ChatProvider.MSN, Status.Offline, "Clarisa", ""));
eventHandler.addNewContact(new Contact("257453235", ChatProvider.MSN, Status.Offline, "Manuel", ""));
eventHandler.addNewContact(new Contact("975322434",
ChatProvider.MSN, Status.Offline, "Julia", ""));
eventHandler.addNewContact(new Contact("238893455", ChatProvider.MSN, Status.Offline, "Kerstin", ""));
eventHandler.addNewContact(new Contact("355788443",
ChatProvider.MSN, Status.Offline, "Matthias", ""));
eventHandler.addNewContact(new Contact("578433678", ChatProvider.MSN, Status.Offline, "Nadine", ""));
eventHandler.addNewContact(new Contact("457355788",
ChatProvider.MSN, Status.Offline, "Philipp", ""));
eventHandler.addNewContact(new Contact("334533673", ChatProvider.MSN, Status.Offline, "Peter", ""));
eventHandler.addNewContact(new Contact("445378335",
ChatProvider.MSN, Status.Offline, "Rebecca", ""));
eventHandler.addNewContact(new Contact("356535453", ChatProvider.MSN, Status.Offline, "Xena", ""));
eventHandler.addNewContact(new Contact("885435345",
ChatProvider.MSN, Status.Offline, "1Linda", ""));
eventHandler.connectionToProviderEstablished(ChatProvider.MSN);
}}, 3500);
}
public void quit() {
}
public void stopLogin() {
timer.cancel();
}
}