@Test void connectionInvalidation() throws Exception { when(plcDriver.getConnection(anyString())).then(invocationOnMock -> new DummyPlcConnection(invocationOnMock.getArgument(0))); PlcConnection connection = SUT.getConnection("dummydummy:single/socket1/socket2?fancyOption=true"); assertThat(connection.isConnected()).isEqualTo(true); assertThat(connection.getMetadata().canRead()).isEqualTo(false); assertThat(connection.getMetadata().canWrite()).isEqualTo(false); assertThat(connection.getMetadata().canSubscribe()).isEqualTo(false); connection.close(); assertThatThrownBy(connection::connect).isInstanceOf(IllegalStateException.class).hasMessage("Proxy not valid anymore"); assertThatThrownBy(connection::isConnected).isInstanceOf(IllegalStateException.class).hasMessage("Proxy not valid anymore"); assertThatThrownBy(connection::close).isInstanceOf(IllegalStateException.class).hasMessage("Proxy not valid anymore"); assertThatThrownBy(connection::getMetadata).isInstanceOf(IllegalStateException.class).hasMessage("Proxy not valid anymore"); assertThatThrownBy(connection::readRequestBuilder).isInstanceOf(IllegalStateException.class).hasMessage("Proxy not valid anymore"); assertThatThrownBy(connection::writeRequestBuilder).isInstanceOf(IllegalStateException.class).hasMessage("Proxy not valid anymore"); assertThatThrownBy(connection::subscriptionRequestBuilder).isInstanceOf(IllegalStateException.class).hasMessage("Proxy not valid anymore"); assertThatThrownBy(connection::unsubscriptionRequestBuilder).isInstanceOf(IllegalStateException.class).hasMessage("Proxy not valid anymore"); }
@Override public PlcConnection getConnection(String url) throws PlcConnectionException { return getConnection(url, noPlcAuthentication); }
PooledPlcDriverManager extends PlcDriverManager { @Override public PlcConnection getConnection(String url) throws PlcConnectionException { return getConnection(url, noPlcAuthentication); } }
PooledPlcDriverManager extends PlcDriverManager { @Override public PlcConnection getConnection(String url) throws PlcConnectionException { return getConnection(url, noPlcAuthentication); } PooledPlcDriverManager();  PooledPlcDriverManager(PoolKeyFactory poolKeyFactory);  PooledPlcDriverManager(ClassLoader classLoader);  PooledPlcDriverManager(ClassLoader classLoader, PoolKeyFactory poolKeyFactory);  PooledPlcDriverManager(PoolCreator poolCreator);  PooledPlcDriverManager(PoolCreator poolCreator, PoolKeyFactory poolKeyFactory);  PooledPlcDriverManager(ClassLoader classLoader, PoolCreator poolCreator); }
PooledPlcDriverManager extends PlcDriverManager { @Override public PlcConnection getConnection(String url) throws PlcConnectionException { return getConnection(url, noPlcAuthentication); } PooledPlcDriverManager();  PooledPlcDriverManager(PoolKeyFactory poolKeyFactory);  PooledPlcDriverManager(ClassLoader classLoader);  PooledPlcDriverManager(ClassLoader classLoader, PoolKeyFactory poolKeyFactory);  PooledPlcDriverManager(PoolCreator poolCreator);  PooledPlcDriverManager(PoolCreator poolCreator, PoolKeyFactory poolKeyFactory);  PooledPlcDriverManager(ClassLoader classLoader, PoolCreator poolCreator); @Override PlcConnection getConnection(String url); @Override PlcConnection getConnection(String url, PlcAuthentication authentication); Map<String, Number> getStatistics(); }
PooledPlcDriverManager extends PlcDriverManager { @Override public PlcConnection getConnection(String url) throws PlcConnectionException { return getConnection(url, noPlcAuthentication); } PooledPlcDriverManager();  PooledPlcDriverManager(PoolKeyFactory poolKeyFactory);  PooledPlcDriverManager(ClassLoader classLoader);  PooledPlcDriverManager(ClassLoader classLoader, PoolKeyFactory poolKeyFactory);  PooledPlcDriverManager(PoolCreator poolCreator);  PooledPlcDriverManager(PoolCreator poolCreator, PoolKeyFactory poolKeyFactory);  PooledPlcDriverManager(ClassLoader classLoader, PoolCreator poolCreator); @Override PlcConnection getConnection(String url); @Override PlcConnection getConnection(String url, PlcAuthentication authentication); Map<String, Number> getStatistics();  }