Examples of Friend


Examples of org.asteriskjava.iax.protocol.Friend

     *
     * @param f Friend
     * @param s boolean
     */
    public void registered(Friend f, boolean s) {
        final Friend ff = f;
        final boolean fs = s;
        Runnable r = new Runnable() {
            public void run() {
                if (_gui != null) {
                    _gui.registered(ff, fs);
View Full Code Here

Examples of org.asteriskjava.iax.protocol.Friend

     * @param f         Friend
     * @param b         boolean
     * @param roundtrip int
     */
    public void setHostReachable(Friend f, boolean b, int roundtrip) {
        final Friend ff = f;
        final boolean fb = b;
        final int fr = roundtrip;
        Runnable r = new Runnable() {
            public void run() {
                if (_gui != null) {
View Full Code Here

Examples of org.jongo.model.Friend

    @Test
    public void shouldNotAddBsonConfWithCustomMapper() throws Exception {
        Mapping.Builder builder = new Mapping.Builder(new ObjectMapper());
        Mapping mapping = builder.build();
        ObjectId id = ObjectId.get();//serialized using bson serializer
        Friend friend = new Friend(id, "John");

        Writer writer = new StringWriter();
        mapping.getWriter(friend).writeValue(writer, friend);

        assertThat(writer.toString()).contains("John");
View Full Code Here

Examples of org.jongo.model.Friend

    @Test
    public void canFindAndMap() throws Exception {
        /* given */
        ResultHandler<DBObject> handler = new RawResultHandler<DBObject>();
        collection.save(new Friend("John", "22 Wall Street Avenue"));
        collection.save(new Friend("Peter", "22 Wall Street Avenue"));

        /* when */
        for (DBObject result : collection.find().map(handler)) {
            /* then */
            assertThat(result.get("name")).isIn("John", "Peter");
View Full Code Here

Examples of org.jongo.model.Friend

    @Test
    public void canFindOneAndMap() throws Exception {
        /* given */
        ResultHandler<DBObject> handler = new RawResultHandler<DBObject>();
        Friend john = new Friend("John", "22 Wall Street Avenue");
        collection.save(john);

        /* when */
        DBObject result = collection.findOne().map(handler);

View Full Code Here

Examples of org.jongo.model.Friend

        Jongo jongo = new Jongo(getDatabase());

        Mapper mapper = jongo.getMapper();

        assertThat(mapper).isNotNull();
        assertThat(mapper.getMarshaller().marshall(new Friend("test"))).isNotNull();
    }
View Full Code Here

Examples of org.jongo.model.Friend

    }

    @Test
    public void canFindAndModifyOne() throws Exception {
        /* given */
        collection.save(new Friend("John", "22 Wall Street Avenue"));

        /* when */
        Friend originalFriend = collection.findAndModify("{name:#}", "John").with("{$set: {address: #}}", "A better place").as(Friend.class);

        /* then */
        assertThat(originalFriend.getAddress()).isEqualTo("22 Wall Street Avenue");

        Friend updatedFriend = collection.findOne().as(Friend.class);
        assertThat(updatedFriend.getAddress()).isEqualTo("A better place");
        assertThat(updatedFriend.getName()).isEqualTo("John");
    }
View Full Code Here

Examples of org.jongo.model.Friend

    }

    @Test
    public void canFindAndModifyWithResultHandler() throws Exception {
        /* given */
        collection.save(new Friend("John", "22 Wall Street Avenue"));

        /* when */
        DBObject dbo = collection.findAndModify("{name:#}", "John").with("{$set: {address: #}}", "A better place").map(new RawResultHandler<DBObject>());

        /* then */
 
View Full Code Here

Examples of org.jongo.model.Friend

    }

    @Test
    public void canReturnNew() throws Exception {
        /* given */
        collection.save(new Friend("John", "22 Wall Street Avenue"));

        /* when */
        Friend updatedFriend = collection.findAndModify().with("{$set: {address: 'A better place'}}").returnNew().as(Friend.class);

        /* then */
        assertThat(updatedFriend.getAddress()).isEqualTo("A better place");
    }
View Full Code Here

Examples of org.jongo.model.Friend

    }

    @Test
    public void canRemove() {
        /* given */
        collection.save(new Friend("John", "22 Wall Street Avenue"));

        /* when */
        Friend deletedFriend = collection.findAndModify().remove().as(Friend.class);

        /* then */
        assertThat(deletedFriend.getName()).isEqualTo("John");
        assertThat(collection.count()).isEqualTo(0);
    }
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.