summaryrefslogtreecommitdiffstats
path: root/src/test/java/com/btr/proxy/selector/fixed/FixedProxyTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/btr/proxy/selector/fixed/FixedProxyTest.java')
-rw-r--r--src/test/java/com/btr/proxy/selector/fixed/FixedProxyTest.java56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/test/java/com/btr/proxy/selector/fixed/FixedProxyTest.java b/src/test/java/com/btr/proxy/selector/fixed/FixedProxyTest.java
new file mode 100644
index 0000000..c4a7d08
--- /dev/null
+++ b/src/test/java/com/btr/proxy/selector/fixed/FixedProxyTest.java
@@ -0,0 +1,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));
+ }
+
+
+}
+