Mercurial > dive4elements > river
changeset 9683:f4fdf7798bab
Fixed missing package name
author | Gernot Belger <g.belger@bjoernsen.de> |
---|---|
date | Wed, 15 Jul 2020 14:25:53 +0200 |
parents | 9ec4686badae |
children | c0803135455c |
files | artifacts/src/test/java/org/dive4elements/river/utils/MapUtilsTest.java |
diffstat | 1 files changed, 59 insertions(+), 59 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/test/java/org/dive4elements/river/utils/MapUtilsTest.java Wed Jul 15 12:24:35 2020 +0200 +++ b/artifacts/src/test/java/org/dive4elements/river/utils/MapUtilsTest.java Wed Jul 15 14:25:53 2020 +0200 @@ -6,13 +6,13 @@ * documentation coming with Dive4Elements River for details. */ +package org.dive4elements.river.utils; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import org.junit.Test; -import org.dive4elements.river.utils.MapUtils; - public class MapUtilsTest { private static final String DRV_PG = "jdbc:postgresql:"; @@ -28,108 +28,108 @@ @Test public void noJDBCURL() { - String con = MapUtils.getConnection(USER, PSWD, "xx"); + final String con = MapUtils.getConnection(USER, PSWD, "xx"); assertNull(con); } @Test public void invalidHostPG() { - String con = MapUtils.getConnection( - USER, PSWD, DRV_PG + "//invalid_host_name/"); + final String con = MapUtils.getConnection( + USER, PSWD, DRV_PG + "//invalid_host_name/"); assertNull(con); } @Test public void localNamedPG() { - String con = MapUtils.getConnection( - USER, PSWD, DRV_PG + DB); + final String con = MapUtils.getConnection( + USER, PSWD, DRV_PG + DB); assertEquals( - "dbname=" + DB - + " user=" + USER - + " password='" + PSWD + "'" + PG_CON_SUFFIX, - con); + "dbname=" + DB + + " user=" + USER + + " password='" + PSWD + "'" + PG_CON_SUFFIX, + con); } @Test public void localUserPG() { - String con = MapUtils.getConnection( - USER, PSWD, DRV_PG + "/"); + final String con = MapUtils.getConnection( + USER, PSWD, DRV_PG + "/"); assertEquals( - "dbname=" + USER - + " user=" + USER - + " password='" + PSWD + "'" + PG_CON_SUFFIX, - con); + "dbname=" + USER + + " user=" + USER + + " password='" + PSWD + "'" + PG_CON_SUFFIX, + con); } @Test public void hostNamedPG() { - String con = MapUtils.getConnection( - USER, PSWD, DRV_PG + "//" + HOST + "/" + DB); + final String con = MapUtils.getConnection( + USER, PSWD, DRV_PG + "//" + HOST + "/" + DB); assertEquals( - "dbname=" + DB - + " user=" + USER - + " host='" + HOST + "'" - + " password='" + PSWD + "'" + PG_CON_SUFFIX, - con); + "dbname=" + DB + + " user=" + USER + + " host='" + HOST + "'" + + " password='" + PSWD + "'" + PG_CON_SUFFIX, + con); } @Test public void hostUserPG() { - String con = MapUtils.getConnection( - USER, PSWD, DRV_PG + "//" + HOST + "/"); + final String con = MapUtils.getConnection( + USER, PSWD, DRV_PG + "//" + HOST + "/"); assertEquals( - "dbname=" + USER - + " user=" + USER - + " host='" + HOST + "'" - + " password='" + PSWD + "'" + PG_CON_SUFFIX, - con); + "dbname=" + USER + + " user=" + USER + + " host='" + HOST + "'" + + " password='" + PSWD + "'" + PG_CON_SUFFIX, + con); } @Test public void hostPortUserPG() { - String con = MapUtils.getConnection( - USER, PSWD, DRV_PG + "//" + HOST + ":" + PORT + "/"); + final String con = MapUtils.getConnection( + USER, PSWD, DRV_PG + "//" + HOST + ":" + PORT + "/"); assertEquals( - "dbname=" + USER - + " user=" + USER - + " host='" + HOST + "' port=" + PORT - + " password='" + PSWD + "'" + PG_CON_SUFFIX, - con); + "dbname=" + USER + + " user=" + USER + + " host='" + HOST + "' port=" + PORT + + " password='" + PSWD + "'" + PG_CON_SUFFIX, + con); } @Test public void hostPortNamedPG() { - String con = MapUtils.getConnection( - USER, PSWD, DRV_PG + "//" + HOST + ":" + PORT + "/" + DB); + final String con = MapUtils.getConnection( + USER, PSWD, DRV_PG + "//" + HOST + ":" + PORT + "/" + DB); assertEquals( - "dbname=" + DB - + " user=" + USER - + " host='" + HOST + "' port=" + PORT - + " password='" + PSWD + "'" + PG_CON_SUFFIX, - con); + "dbname=" + DB + + " user=" + USER + + " host='" + HOST + "' port=" + PORT + + " password='" + PSWD + "'" + PG_CON_SUFFIX, + con); } @Test public void serviceNameORA() { - String con = MapUtils.getConnection( - USER, PSWD, DRV_ORA + "@//" + HOST + ":" + PORT + "/" + DB); + final String con = MapUtils.getConnection( + USER, PSWD, DRV_ORA + "@//" + HOST + ":" + PORT + "/" + DB); assertEquals( - USER + "/" + PSWD + "@" + HOST + ":" + PORT + "/" + DB, - con); + USER + "/" + PSWD + "@" + HOST + ":" + PORT + "/" + DB, + con); } @Test public void connectDescriptorORA() { - String con = MapUtils.getConnection( - USER, PSWD, DRV_ORA - + "@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=" - + HOST + ")(PORT=" + PORT + "))(CONNECT_DATA=(SERVICE_NAME=" - + DB + ")))"); + final String con = MapUtils.getConnection( + USER, PSWD, DRV_ORA + + "@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=" + + HOST + ")(PORT=" + PORT + "))(CONNECT_DATA=(SERVICE_NAME=" + + DB + ")))"); assertEquals( - USER + "/" + PSWD - + "@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=" - + HOST + ")(PORT=" + PORT + "))(CONNECT_DATA=(SERVICE_NAME=" - + DB + ")))", - con); + USER + "/" + PSWD + + "@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=" + + HOST + ")(PORT=" + PORT + "))(CONNECT_DATA=(SERVICE_NAME=" + + DB + ")))", + con); } }