Package com.mongodb

Examples of com.mongodb.Mongo.dropDatabase()


        Logger.getRootLogger().setLevel(Level.OFF);
        testObjects = new TrialObjects();

        try {
            final Mongo m = new Mongo();
            m.dropDatabase("testdb");
            testDb = m.getDB("testdb");
        } catch (final Exception e) {
            assumeThat(true, is(false)); // ignore if no MongoDB instance to connect to
            return;
        }
View Full Code Here


    public void setup() throws Exception {
        Logger.getRootLogger().setLevel(Level.OFF);

        final Mongo m = new Mongo();
        try {
            m.dropDatabase("mydb");
        } catch (final Exception e) {
            assumeThat(true, is(false));// ie ignore test because we've had an exception
            return;
        }
View Full Code Here

        }

        /*
         * Mongo m = new Mongo( "localhost" ); Mongo m = new Mongo( "localhost" , 27017 );
         */
        m.dropDatabase("mydb");

        System.out.println("\n...");
        for (final String s : m.getDatabaseNames()) {
            System.out.println(s);
        }
View Full Code Here

   * @throws Exception if the test could not connect to the database
   */
  @BeforeClass
  public static void setUpClass() throws Exception {
    Mongo mongo = new Mongo();
    mongo.dropDatabase("mvcctest");
  }
 
  /**
   * Setup test database
   * @throws Exception if the test could not connect to the database
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.