Package com.mongodb

Examples of com.mongodb.Mongo.dropDatabase()


    @Before
    public void setupMongo() throws Exception {

        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 {
        org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.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

        org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.Level.OFF);

        try {

            final Mongo m = new Mongo();
            m.dropDatabase("mydb");
            testDb = m.getDB("mydb");
        } catch (final Exception e) {
            assumeThat(true, is(false)); // ie no exceptions
            return;
        }
View Full Code Here

     */
    public final void dropDB(final String name) throws StandardCodedException {
        try {
            final Mongo mongo = this.getMongo();
            if (null != mongo) {
                mongo.dropDatabase(name);
            }
        } catch (UnknownHostException t) {
            throw this.getError503(t.getMessage());
        } catch (Throwable t) {
            throw this.getError500(t.getMessage());
View Full Code Here

    @BeforeClass
    public static void setUpBeforeClass() throws Exception
    {
        Mongo mongo = new Mongo(TEST_MONGO_SERVER_HOSTNAME,
                TEST_MONGO_SERVER_PORT);
        mongo.dropDatabase(TEST_DATABASE_NAME);
    }

    @AfterClass
    public static void tearDownAfterClass() throws Exception
    {
View Full Code Here

    @AfterClass
    public static void tearDownAfterClass() throws Exception
    {
        Mongo mongo = new Mongo(TEST_MONGO_SERVER_HOSTNAME,
                TEST_MONGO_SERVER_PORT);
        mongo.dropDatabase(TEST_DATABASE_NAME);
    }

    @Before
    public void setUp() throws Exception
    {
View Full Code Here

   
    @BeforeClass
    public static void setUpBeforeClass() throws Exception
    {
      Mongo mongo = new Mongo(TEST_MONGO_SERVER_HOSTNAME, TEST_MONGO_SERVER_PORT);
      mongo.dropDatabase(TEST_DATABASE_NAME);
    }
   
   
    @AfterClass
    public static void tearDownAfterClass() throws Exception
View Full Code Here

   
    @AfterClass
    public static void tearDownAfterClass() throws Exception
    {
      Mongo mongo = new Mongo(TEST_MONGO_SERVER_HOSTNAME, TEST_MONGO_SERVER_PORT);
      mongo.dropDatabase(TEST_DATABASE_NAME);
    }

   
    @Before
    public void setUp()
View Full Code Here

    @BeforeClass
    public static void setUpBeforeClass() throws Exception
    {
        Mongo mongo = new Mongo(TEST_MONGO_SERVER_HOSTNAME,
                TEST_MONGO_SERVER_PORT);
        mongo.dropDatabase(TEST_DATABASE_NAME);
    }

    @AfterClass
    public static void tearDownAfterClass() throws Exception
    {
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.