Debian Codegraph @

src/test/java/org/jboss/modules/maven/NonProxyHostTest.java

raw
1 package org.jboss.modules.maven;
2
3 import java.net.MalformedURLException;
4 import java.net.URL;
5
6 import org.junit.Assert;
7 import org.junit.Test;
8
9 /**
10 * Created by bob on 4/21/17.
11 */
12 public class NonProxyHostTest {
13
14 @Test
15 public void testExactMatch() throws MalformedURLException {
16 MavenSettings.NonProxyHost nph = new MavenSettings.NonProxyHost("www.google.com");
17 Assert.assertTrue(nph.matches(new URL("http://www.google.com/")));
18 Assert.assertFalse(nph.matches(new URL("http://google.com/")));
19 Assert.assertFalse(nph.matches(new URL("http://www.apple.com/")));
20 }
21
22 @Test
23 public void testWildcardMatch() throws MalformedURLException {
24 MavenSettings.NonProxyHost nph = new MavenSettings.NonProxyHost("*.google.com");
25 Assert.assertTrue(nph.matches(new URL("http://www.google.com/")));
26 Assert.assertTrue(nph.matches(new URL("http://wave.google.com/")));
27 Assert.assertFalse(nph.matches(new URL("http://google.com/")));
28 Assert.assertFalse(nph.matches(new URL("http://www.apple.com/")));
29 }
30 }