modules/enterprise/gui/installer-war/pom.xml | 9 +-- modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallationTest.java | 25 ++++++---- 2 files changed, 20 insertions(+), 14 deletions(-)
New commits: commit bfa42ba7f59974382e9c79f652926327f3efc28e Author: Stefan Negrea snegrea@redhat.com Date: Thu Jan 26 15:23:25 2012 -0600
Add code to reset and reinstall the database after an overwrite or upgrade test is run.
diff --git a/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallationTest.java b/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallationTest.java index 6633cb7..e4fb711 100644 --- a/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallationTest.java +++ b/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallationTest.java @@ -27,6 +27,7 @@ import java.io.File; import java.net.URL; import java.util.Properties;
+import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test;
@@ -67,6 +68,12 @@ public class DBInstallationTest { installer.setLogDirectory(new File(LOG_DIRECTORY)); }
+ @AfterMethod + public void afterInstallation() throws Exception { + recreateTestDatabase(); + installer.createNewDatabaseSchema(getInstallProperties()); + } + @Test public void overwriteJON230Schema() throws Exception { installSchemaAndData("2.3.0");
commit 3f948097a57f7d20105474f2d2cc9a0e6e9dd892 Author: Stefan Negrea snegrea@redhat.com Date: Thu Jan 26 11:03:40 2012 -0600
Revert "DBInstallationTest needs to use its own dedicated database"
This reverts commit cf001e9bc410896e57b7767164711fd8f819ccd8.
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index bd1474a..7f79832 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -35,8 +35,6 @@ <product.help.guide.agent>Running+the+RHQ+Agent</product.help.guide.agent> <product.help.FAQ>FAQ</product.help.FAQ> <product.help.config.props>http://support.rhq-project.org/display/JOPR2/Startup+Properties#Configuringt...</product.help.config.props> - - <rhq.db.installation.test.db-name>rhq_installer_test_db</rhq.db.installation.test.db-name> </properties>
<dependencies> @@ -151,8 +149,6 @@ <rhq.db.admin.password>${rhq.db.admin.password}</rhq.db.admin.password> <rhq.test.ds.user-name>${rhq.test.ds.user-name}</rhq.test.ds.user-name> <rhq.test.ds.password>${rhq.test.ds.password}</rhq.test.ds.password> - <rhq.db.installation.test.db-name>${rhq.db.installation.test.db-name}</rhq.db.installation.test.db-name> - <rhq.db.installation.test.connection-url>jdbc:postgresql://${rhq.test.ds.server-name}:5432/${rhq.db.installation.test.db-name}</rhq.db.installation.test.connection-url> </systemPropertyVariables> </configuration> </plugin> diff --git a/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallationTest.java b/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallationTest.java index 3bff054..6633cb7 100644 --- a/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallationTest.java +++ b/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallationTest.java @@ -23,15 +23,18 @@
package org.rhq.enterprise.installer;
-import org.rhq.core.db.reset.DBReset; -import org.rhq.core.db.setup.DBSetup; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - import java.io.File; import java.net.URL; import java.util.Properties;
+import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import org.rhq.core.db.reset.DBReset; +import org.rhq.core.db.setup.DBSetup; +import org.rhq.enterprise.installer.ServerInformation; +import org.rhq.enterprise.installer.ServerProperties; + /** * The tests in this class exercise the dbsetup/dbupgrade code that is run in the installer. The tests currently only * run against postgresql. Support needs to be added for oracle. The tests do not do any post-install/upgrade @@ -43,12 +46,12 @@ import java.util.Properties; public class DBInstallationTest {
private final String LOG_DIRECTORY = System.getProperty("java.io.tmpdir", "rhq/installer-test"); - private final String DB_NAME = System.getProperty("rhq.db.installation.test.db-name", "rhq_installer_test_db"); + private final String DB_NAME = System.getProperty("rhq.test.ds.db-name", "rhq_installer_test_db"); private final String USERNAME = System.getProperty("rhq.test.ds.user-name", "rhqadmin"); private final String PASSWORD = System.getProperty("rhq.test.ds.password", "rhqadmin"); private final String SERVER = System.getProperty("rhq.test.ds.server-name", "127.0.0.1"); - private final String DB_URL = System.getProperty("rhq.db.installation.test.connection-url", - "jdbc:postgresql://" + SERVER + ":5432/" + DB_NAME); + private final String DB_URL = System.getProperty("rhq.test.ds.connection-url", "jdbc:postgresql://" + SERVER + + ":5432/" + DB_NAME); private final String ADMIN_USERNAME = System.getProperty("rhq.db.admin.username", "postgres"); private final String ADMIN_PASSWORD = System.getProperty("rhq.db.admin.password", "postgres"); private static final String DB_TYPE_MAPPING = System.getProperty("rhq.test.ds.type-mapping", "PostgreSQL");
commit c1aa992c86006933eb955dc6d90ff9728f897863 Author: Stefan Negrea snegrea@redhat.com Date: Thu Jan 26 11:02:28 2012 -0600
Revert "Updating the installer test to:"
This reverts commit 842ad5f20b752884d19e55d8f87e0e7252f78154.
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index c1dd476..bd1474a 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -145,13 +145,14 @@ <systemPropertyVariables> <rhq.test.ds.type-mapping>${rhq.test.ds.type-mapping}</rhq.test.ds.type-mapping> <rhq.test.ds.server-name>${rhq.test.ds.server-name}</rhq.test.ds.server-name> - <rhq.test.ds.port>${rhq.test.ds.port}</rhq.test.ds.port> - <rhq.db.installation.test.db-name>${rhq.db.installation.test.db-name}</rhq.db.installation.test.db-name> + <rhq.test.ds.db-name>${rhq.test.ds.db-name}</rhq.test.ds.db-name> <rhq.test.ds.connection-url>${rhq.test.ds.connection-url}</rhq.test.ds.connection-url> <rhq.db.admin.username>${rhq.db.admin.username}</rhq.db.admin.username> <rhq.db.admin.password>${rhq.db.admin.password}</rhq.db.admin.password> <rhq.test.ds.user-name>${rhq.test.ds.user-name}</rhq.test.ds.user-name> <rhq.test.ds.password>${rhq.test.ds.password}</rhq.test.ds.password> + <rhq.db.installation.test.db-name>${rhq.db.installation.test.db-name}</rhq.db.installation.test.db-name> + <rhq.db.installation.test.connection-url>jdbc:postgresql://${rhq.test.ds.server-name}:5432/${rhq.db.installation.test.db-name}</rhq.db.installation.test.connection-url> </systemPropertyVariables> </configuration> </plugin> @@ -340,8 +341,8 @@ <id>oracle</id> <activation> <property> - <name>rhq.test.ds.type-mapping</name> - <value>Oracle10g</value> + <name>rhq.test.db.type</name> + <value>oracle</value> </property> </activation> <build> diff --git a/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallationTest.java b/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallationTest.java index 81c5664..3bff054 100644 --- a/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallationTest.java +++ b/modules/enterprise/gui/installer-war/src/test/java/org/rhq/enterprise/installer/DBInstallationTest.java @@ -47,9 +47,8 @@ public class DBInstallationTest { private final String USERNAME = System.getProperty("rhq.test.ds.user-name", "rhqadmin"); private final String PASSWORD = System.getProperty("rhq.test.ds.password", "rhqadmin"); private final String SERVER = System.getProperty("rhq.test.ds.server-name", "127.0.0.1"); - private final String PORT = System.getProperty("rhq.test.ds.port", "5432"); - private final String DB_URL = System.getProperty("rhq.test.ds.connection-url", "jdbc:postgresql://" + SERVER - + ":" + PORT + "/" + DB_NAME); + private final String DB_URL = System.getProperty("rhq.db.installation.test.connection-url", + "jdbc:postgresql://" + SERVER + ":5432/" + DB_NAME); private final String ADMIN_USERNAME = System.getProperty("rhq.db.admin.username", "postgres"); private final String ADMIN_PASSWORD = System.getProperty("rhq.db.admin.password", "postgres"); private static final String DB_TYPE_MAPPING = System.getProperty("rhq.test.ds.type-mapping", "PostgreSQL");