| 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 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
public class DesktopProxySearchTest { |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
@Test |
| 29 |
public void testDesktopStrategsIsWorking() throws ProxyException { |
| 30 |
new DesktopProxySearchStrategy().getProxySelector(); |
| 31 |
} |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 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 |
} |