| 1 |
package com.github.markusbernhardt.proxy.search.browser; |
| 2 |
|
| 3 |
import static org.junit.Assert.assertFalse; |
| 4 |
import static org.junit.Assert.assertTrue; |
| 5 |
|
| 6 |
import java.net.MalformedURLException; |
| 7 |
import java.net.URISyntaxException; |
| 8 |
import java.net.URL; |
| 9 |
|
| 10 |
import org.junit.Test; |
| 11 |
|
| 12 |
import com.github.markusbernhardt.proxy.TestUtil; |
| 13 |
import com.github.markusbernhardt.proxy.search.browser.ie.IELocalByPassFilter; |
| 14 |
import com.github.markusbernhardt.proxy.search.browser.ie.IEProxySearchStrategy; |
| 15 |
import com.github.markusbernhardt.proxy.util.PlatformUtil; |
| 16 |
import com.github.markusbernhardt.proxy.util.ProxyException; |
| 17 |
import com.github.markusbernhardt.proxy.util.UriFilter; |
| 18 |
import com.github.markusbernhardt.proxy.util.PlatformUtil.Platform; |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
public class IeTest { |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
@Test |
| 38 |
public void testInvoke() throws ProxyException { |
| 39 |
if (Platform.WIN.equals(PlatformUtil.getCurrentPlattform())) { |
| 40 |
IEProxySearchStrategy st = new IEProxySearchStrategy(); |
| 41 |
|
| 42 |
|
| 43 |
st.getProxySelector(); |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
@Test |
| 58 |
public void testLocalByPassFilter() throws ProxyException, MalformedURLException, URISyntaxException { |
| 59 |
UriFilter filter = new IELocalByPassFilter(); |
| 60 |
assertTrue(filter.accept(TestUtil.LOCAL_TEST_URI)); |
| 61 |
assertFalse(filter.accept(TestUtil.HTTP_TEST_URI)); |
| 62 |
assertFalse(filter.accept(new URL("http://123.45.55.6").toURI())); |
| 63 |
} |
| 64 |
|
| 65 |
} |