test_class.declarator: connectionFactory = new MongoConnectionFactory()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public MongoConnectionFactory connectionFactory = new MongoConnectionFactory();
test_class.type: MongoConnectionFactory
test_class.var_name: connectionFactory
test_class.file: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoUtilsTest.java
test_class.identifier: MongoUtilsTest
test_case.body: @Test
      public void documentStoreExceptionType() {
          assertEquals(GENERIC, getDocumentStoreExceptionTypeFor(new IOException()));
          assertEquals(GENERIC, getDocumentStoreExceptionTypeFor(new MongoException("message")));
          assertEquals(GENERIC, getDocumentStoreExceptionTypeFor(newMongoCommandException(42)));
          assertEquals(GENERIC, getDocumentStoreExceptionTypeFor(new DuplicateKeyException(response(11000), new ServerAddress(), null)));
          assertEquals(TRANSIENT, getDocumentStoreExceptionTypeFor(newWriteConcernException(11600)));
          assertEquals(TRANSIENT, getDocumentStoreExceptionTypeFor(newWriteConcernException(11601)));
          assertEquals(TRANSIENT, getDocumentStoreExceptionTypeFor(newWriteConcernException(11602)));
          assertEquals(TRANSIENT, getDocumentStoreExceptionTypeFor(newMongoCommandException(11600)));
          assertEquals(TRANSIENT, getDocumentStoreExceptionTypeFor(newMongoCommandException(11601)));
          assertEquals(TRANSIENT, getDocumentStoreExceptionTypeFor(newMongoCommandException(11602)));
          assertEquals(TRANSIENT, getDocumentStoreExceptionTypeFor(new MongoSocketException("message", new ServerAddress())));
      }
test_case.class_method_signature: MongoUtilsTest.documentStoreExceptionType()
test_case.full_signature: @Test public void documentStoreExceptionType()
test_case.identifier: documentStoreExceptionType
test_case.invocations: assertEquals getDocumentStoreExceptionTypeFor assertEquals getDocumentStoreExceptionTypeFor assertEquals getDocumentStoreExceptionTypeFor newMongoCommandException assertEquals getDocumentStoreExceptionTypeFor response assertEquals getDocumentStoreExceptionTypeFor newWriteConcernException assertEquals getDocumentStoreExceptionTypeFor newWriteConcernException assertEquals getDocumentStoreExceptionTypeFor newWriteConcernException assertEquals getDocumentStoreExceptionTypeFor newMongoCommandException assertEquals getDocumentStoreExceptionTypeFor newMongoCommandException assertEquals getDocumentStoreExceptionTypeFor newMongoCommandException assertEquals getDocumentStoreExceptionTypeFor
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void documentStoreExceptionType()
focal_class.file: oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoUtils.java
focal_class.identifier: MongoUtils
focal_class.class_method_signature: MongoUtils.createIndex(MongoCollection<?> collection,
                              String field,
                              boolean ascending,
                              boolean unique,
                              boolean sparse)
focal_class.full_signature: static void createIndex(MongoCollection<?> collection,
                              String field,
                              boolean ascending,
                              boolean unique,
                              boolean sparse)
focal_class.identifier: createIndex
focal_class.modifiers: static
focal_class.parameters: (MongoCollection<?> collection,
                              String field,
                              boolean ascending,
                              boolean unique,
                              boolean sparse)
focal_class.return: void
focal_class.signature: void createIndex(MongoCollection<?> collection,
                              String field,
                              boolean ascending,
                              boolean unique,
                              boolean sparse)
focal_class.class_method_signature: MongoUtils.createIndex(MongoCollection<?> collection,
                              String[] fields,
                              boolean[] ascending,
                              boolean unique,
                              boolean sparse)
focal_class.full_signature: static void createIndex(MongoCollection<?> collection,
                              String[] fields,
                              boolean[] ascending,
                              boolean unique,
                              boolean sparse)
focal_class.identifier: createIndex
focal_class.modifiers: static
focal_class.parameters: (MongoCollection<?> collection,
                              String[] fields,
                              boolean[] ascending,
                              boolean unique,
                              boolean sparse)
focal_class.return: void
focal_class.signature: void createIndex(MongoCollection<?> collection,
                              String[] fields,
                              boolean[] ascending,
                              boolean unique,
                              boolean sparse)
focal_class.class_method_signature: MongoUtils.createPartialIndex(MongoCollection<?> collection,
                                     String[] fields,
                                     boolean[] ascending,
                                     String filter)
focal_class.full_signature: static void createPartialIndex(MongoCollection<?> collection,
                                     String[] fields,
                                     boolean[] ascending,
                                     String filter)
focal_class.identifier: createPartialIndex
focal_class.modifiers: static
focal_class.parameters: (MongoCollection<?> collection,
                                     String[] fields,
                                     boolean[] ascending,
                                     String filter)
focal_class.return: void
focal_class.signature: void createPartialIndex(MongoCollection<?> collection,
                                     String[] fields,
                                     boolean[] ascending,
                                     String filter)
focal_class.class_method_signature: MongoUtils.hasIndex(MongoCollection<?> collection, String... fields)
focal_class.full_signature: static boolean hasIndex(MongoCollection<?> collection, String... fields)
focal_class.identifier: hasIndex
focal_class.modifiers: static
focal_class.parameters: (MongoCollection<?> collection, String... fields)
focal_class.return: boolean
focal_class.signature: boolean hasIndex(MongoCollection<?> collection, String... fields)
focal_class.class_method_signature: MongoUtils.isCollectionEmpty(@NotNull MongoCollection<?> collection,
                                       @Nullable ClientSession session)
focal_class.full_signature: static boolean isCollectionEmpty(@NotNull MongoCollection<?> collection,
                                       @Nullable ClientSession session)
focal_class.identifier: isCollectionEmpty
focal_class.modifiers: static
focal_class.parameters: (@NotNull MongoCollection<?> collection,
                                       @Nullable ClientSession session)
focal_class.return: boolean
focal_class.signature: boolean isCollectionEmpty(@NotNull MongoCollection<?> collection,
                                       @Nullable ClientSession session)
focal_class.class_method_signature: MongoUtils.getDocumentStoreExceptionTypeFor(Throwable t)
focal_class.full_signature: static Type getDocumentStoreExceptionTypeFor(Throwable t)
focal_class.identifier: getDocumentStoreExceptionTypeFor
focal_class.modifiers: static
focal_class.parameters: (Throwable t)
focal_class.return: Type
focal_class.signature: Type getDocumentStoreExceptionTypeFor(Throwable t)
focal_method.body: static Type getDocumentStoreExceptionTypeFor(Throwable t) {
          Type type = Type.GENERIC;
          if (t instanceof MongoSocketException
                  || t instanceof MongoWriteConcernException
                  || t instanceof MongoNotPrimaryException) {
              type = Type.TRANSIENT;
          } else if (t instanceof MongoCommandException
                  || t instanceof WriteConcernException) {
              int code = ((MongoException) t).getCode();
              if (code == 11600               // InterruptedAtShutdown
                      || code == 11601        // Interrupted
                      || code == 11602) {     // InterruptedDueToReplStateChange
                  type = Type.TRANSIENT;
              }
          }
          return type;
      }
focal_method.class_method_signature: MongoUtils.getDocumentStoreExceptionTypeFor(Throwable t)
focal_method.full_signature: static Type getDocumentStoreExceptionTypeFor(Throwable t)
focal_method.identifier: getDocumentStoreExceptionTypeFor
focal_method.invocations: getCode
focal_method.modifiers: static
focal_method.parameters: (Throwable t)
focal_method.return: Type
focal_method.signature: Type getDocumentStoreExceptionTypeFor(Throwable t)