@@ -0,0 +1,1409 @@
+/*%0A * Copyright (C) 2011 Benoit GUEROUT %3Cbguerout at gmail dot com%3E and Yves AMSELLEM %3Camsellem dot yves at gmail dot com%3E%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.jongo.util;%0A%0Aimport com.mongodb.DB;%0Aimport com.mongodb.MongoClient;%0Aimport com.mongodb.WriteConcern;%0A%0Apublic class LocalMongo %7B%0A%0A    public DB getDb(String dbname) %7B%0A        return Holder.instance.getDB(dbname);%0A    %7D%0A%0A    public static class Holder %7B%0A%0A        public static MongoClient instance = getLocalInstance();%0A%0A        private static MongoClient getLocalInstance() %7B%0A            try %7B%0A                MongoClient mongo = new MongoClient();%0A                mongo.setWriteConcern(WriteConcern.FSYNC_SAFE);%0A                return mongo;%0A            %7D catch (Exception e) %7B%0A                throw new RuntimeException(%22Failed to initialize Embedded Mongo instance: %22 + e, e);%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add LocalMongo to run test against an installed db