Debian Codegraph @

src/test/java/com/github/markusbernhardt/proxy/search/desktop/DesktopProxySearchTest.java

raw symbols SCIP
1 package com.github.markusbernhardt.proxy.search.desktop;
2
3 import java.net.ProxySelector;
4 import java.net.URI;
5 import java.net.URISyntaxException;
6
7 import org.junit.Test;
8
9 import com.github.markusbernhardt.proxy.ProxySearch;
10 import com.github.markusbernhardt.proxy.search.desktop.DesktopProxySearchStrategy;
11 import com.github.markusbernhardt.proxy.util.ProxyException;
12
13 /*****************************************************************************
14 * Unit tests for the desktop facade search strategy.
15 *
16 * @author Markus Bernhardt, Copyright 2016
17 * @author Bernd Rosstauscher, Copyright 2009
18 ****************************************************************************/
19
20 public class DesktopProxySearchTest {
21
22 /*************************************************************************
23 * Test method.
24 *
25 * @throws ProxyException
26 * on error.
27 ************************************************************************/
28 @Test
29 public void testDesktopStrategsIsWorking() throws ProxyException {
30 new DesktopProxySearchStrategy().getProxySelector();
31 }
32
33 /*************************************************************************
34 * Test method.
35 *
36 * @throws URISyntaxException
37 * on error parsing the URI.
38 * @throws ProxyException
39 * on selector error.
40 ************************************************************************/
41 @Test
42 public void emptyURIShouldNotRaiseNPE() throws URISyntaxException, ProxyException {
43 ProxySearch proxySearch = ProxySearch.getDefaultProxySearch();
44 ProxySelector myProxySelector = proxySearch.getProxySelector();
45 if (myProxySelector != null) {
46 myProxySelector.select(new URI(""));
47 }
48 }
49
50 }