### Question:
AdaptIntermediateRdbmsProvider implements IntegralIntermediateRdbmsProvider { @NotNull @Override public IntegralIntermediateFacade openFacade(@NotNull final String connectionString, @Nullable final Properties connectionProperties, final int connectionsLimit) { final PrimeIntermediateFacade remoteFacade = myRemoteProvider.openFacade(connectionString, connectionProperties, connectionsLimit); return new AdaptIntermediateFacade(remoteFacade); } AdaptIntermediateRdbmsProvider(@NotNull final PrimeIntermediateRdbmsProvider remoteProvider); @NotNull @Override Rdbms rdbms(); @NotNull @Override Pattern connectionStringPattern(); @Override byte specificity(); @NotNull @Override IntegralIntermediateFacade openFacade(@NotNull final String connectionString,
                                               @Nullable final Properties connectionProperties,
                                               final int connectionsLimit); @NotNull @Override Class<? extends DBExceptionRecognizer> getExceptionRecognizerClass(); @NotNull @Override DBExceptionRecognizer getExceptionRecognizer(); @Nullable @Override I getSpecificService(@NotNull final Class<I> serviceClass,
                                  @NotNull final String serviceName);  }### Answer:
@Test public void remote_ping() throws Exception { UnknownDatabaseProvider remoteProvider = ourUnknownDatabaseProvider; AdaptIntermediateRdbmsProvider provider = new AdaptIntermediateRdbmsProvider(remoteProvider); IntegralIntermediateFacade facade = provider.openFacade(BaseInMemoryDBCase.H2_CONNECTION_STRING, null, 1); facade.connect(); IntegralIntermediateSession session = facade.openSession(); long duration = session.ping(); assertThat(duration).isGreaterThan(0); session.close(); facade.disconnect(); }
@Test public void remote_scenario() throws Exception { UnknownDatabaseProvider remoteProvider = ourUnknownDatabaseProvider; AdaptIntermediateRdbmsProvider provider = new AdaptIntermediateRdbmsProvider(remoteProvider); IntegralIntermediateFacade facade = provider.openFacade(BaseInMemoryDBCase.H2_CONNECTION_STRING, null, 1); facade.connect(); IntegralIntermediateSession session = facade.openSession(); IntegralIntermediateSeance seance = session.openSeance("select 44", null); seance.execute(); IntegralIntermediateCursor<Integer> cursor = seance.openCursor(0, Layouts.singleOf(Integer.class)); cursor.fetch(); cursor.close(); seance.close(); session.close(); facade.disconnect(); }