Skip to content

Commit

Permalink
MONDRIAN: make test Connect Strings consistent
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 4478]
  • Loading branch information
Sherman Wood committed Nov 23, 2005
1 parent b915f6e commit 763df58
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion testsrc/main/mondrian/test/TestContext.java
Expand Up @@ -97,7 +97,7 @@ protected TestContext() {
* <code>demo/FoodMart.xml</code></li>.
* </ul>
*/
private static String getConnectString() {
public static String getConnectString() {
String connectString = MondrianProperties.instance().TestConnectString.get();
final Util.PropertyList connectProperties;
if (connectString == null || connectString.equals("")) {
Expand All @@ -110,6 +110,15 @@ private static String getConnectString() {
if (jdbcURL != null) {
connectProperties.put("Jdbc", jdbcURL);
}
String jdbcUser = MondrianProperties.instance().TestJdbcUser.get();
if (jdbcUser != null) {
connectProperties.put("JdbcUser", jdbcUser);
}
String jdbcPassword = MondrianProperties.instance().TestJdbcPassword.get();
if (jdbcPassword != null) {
connectProperties.put("JdbcPassword", jdbcPassword);
}

// Find the catalog. Use the URL specified in the connect string, if
// it is specified and is valid. Otherwise, reference FoodMart.xml
// assuming we are at the root of the source tree.
Expand Down
2 changes: 1 addition & 1 deletion testsrc/main/mondrian/xmla/XmlaTest.java
Expand Up @@ -51,7 +51,7 @@ public XmlaTest(String s) {
protected void setUp() throws Exception {
super.setUp();
// Deal with embedded & that can be in the JDBC URL
String connectString = MondrianProperties.instance().TestConnectString.get();
String connectString = TestContext.getConnectString();
dataSource = "MondrianFoodMart";
catalogName = DriverManager.getConnection(connectString, null, false).getSchema().getName();

Expand Down

0 comments on commit 763df58

Please sign in to comment.