X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=test%2Fenterprise%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fsupport%2Fpersistence%2FExternalDatabase.java;fp=test%2Fenterprise%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fsupport%2Fpersistence%2FExternalDatabase.java;h=0000000000000000000000000000000000000000;hb=cb91054f35281c6fc5619f93ff71df46bf4686b9;hp=31bcf1e2e090bf2e7522b0677e557086fd1728d0;hpb=dec278a67997ea8e85d10662e31548afd8890ed3;p=utils diff --git a/test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabase.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabase.java deleted file mode 100644 index 31bcf1e2..00000000 --- a/test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabase.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2005-2010 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wamblee.support.persistence; - - -/** - * Database that encapsulates connection to an external database. Database - * connection details can be configured through system properties and - * environment variables, see {@link #DB_URL_PROP}, {@link #DB_USER_PROP}, and - * {@link #DB_PASSWORD_PROP|. - * - * This class assumes modern database drivers that work together with - * java.util.ServiceLoader so that explicitly doing a Class.forName() is not - * necessary to load the database driver. - */ -public class ExternalDatabase extends AbstractDatabase { - - /** - * System property/environment variable that defines the database URL. - */ - public static final String DB_URL_PROP = "TEST_DB_URL"; - - /** - * System property/environment variable that defines the database user. - */ - public static final String DB_USER_PROP = "TEST_DB_USER"; - - /** - * System property/environment variable that defines the database password. - */ - public static final String DB_PASSWORD_PROP = "TEST_DB_PASSWORD"; - - private String itsUrl; - private String itsUser; - private String itsPassword; - - public ExternalDatabase() { - // Empty - } - - public String getExternalJdbcUrl() { - return itsUrl; - } - - public String getJdbcUrl() { - return itsUrl; - } - - public String getPassword() { - return itsPassword; - } - - public String getUsername() { - return itsUser; - } - - public void doStart() { - itsUrl = getProperty(DB_URL_PROP); - itsUser = getProperty(DB_USER_PROP); - itsPassword = getProperty(DB_PASSWORD_PROP); - - createDataSource(); - } - - public void doStop() { - // Empty. - } - -}