Mercurial > dive4elements > river
annotate artifacts/src/test/java/org/dive4elements/river/utils/MapUtilsTest.java @ 9672:b70b1bc0eece 3.2.x
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Sat, 23 May 2020 10:37:23 +0200 |
parents | 9cfc495a9f40 |
children | f4fdf7798bab |
rev | line source |
---|---|
9671
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2020 by Bundesanstalt für Gewässerkunde |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
3 * |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
7 */ |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
8 |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
9 import static org.junit.Assert.assertEquals; |
9672
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
10 import static org.junit.Assert.assertNull; |
9671
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
11 |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
12 import org.junit.Test; |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
13 |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
14 import org.dive4elements.river.utils.MapUtils; |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
15 |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
16 public class MapUtilsTest { |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
17 |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
18 private static final String DRV_PG = "jdbc:postgresql:"; |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
19 private static final String DRV_ORA = "jdbc:oracle:thin:"; |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
20 |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
21 private static final String USER = "d4euser"; |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
22 private static final String PSWD = "d4epswd"; |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
23 private static final String DB = "d4edb"; |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
24 private static final String HOST = "d4ehost"; |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
25 private static final String PORT = "2345"; |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
26 |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
27 private static final String PG_CON_SUFFIX = " sslmode=disable"; |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
28 |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
29 @Test |
9672
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
30 public void noJDBCURL() { |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
31 String con = MapUtils.getConnection(USER, PSWD, "xx"); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
32 assertNull(con); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
33 } |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
34 |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
35 @Test |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
36 public void invalidHostPG() { |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
37 String con = MapUtils.getConnection( |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
38 USER, PSWD, DRV_PG + "//invalid_host_name/"); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
39 assertNull(con); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
40 } |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
41 |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
42 @Test |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
43 public void localNamedPG() { |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
44 String con = MapUtils.getConnection( |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
45 USER, PSWD, DRV_PG + DB); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
46 assertEquals( |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
47 "dbname=" + DB |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
48 + " user=" + USER |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
49 + " password='" + PSWD + "'" + PG_CON_SUFFIX, |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
50 con); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
51 } |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
52 |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
53 @Test |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
54 public void localUserPG() { |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
55 String con = MapUtils.getConnection( |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
56 USER, PSWD, DRV_PG + "/"); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
57 assertEquals( |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
58 "dbname=" + USER |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
59 + " user=" + USER |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
60 + " password='" + PSWD + "'" + PG_CON_SUFFIX, |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
61 con); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
62 } |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
63 |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
64 @Test |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
65 public void hostNamedPG() { |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
66 String con = MapUtils.getConnection( |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
67 USER, PSWD, DRV_PG + "//" + HOST + "/" + DB); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
68 assertEquals( |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
69 "dbname=" + DB |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
70 + " user=" + USER |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
71 + " host='" + HOST + "'" |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
72 + " password='" + PSWD + "'" + PG_CON_SUFFIX, |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
73 con); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
74 } |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
75 |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
76 @Test |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
77 public void hostUserPG() { |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
78 String con = MapUtils.getConnection( |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
79 USER, PSWD, DRV_PG + "//" + HOST + "/"); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
80 assertEquals( |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
81 "dbname=" + USER |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
82 + " user=" + USER |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
83 + " host='" + HOST + "'" |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
84 + " password='" + PSWD + "'" + PG_CON_SUFFIX, |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
85 con); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
86 } |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
87 |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
88 @Test |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
89 public void hostPortUserPG() { |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
90 String con = MapUtils.getConnection( |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
91 USER, PSWD, DRV_PG + "//" + HOST + ":" + PORT + "/"); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
92 assertEquals( |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
93 "dbname=" + USER |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
94 + " user=" + USER |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
95 + " host='" + HOST + "' port=" + PORT |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
96 + " password='" + PSWD + "'" + PG_CON_SUFFIX, |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
97 con); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
98 } |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
99 |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
100 @Test |
9671
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
101 public void hostPortNamedPG() { |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
102 String con = MapUtils.getConnection( |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
103 USER, PSWD, DRV_PG + "//" + HOST + ":" + PORT + "/" + DB); |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
104 assertEquals( |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
105 "dbname=" + DB |
9672
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
106 + " user=" + USER |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
107 + " host='" + HOST + "' port=" + PORT |
9671
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
108 + " password='" + PSWD + "'" + PG_CON_SUFFIX, |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
109 con); |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
110 } |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
111 |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
112 @Test |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
113 public void serviceNameORA() { |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
114 String con = MapUtils.getConnection( |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
115 USER, PSWD, DRV_ORA + "@//" + HOST + ":" + PORT + "/" + DB); |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
116 assertEquals( |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
117 USER + "/" + PSWD + "@" + HOST + ":" + PORT + "/" + DB, |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
118 con); |
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
119 } |
9672
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
120 |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
121 @Test |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
122 public void connectDescriptorORA() { |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
123 String con = MapUtils.getConnection( |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
124 USER, PSWD, DRV_ORA |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
125 + "@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=" |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
126 + HOST + ")(PORT=" + PORT + "))(CONNECT_DATA=(SERVICE_NAME=" |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
127 + DB + ")))"); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
128 assertEquals( |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
129 USER + "/" + PSWD |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
130 + "@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=" |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
131 + HOST + ")(PORT=" + PORT + "))(CONNECT_DATA=(SERVICE_NAME=" |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
132 + DB + ")))", |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
133 con); |
b70b1bc0eece
Essentially rewrite MapUtils.getConnection() to cope with driver capabilities
Tom Gottfried <tom@intevation.de>
parents:
9671
diff
changeset
|
134 } |
9671
9cfc495a9f40
Add minimal test coverage for MapServer connection generation
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
135 } |