@Test public void testSimplePac2() throws Exception { final URI uri = new URI("http: final PacFileEvaluator evaluator = new PacFileEvaluator(PacFileEvaluatorTest.class.getResource("simple-pac.js"), new NoopPacProxyCache()); final String proxy = evaluator.getProxies(uri); Assertions.assertNotNull(proxy); Assertions.assertEquals("DIRECT", proxy); }
String getProxies(final URI uri) { final String cachedResult = cache.getFromCache(uri); if (cachedResult != null) { return cachedResult; } final String result = getProxiesWithoutCaching(uri); LOG.debug("PAC result for url '{}' -> '{}'", uri, result); cache.addToCache(uri, result); return result; }
PacFileEvaluator { String getProxies(final URI uri) { final String cachedResult = cache.getFromCache(uri); if (cachedResult != null) { return cachedResult; } final String result = getProxiesWithoutCaching(uri); LOG.debug("PAC result for url '{}' -> '{}'", uri, result); cache.addToCache(uri, result); return result; } }
PacFileEvaluator { String getProxies(final URI uri) { final String cachedResult = cache.getFromCache(uri); if (cachedResult != null) { return cachedResult; } final String result = getProxiesWithoutCaching(uri); LOG.debug("PAC result for url '{}' -> '{}'", uri, result); cache.addToCache(uri, result); return result; } PacFileEvaluator(final URL pacUrl, PacProxyCache cache); }
PacFileEvaluator { String getProxies(final URI uri) { final String cachedResult = cache.getFromCache(uri); if (cachedResult != null) { return cachedResult; } final String result = getProxiesWithoutCaching(uri); LOG.debug("PAC result for url '{}' -> '{}'", uri, result); cache.addToCache(uri, result); return result; } PacFileEvaluator(final URL pacUrl, PacProxyCache cache);  }
PacFileEvaluator { String getProxies(final URI uri) { final String cachedResult = cache.getFromCache(uri); if (cachedResult != null) { return cachedResult; } final String result = getProxiesWithoutCaching(uri); LOG.debug("PAC result for url '{}' -> '{}'", uri, result); cache.addToCache(uri, result); return result; } PacFileEvaluator(final URL pacUrl, PacProxyCache cache);   }