Debian Codegraph @

src/test/java/com/github/markusbernhardt/proxy/selector/fixed/FixedProxyTest.java

raw symbols SCIP
1 package com.github.markusbernhardt.proxy.selector.fixed;
2
3 import static org.junit.Assert.assertEquals;
4
5 import java.net.Proxy;
6 import java.net.ProxySelector;
7 import java.util.List;
8
9 import org.junit.Test;
10
11 import com.github.markusbernhardt.proxy.TestUtil;
12 import com.github.markusbernhardt.proxy.selector.fixed.FixedProxySelector;
13
14 /*****************************************************************************
15 *
16 * @author Markus Bernhardt, Copyright 2016
17 * @author Bernd Rosstauscher, Copyright 2009
18 ****************************************************************************/
19
20 public class FixedProxyTest {
21
22 /*************************************************************************
23 * Test method
24 ************************************************************************/
25 @Test
26 public void testFixedProxy() {
27 ProxySelector ps = new FixedProxySelector("http_proxy.unit-test.invalid", 8090);
28
29 List<Proxy> result = ps.select(TestUtil.HTTP_TEST_URI);
30 assertEquals(TestUtil.HTTP_TEST_PROXY, result.get(0));
31 }
32
33 /*************************************************************************
34 * Test method
35 ************************************************************************/
36 @Test
37 public void testFixedProxy2() {
38 ProxySelector ps = new FixedProxySelector(TestUtil.HTTP_TEST_PROXY);
39
40 List<Proxy> result = ps.select(TestUtil.HTTP_TEST_URI);
41 assertEquals(TestUtil.HTTP_TEST_PROXY, result.get(0));
42 }
43
44 /*************************************************************************
45 * Test method
46 ************************************************************************/
47 @Test
48 public void testFixedProxy3() {
49 ProxySelector ps = new FixedProxySelector(TestUtil.HTTP_TEST_PROXY);
50
51 List<Proxy> result = ps.select(TestUtil.HTTPS_TEST_URI);
52 assertEquals(TestUtil.HTTP_TEST_PROXY, result.get(0));
53 }
54
55 }