summaryrefslogtreecommitdiffstats
path: root/src/test/java/com/btr/proxy/search/desktop/DesktopProxySearchTest.java
blob: 0f8e6bea678974f72545b308665405dc27ace677 (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
package com.btr.proxy.search.desktop;

import java.net.ProxySelector;
import java.net.URI;
import java.net.URISyntaxException;

import org.junit.Test;

import com.btr.proxy.search.ProxySearch;
import com.btr.proxy.util.ProxyException;

/*****************************************************************************
 * Unit tests for the desktop facade search strategy.
 * 
 * @author Bernd Rosstauscher (proxyvole@rosstauscher.de) Copyright 2009
 ****************************************************************************/

public class DesktopProxySearchTest {
	
	/*************************************************************************
	 * Test method.
	 * @throws ProxyException on error.
	 ************************************************************************/
	@Test
	public void testDesktopStrategsIsWorking() throws ProxyException {
		new DesktopProxySearchStrategy().getProxySelector();
	}
	
	/*************************************************************************
	 * Test method.
	 * @throws URISyntaxException on error parsing the URI. 
	 * @throws ProxyException on selector error.
	 ************************************************************************/
	@Test
	public void emptyURIShouldNotRaiseNPE() throws URISyntaxException, ProxyException {
		ProxySearch proxySearch = ProxySearch.getDefaultProxySearch();
		ProxySelector myProxySelector = proxySearch.getProxySelector();
		if (myProxySelector != null) {
			myProxySelector.select(new URI(""));
		}
	}


}