Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/test/cases/AtsValidateAtsDatabaseTest.java')
-rw-r--r--plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/test/cases/AtsValidateAtsDatabaseTest.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/test/cases/AtsValidateAtsDatabaseTest.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/test/cases/AtsValidateAtsDatabaseTest.java
new file mode 100644
index 00000000000..edf1bad4e0b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/test/cases/AtsValidateAtsDatabaseTest.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.test.cases;
+
+import static org.junit.Assert.fail;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.osee.ats.config.AtsBulkLoad;
+import org.eclipse.osee.ats.health.ValidateAtsDatabase;
+import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
+import org.eclipse.osee.framework.ui.skynet.results.XResultData;
+import org.eclipse.osee.support.test.util.TestUtil;
+
+/**
+ * This test runs the validate ats database check against whatever database is run against.
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsValidateAtsDatabaseTest {
+
+ public AtsValidateAtsDatabaseTest() {
+ AtsBulkLoad.run(true);
+ }
+
+ @org.junit.Test
+ public void testValidateAtsDatabase() throws Exception {
+ SevereLoggingMonitor monitorLog = TestUtil.severeLoggingStart();
+
+ ValidateAtsDatabase validateAtsDatabase = new ValidateAtsDatabase(null);
+ XResultData rd = new XResultData();
+ validateAtsDatabase.setFixAssignees(false);
+ validateAtsDatabase.setFixAttributeValues(false);
+ validateAtsDatabase.runIt(null, rd);
+ Matcher m = Pattern.compile("Error:.*$").matcher(rd.getReport("").getManipulatedHtml());
+ while (m.find()) {
+ fail(m.group());
+ }
+
+ TestUtil.severeLoggingEnd(monitorLog);
+ }
+
+}

Back to the top