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