Package org.bson

Examples of org.bson.BSONObject.keySet()


       
        assertEquals(barray.length, b.length);
        for( int i=0; i<256; i++ ) {
            assertEquals( b[i], barray[i] );
        }
        assertEquals( o.keySet().size() , read.keySet().size() );
    }

    private void go( DBObject o , int serialized_len ) {
        go( o, serialized_len, 0 );
    }
View Full Code Here


    private void go( DBObject o , int serialized_len, int transient_fields ) {
        byte[] encoded = BSON.encode( o );
        assertEquals( serialized_len , encoded.length );

        BSONObject read = BSON.decode( encoded );
        assertEquals( o.keySet().size() - transient_fields, read.keySet().size() );
        if ( transient_fields == 0 )
            assertEquals( o , read );
    }

    @Test
View Full Code Here

        o.put( "p", p );

        BSONObject read = BSON.decode( BSON.encode( o ) );
        Pattern p2 = (Pattern)read.get( "p" );
        assertEquals( p2.pattern(), p.pattern() );
        assertEquals( o.keySet().size(), read.keySet().size() );

    }

    @Test
    public void testLong() {
View Full Code Here

            }
            return;
        }
        if (x instanceof BSONObject) {
            final BSONObject m = (BSONObject) x;
            for (final String k : m.keySet()) {
                iter.eval((T) k, (V) m.get(k));
            }
        }

    }
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.