Package fr.cesi.chat.domain

Examples of fr.cesi.chat.domain.Statut


  @Test
  public void testSaveMessage() {
    this.dropCollection();

    // on utilise notre fonction
    Statut statut = Statut.EN_LIGNE;
    Message message1 = new Message();
    message1.setMessage("comment vas-tu?");
    message1.setUserFrom(new User("benoit", statut, "192.168.1.1"));
    message1.setUserTo("florian");
    Gson gson = new Gson();
View Full Code Here


    this.dropCollection();
//    insertion de 10 messages
    MessagesHistoryMongo conect = new MessagesHistoryMongo();
 
   
    Statut statut = Statut.EN_LIGNE;
    Message message1 = new Message();
    message1.setMessage("comment vas-tu?");
    message1.setUserFrom(new User("benoit", statut, "192.168.1.1"));
    message1.setUserTo("florian");
   
   
    Gson gson = new Gson();
    String json1 = gson.toJson(message1);
    conect.saveMessage(json1);
   
    Statut statut2 = Statut.ABSENT;
    Message message2 = new Message();
    message2.setMessage("bien et toi");
    message2.setUserFrom(new User("florian", statut2, "192.168.1.2"));
    message2.setUserTo("Benoit");
   
View Full Code Here

    messagesCollection.drop();
  }

  public void insert10Messages() {
    MessagesHistoryMongo conect = new MessagesHistoryMongo();
    Statut statut = Statut.EN_LIGNE;
    Message message1 = new Message();
    message1.setMessage("comment vas-tu?");
    message1.setUserFrom(new User("benoit", statut, "192.168.1.1"));
    message1.setUserTo("florian");
    message1.setEvent(Event.ALL_CLIENTS);
    message1.setDate(new Date(1394743482).toString());

    conect.saveMessage(message1);

    Statut statut2 = Statut.ABSENT;
    Message message2 = new Message();
    message2.setMessage("bien et toi");
    message2.setUserFrom(new User("florian", statut2, "192.168.1.2"));
    message2.setUserTo("Benoit");
    message2.setEvent(Event.ONE_CLIENT);
View Full Code Here

    // on test qu'il n'y ait aucun message dans la base
    Assert.assertNull(EmptyMessage);

    // on utilise notre fonction
    Statut statut = Statut.EN_LIGNE;
    Message message1 = new Message();
    message1.setMessage("comment vas-tu?");
    message1.setUserFrom(new User("benoit", statut, "192.168.1.1"));
    message1.setUserTo("florian");
    message1.setEvent(Event.ALL_CLIENTS);
View Full Code Here

    clientService.sendMessage(output, message2);

    // On set le nouveau nickname dans la variable global user
    String ip = user.getIp();
    String nickanme = user.getNickname();
    Statut statut = user.getStatut();
    user = new User();
    user.setIp(ip);
    user.setNickname(newNickname);
    user.setStatut(statut);
    return user;
View Full Code Here

TOP

Related Classes of fr.cesi.chat.domain.Statut

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.