Package mungbean.protocol.command

Examples of mungbean.protocol.command.Count


            }
        }

        public void databaseTests() {
            DBCollection<Map<String, Object>> collection = context.openCollection("foo");
            long initialCount = collection.query(new Count(), new Query());
            collection.save(doc);

            List<Map<String, Object>> results = collection.query(idQuery);
            specify(results.size(), does.equal(1));
            specify(results.get(0).get("foo"), does.equal("bar"));
            collection.query(new Distinct<List<Object>>("foo"), new Query()).contains("bar");
            specify(collection.query(new Count(), new Query()), does.equal(initialCount + 1));
            runGroup(collection);
            specify(collection.query(new Count(), idQuery), does.equal(1));
            collection.delete(idQuery);
            specify(collection.query(idQuery).size(), does.equal(0));
            specify(context.dbAdmin().getCollectionNames(), containsExactly("foo"));
            specify(collection.query(new Count(), new Query()), does.equal(initialCount));
        }
View Full Code Here


                    }
                });
            }
            executor.shutdown();
            executor.awaitTermination(5, TimeUnit.MINUTES);
            specify(collection.query(new Count(), new Query()), does.equal(totalNumberOfItems));
            long time = timer.millisecondsSinceStart();
            System.out.println("Insert time for " + totalNumberOfItems + " items was " + time + "ms -> " + (1000 * totalNumberOfItems / time) + " operations per second.");

            timer = new StopWatch();
            final AtomicInteger count = new AtomicInteger(0);
View Full Code Here

TOP

Related Classes of mungbean.protocol.command.Count

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.