@Test public void getDuplicateDriver() throws MalformedURLException { ClassLoader originalClassloader = Thread.currentThread().getContextClassLoader(); URL[] urls = new URL[1]; urls[0] = new File("src/test/resources/test").toURI().toURL(); ClassLoader fakeClassLoader = new URLClassLoader(urls, originalClassloader); assertThrows(IllegalStateException.class, () -> new PlcDriverManager(fakeClassLoader).getConnection("api-mock: }
public PlcConnection getConnection(String url) throws PlcConnectionException { PlcDriver driver = getDriver(url); PlcConnection connection = driver.getConnection(url); connection.connect(); return connection; }
PlcDriverManager { public PlcConnection getConnection(String url) throws PlcConnectionException { PlcDriver driver = getDriver(url); PlcConnection connection = driver.getConnection(url); connection.connect(); return connection; } }
PlcDriverManager { public PlcConnection getConnection(String url) throws PlcConnectionException { PlcDriver driver = getDriver(url); PlcConnection connection = driver.getConnection(url); connection.connect(); return connection; } PlcDriverManager();  PlcDriverManager(ClassLoader classLoader); }
PlcDriverManager { public PlcConnection getConnection(String url) throws PlcConnectionException { PlcDriver driver = getDriver(url); PlcConnection connection = driver.getConnection(url); connection.connect(); return connection; } PlcDriverManager();  PlcDriverManager(ClassLoader classLoader); PlcConnection getConnection(String url); PlcConnection getConnection(String url, PlcAuthentication authentication); @Experimental PlcDriver getDriver(String url); }
PlcDriverManager { public PlcConnection getConnection(String url) throws PlcConnectionException { PlcDriver driver = getDriver(url); PlcConnection connection = driver.getConnection(url); connection.connect(); return connection; } PlcDriverManager();  PlcDriverManager(ClassLoader classLoader); PlcConnection getConnection(String url); PlcConnection getConnection(String url, PlcAuthentication authentication); @Experimental PlcDriver getDriver(String url);  }