Package com.mongodb

Examples of com.mongodb.MongoInternalException


  }

  @Test
  public void translateMongoInternalException() {

    MongoInternalException exception = new MongoInternalException("Internal exception");
    DataAccessException translatedException = translator.translateExceptionIfPossible(exception);

    expectExceptionWithCauseMessage(translatedException, InvalidDataAccessResourceUsageException.class);
  }
View Full Code Here


    when(documents.findAndRemove(any(DBObject.class))).thenReturn(mongoObject);

    // Add some content since markProcessed assumes content exists.
    document.putContentField("a", "b");

    when(oldDocuments.insert(any(DBObject.class))).thenThrow(new MongoInternalException(
        "I am suck!"));

    boolean processed = documentIO.markProcessed(document, "Test stage");

    assertFalse("Processing should not be fine", processed);
View Full Code Here

      public WriteResult answer(InvocationOnMock invocation) throws Throwable {
        boolean theFieldIsStillTheSame = document.getContentField(contentField)
            .equals(contentValue);

        if (theFieldIsStillTheSame) {
          throw new MongoInternalException("Document is too large!");
        } else {
          return null;
        }
      }
    });
View Full Code Here

            .equals(shortValue);
        boolean longFieldIsStillTheSame = document.getContentField("long")
            .equals(longValue);

        if (shortFieldIsStillTheSame && longFieldIsStillTheSame) {
          throw new MongoInternalException("Document is too large!");
        } else {
          return null;
        }
      }
    });
View Full Code Here

TOP

Related Classes of com.mongodb.MongoInternalException

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.