Examples of Friend


Examples of org.jongo.model.Friend

        /* when */
        WriteResult writeResult = collection.update("{}").upsert().with("{$set:{name:'John'}}");

        /* then */
        Friend john = collection.findOne("{name:'John'}").as(Friend.class);
        assertThat(john.getName()).isEqualTo("John");
        assertThat(writeResult).isNotNull();
    }
View Full Code Here

Examples of org.jongo.model.Friend

        /* when */
        WriteResult writeResult = collection.withWriteConcern(WriteConcern.SAFE).update("{}").upsert().with("{$set:{name:'John'}}");

        /* then */
        Friend john = collection.findOne("{name:'John'}").as(Friend.class);
        assertThat(john.getName()).isEqualTo("John");
        assertThat(writeResult).isNotNull();
        assertThat(writeResult.getLastConcern()).isEqualTo(WriteConcern.SAFE);
    }
View Full Code Here

Examples of org.jongo.model.Friend

        assertThat(writeResult.getLastConcern()).isEqualTo(WriteConcern.SAFE);
    }

    @Test
    public void canPartiallyUdpateWithAPreexistingDocument() throws Exception {
        Friend friend = new Friend("John", "123 Wall Street");
        collection.save(friend);
        Friend preexistingDocument = new Friend(friend.getId(), "Johnny");

        collection.update("{name:'John'}").with(preexistingDocument);

        Friend johnny = collection.findOne("{name:'Johnny'}}").as(Friend.class);
        assertThat(johnny).isNotNull();
        assertThat(johnny.getName()).isEqualTo("Johnny");
        assertThat(johnny.getAddress()).isEqualTo("123 Wall Street");
    }
View Full Code Here

Examples of org.jongo.model.Friend

        assertThat(johnny.getAddress()).isEqualTo("123 Wall Street");
    }

    @Test
    public void canPartiallyUdpateWithaNewDocument() throws Exception {
        Friend friend = new Friend("John", "123 Wall Street");
        collection.save(friend);
        Friend newDocument = new Friend("Johnny");

        collection.update("{name:'John'}").with(newDocument);

        Friend johnny = collection.findOne("{name:'Johnny'}}").as(Friend.class);
        assertThat(johnny).isNotNull();
        assertThat(johnny.getName()).isEqualTo("Johnny");
        assertThat(johnny.getAddress()).isEqualTo("123 Wall Street");
    }
View Full Code Here

Examples of org.jongo.model.Friend

    }

    @Test
    public void canReplaceAllFields() throws Exception {

        Friend friend = new Friend("Peter", "31 rue des Lilas");
        collection.save(friend);

        collection.update(friend.getId()).with("#", new Friend("John"));

        Map map = collection.findOne().as(Map.class);
        assertThat(map.get("name")).isEqualTo("John");
        assertThat(map).doesNotContainKey("address");
    }
View Full Code Here

Examples of userManagement.Friend

  }

  @Test
  public void addChatters() {
    Chat.getSingleton().addChat("Chat1");
    Chat.getSingleton().addChatter("Chat1", new Friend("Tester1", "Testerken1", null));
    Chat.getSingleton().addChatter("Chat1", new Friend("Tester2", "Testerken2", null));

    Assert.assertEquals(Chat.getSingleton().getChatTabbedModel().getTeamIdChatMap().get("Chat1").getModel().getChatters().size(), 3);
  }
View Full Code Here

Examples of userManagement.Friend

    Assert.assertEquals(Chat.getSingleton().getChatTabbedModel().getTeamIdChatMap().get("Chat1").getModel().getChatters().size(), 3);
  }

  @Test
  public void removeChatters() {
    Friend friend1 = new Friend("Tester1", "Testerken1", null);
    Friend friend2 = new Friend("Tester2", "Testerken2", null);

    Chat.getSingleton().addChat("Chat2");
   
    Chat.getSingleton().addChatter("Chat2", friend1);
    Chat.getSingleton().addChatter("Chat2", friend2);
View Full Code Here

Examples of userManagement.Friend

    Assert.assertEquals(Chat.getSingleton().getChatTabbedModel().getTeamIdChatMap().get("Chat2").getModel().getChatters().size(), 2);
  }
 
  @Test
  public void addChattersToDifferentRooms() {
    Friend friend1 = new Friend("Tester1", "Testerken1", null);
    Friend friend2 = new Friend("Tester2", "Testerken2", null);

    Chat.getSingleton().addChat("Chat7");
    Chat.getSingleton().addChat("Chat8");
   
    Chat.getSingleton().addChatter("Chat7", friend1);
View Full Code Here

Examples of userManagement.Friend

    Assert.assertEquals(Chat.getSingleton().getChatTabbedModel().getTeamIdChatMap().get("Chat8").getModel().getChatters().size(), 2);
 
 
  @Test
  public void addAndRemoveChattersToDifferentRooms() {
    Friend friend1 = new Friend("Tester1", "Testerken1", null);
    Friend friend2 = new Friend("Tester2", "Testerken2", null);

    Chat.getSingleton().addChat("Chat9");
    Chat.getSingleton().addChat("Chat10");
   
    Chat.getSingleton().addChatter("Chat9", friend1);
View Full Code Here

Examples of userManagement.Friend

  @Override
  public void mouseClicked(MouseEvent e) {
    if (e.getClickCount() == 2) {
      int index = locationToIndex(e.getPoint());
      Friend friend = (Friend) getModel().getElementAt(index);
      ensureIndexIsVisible(index);

      Chat.getSingleton().addChat(friend.getAlias());
      Chat.getSingleton().addChatter(friend.getAlias(), friend);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.