Package jdave

Examples of jdave.Block


        public void hexStringCanBeParsed() {
            specify(Utils.hexStringToBytes("010203040506"), does.containExactly(new byte[] { 1, 2, 3, 4, 5, 6 }));
        }

        public void exceptionIsThrownIfInputContainsInvalidCharacters() {
            specify(new Block() {

                @Override
                public void run() throws Throwable {
                    specify(Utils.hexStringToBytes("hv312123123123"), does.equal(new byte[] {}));
                }
View Full Code Here


            }, does.raise(RuntimeException.class, "Input contains invalid characters: hv312123123123"));
        }

        public void exceptionIsTrhownIfInputHasOddNumberOfCharacters() {
            specify(new Block() {

                @Override
                public void run() throws Throwable {
                    specify(Utils.hexStringToBytes("123123123123123"), does.equal(new byte[] {}));
                }
View Full Code Here

        public void violationOfUniqueIndexThrowsAnException() {
            final DBCollection<Map<String, Object>> collection = context.openCollection("foo");
            collection.collectionAdmin().ensureIndex(new IndexOptionsBuilder().unique().field("foo"));
            collection.save(newDoc(new ObjectId(), "bar"));
            specify(new Block() {
                @Override
                public void run() throws Throwable {
                    collection.save(doc);
                }
            }, does.raise(MongoException.class));
View Full Code Here

            specify(collection.query(new Query().field("name").is("foo")).get(0).value(), does.equal(123));

            specify(itemFromDb.id(), does.equal(item.id()));
            collection.delete(item.id());
            specify(new Block() {
                @Override
                public void run() throws Throwable {
                    collection.find(item.id());
                }
            }, does.raise(NotFoundException.class));
View Full Code Here

TOP

Related Classes of jdave.Block

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.