diff options
Diffstat (limited to 'src/test/resources/data/pac')
-rw-r--r-- | src/test/resources/data/pac/test1.pac | 4 | ||||
-rw-r--r-- | src/test/resources/data/pac/test2.pac | 10 | ||||
-rw-r--r-- | src/test/resources/data/pac/testDateRange.pac | 11 | ||||
-rw-r--r-- | src/test/resources/data/pac/testLocalIP.pac | 4 | ||||
-rw-r--r-- | src/test/resources/data/pac/testMultiProxy.pac | 4 | ||||
-rw-r--r-- | src/test/resources/data/pac/testTimeRange.pac | 11 | ||||
-rw-r--r-- | src/test/resources/data/pac/testWeekDay.pac | 10 |
7 files changed, 54 insertions, 0 deletions
diff --git a/src/test/resources/data/pac/test1.pac b/src/test/resources/data/pac/test1.pac new file mode 100644 index 0000000..4d8c2d6 --- /dev/null +++ b/src/test/resources/data/pac/test1.pac @@ -0,0 +1,4 @@ + +function FindProxyForURL(url, host) { + return "PROXY http_proxy.unit-test.invalid:8090"; +}
\ No newline at end of file diff --git a/src/test/resources/data/pac/test2.pac b/src/test/resources/data/pac/test2.pac new file mode 100644 index 0000000..f8a846e --- /dev/null +++ b/src/test/resources/data/pac/test2.pac @@ -0,0 +1,10 @@ +// Test comments in scripts + +function FindProxyForURL(url, host) { + + /* + * This is a multiline comment + */ + + return "DIRECT"; // This returns always DIRECT +}
\ No newline at end of file diff --git a/src/test/resources/data/pac/testDateRange.pac b/src/test/resources/data/pac/testDateRange.pac new file mode 100644 index 0000000..305b783 --- /dev/null +++ b/src/test/resources/data/pac/testDateRange.pac @@ -0,0 +1,11 @@ +// Test date range functions + +function FindProxyForURL(url, host) { + dateRange(1, 30); + dateRange("JUN", "JUL"); + dateRange(2008, 2009); + dateRange("JUN", "JUL", "GMT"); + dateRange(1, "JUN", 2008, 30, "JUL", 2099, "GMT"); + + return "DIRECT"; +}
\ No newline at end of file diff --git a/src/test/resources/data/pac/testLocalIP.pac b/src/test/resources/data/pac/testLocalIP.pac new file mode 100644 index 0000000..ace486c --- /dev/null +++ b/src/test/resources/data/pac/testLocalIP.pac @@ -0,0 +1,4 @@ + +function FindProxyForURL(url, host) { + return "PROXY "+ myIpAddress()+":8080"; +}
\ No newline at end of file diff --git a/src/test/resources/data/pac/testMultiProxy.pac b/src/test/resources/data/pac/testMultiProxy.pac new file mode 100644 index 0000000..9f5a2d1 --- /dev/null +++ b/src/test/resources/data/pac/testMultiProxy.pac @@ -0,0 +1,4 @@ +function FindProxyForURL(url, host) +{ + return "PROXY my-proxy.com:80 ; PROXY my-proxy2.com: 8080; "; +}
\ No newline at end of file diff --git a/src/test/resources/data/pac/testTimeRange.pac b/src/test/resources/data/pac/testTimeRange.pac new file mode 100644 index 0000000..21138ac --- /dev/null +++ b/src/test/resources/data/pac/testTimeRange.pac @@ -0,0 +1,11 @@ +// Test weekday functions + +function FindProxyForURL(url, host) { + timeRange(12); + timeRange(11, 16); + timeRange(10, 30, 17, 30, "gmt"); + timeRange(10, 30, 00, 17, 30, 30, "GMT"); + timeRange(19, 9); + + return "DIRECT"; +}
\ No newline at end of file diff --git a/src/test/resources/data/pac/testWeekDay.pac b/src/test/resources/data/pac/testWeekDay.pac new file mode 100644 index 0000000..1b37cb1 --- /dev/null +++ b/src/test/resources/data/pac/testWeekDay.pac @@ -0,0 +1,10 @@ +// Test weekday functions + +function FindProxyForURL(url, host) { + weekdayRange("MON"); + weekdayRange("MON", "GMT"); + weekdayRange("FRI", "MON"); + weekdayRange("MON", "WED", "GMT"); + + return "DIRECT"; +}
\ No newline at end of file |