test_class.declarator: logger = LoggerFactory.getLogger(this.getClass())
test_class.modifier: protected final
test_class.original_string: protected final Logger logger = LoggerFactory.getLogger(this.getClass());
test_class.type: Logger
test_class.var_name: logger
test_class.declarator: exception = ExpectedException.none()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public ExpectedException exception = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: exception
test_class.file: marklogic-rdf4j/src/test/java/com/marklogic/semantics/rdf4j/config/MarkLogicRepositoryFactoryTest.java
test_class.identifier: MarkLogicRepositoryFactoryTest
test_class.superclass: extends Rdf4jTestBase
test_case.body: @Test
      public void testGetRepository() throws Exception {
          MarkLogicRepositoryConfig config = new MarkLogicRepositoryConfig();
          config.setHost(host);
          config.setPort(port);
          config.setUser(adminUser);
          config.setPassword(adminPassword);
          config.setAuth("DIGEST");
  
          RepositoryFactory factory = new MarkLogicRepositoryFactory();
          Assert.assertEquals("marklogic:MarkLogicRepository", factory.getRepositoryType());
  
          Repository repo = factory.getRepository(config);
          repo.initialize();
          Assert.assertTrue(repo.getConnection() instanceof MarkLogicRepositoryConnection);
  
          Repository otherrepo = factory.getRepository(config);
          otherrepo.initialize();
          RepositoryConnection oconn = otherrepo.getConnection();
          Assert.assertTrue(oconn instanceof MarkLogicRepositoryConnection);
      }
test_case.class_method_signature: MarkLogicRepositoryFactoryTest.testGetRepository()
test_case.full_signature: @Test public void testGetRepository()
test_case.identifier: testGetRepository
test_case.invocations: setHost setPort setUser setPassword setAuth assertEquals getRepositoryType getRepository initialize assertTrue getConnection getRepository initialize getConnection assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetRepository()
focal_class.declarator: logger = LoggerFactory.getLogger(MarkLogicRepositoryFactory.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(MarkLogicRepositoryFactory.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: REPOSITORY_TYPE = "marklogic:MarkLogicRepository"
focal_class.modifier: public static final
focal_class.original_string: public static final String REPOSITORY_TYPE = "marklogic:MarkLogicRepository";
focal_class.type: String
focal_class.var_name: REPOSITORY_TYPE
focal_class.file: marklogic-rdf4j/src/main/java/com/marklogic/semantics/rdf4j/config/MarkLogicRepositoryFactory.java
focal_class.identifier: MarkLogicRepositoryFactory
focal_class.interfaces: implements RepositoryFactory
focal_class.class_method_signature: MarkLogicRepositoryFactory.getRepositoryType()
focal_class.full_signature: @Override /** * getter for repository type. * */ public String getRepositoryType()
focal_class.identifier: getRepositoryType
focal_class.modifiers: @Override /** * getter for repository type. * */ public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getRepositoryType()
focal_class.class_method_signature: MarkLogicRepositoryFactory.getConfig()
focal_class.full_signature: @Override /** * returns config * */ public RepositoryImplConfig getConfig()
focal_class.identifier: getConfig
focal_class.modifiers: @Override /** * returns config * */ public
focal_class.parameters: ()
focal_class.return: RepositoryImplConfig
focal_class.signature: RepositoryImplConfig getConfig()
focal_class.class_method_signature: MarkLogicRepositoryFactory.getRepository(RepositoryImplConfig config)
focal_class.full_signature: @Override /** * Instantiate and return repository object. * */ public Repository getRepository(RepositoryImplConfig config)
focal_class.identifier: getRepository
focal_class.modifiers: @Override /** * Instantiate and return repository object. * */ public
focal_class.parameters: (RepositoryImplConfig config)
focal_class.return: Repository
focal_class.signature: Repository getRepository(RepositoryImplConfig config)
focal_method.body: @Override
      /**
       * Instantiate and return repository object.
       *
       */
      public Repository getRepository(RepositoryImplConfig config) throws RepositoryConfigException {
          MarkLogicRepository repo = null;
          MarkLogicRepositoryConfig cfg = (MarkLogicRepositoryConfig) config;
          if (cfg.getHost() != null && cfg.getPort() != 0) {
              // init with MarkLogicRepositoryConfig
              repo = new MarkLogicRepository(cfg.getHost(),cfg.getPort(),cfg.getUser(),cfg.getPassword(),cfg.getAuth());
          } else if (cfg.getHost() == null) {
              // init with queryEndpoint as connection string
              try {
                  repo = new MarkLogicRepository(new URL(cfg.getQueryEndpointUrl()));
              } catch (MalformedURLException e) {
                  logger.debug(e.getMessage());
                  throw new RepositoryConfigException(e.getMessage());
              }
          }else{
              throw new RepositoryConfigException("Invalid configuration class: " + config.getClass());
          }
          return repo;
      }
focal_method.class_method_signature: MarkLogicRepositoryFactory.getRepository(RepositoryImplConfig config)
focal_method.full_signature: @Override /** * Instantiate and return repository object. * */ public Repository getRepository(RepositoryImplConfig config)
focal_method.identifier: getRepository
focal_method.invocations: getHost getPort getHost getPort getUser getPassword getAuth getHost getQueryEndpointUrl debug getMessage getMessage getClass
focal_method.modifiers: @Override /** * Instantiate and return repository object. * */ public
focal_method.parameters: (RepositoryImplConfig config)
focal_method.return: Repository
focal_method.signature: Repository getRepository(RepositoryImplConfig config)