Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-08-23 12:10:09 -0400
committerrbrooks2010-08-23 12:10:09 -0400
commit4cc065a94cacb6f31ce8a315fb13ef9d4ba1bc5c (patch)
tree34f1c60f4942e4f8dff2da3f97f577e2df785dbb
parent0170ef4522ff72ed546a200ad60926d8d36b9637 (diff)
downloadorg.eclipse.osee-4cc065a94cacb6f31ce8a315fb13ef9d4ba1bc5c.tar.gz
org.eclipse.osee-4cc065a94cacb6f31ce8a315fb13ef9d4ba1bc5c.tar.xz
org.eclipse.osee-4cc065a94cacb6f31ce8a315fb13ef9d4ba1bc5c.zip
create and use Asserts.testOperation to standardize testing operations
-rw-r--r--plugins/org.eclipse.osee.framework.access.test/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/OnEditOperationTest.java14
-rw-r--r--plugins/org.eclipse.osee.framework.branch.management.test/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.osee.framework.branch.management.test/src/org/eclipse/osee/framework/branch/management/test/change/ComputeNetChangeTest.java16
-rw-r--r--plugins/org.eclipse.osee.framework.core.test/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/mocks/Asserts.java27
-rw-r--r--plugins/org.eclipse.osee.framework.lifecycle.test/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/LifecycleOperationTest.java11
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/BranchStateTest.java45
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/DatabaseIntegrityTest.java25
12 files changed, 65 insertions, 85 deletions
diff --git a/plugins/org.eclipse.osee.framework.access.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.access.test/META-INF/MANIFEST.MF
index 39eff82ef3..f03867ff34 100644
--- a/plugins/org.eclipse.osee.framework.access.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.access.test/META-INF/MANIFEST.MF
@@ -8,4 +8,5 @@ Fragment-Host: org.eclipse.osee.framework.access;bundle-version="0.9.5"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.junit4;bundle-version="4.5.0"
Export-Package: org.eclipse.osee.framework.access.test
-Import-Package: org.eclipse.osee.framework.core.model.access.exp
+Import-Package: org.eclipse.osee.framework.core.model.access.exp,
+ org.eclipse.osee.framework.core.test.mocks
diff --git a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/OnEditOperationTest.java b/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/OnEditOperationTest.java
index 89c7a5f7d9..e8e2504d9c 100644
--- a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/OnEditOperationTest.java
+++ b/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/OnEditOperationTest.java
@@ -13,12 +13,10 @@ package org.eclipse.osee.framework.access.test.internal;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.DefaultBasicArtifact;
import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.eclipse.osee.framework.core.operation.IOperation;
-import org.eclipse.osee.framework.core.operation.LogProgressMonitor;
-import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.core.test.mocks.Asserts;
import org.eclipse.osee.framework.lifecycle.AbstractLifecycleOperation;
import org.eclipse.osee.framework.lifecycle.ILifecycleService;
import org.eclipse.osee.framework.lifecycle.LifecycleServiceImpl;
@@ -35,7 +33,7 @@ import org.junit.Test;
public class OnEditOperationTest {
@Test
- public void testOperation() throws OseeCoreException {
+ public void testOperation() {
ILifecycleService service = new LifecycleServiceImpl();
// service.addHandler(ChangeMgmtChkPoint.TYPE, new ChangeMgmtHandler(new MockAccessCheckProvider()));
@@ -46,11 +44,7 @@ public class OnEditOperationTest {
IBasicArtifact<?> user = new DefaultBasicArtifact(0, "1", "user");
List<IBasicArtifact<?>> artsToChk = new ArrayList<IBasicArtifact<?>>();
artsToChk.add(new DefaultBasicArtifact(1, "2", "check me out"));
- IOperation op = new OnEditOperation(service, user, artsToChk);
- Operations.executeWork(op, new LogProgressMonitor(), -1.0);
-
- IStatus status = op.getStatus();
- Assert.assertTrue(status.isOK());
-
+ IOperation operation = new OnEditOperation(service, user, artsToChk);
+ Asserts.testOperation(operation, IStatus.OK);
}
}
diff --git a/plugins/org.eclipse.osee.framework.branch.management.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.branch.management.test/META-INF/MANIFEST.MF
index 59fb5824ac..e589ac4c8b 100644
--- a/plugins/org.eclipse.osee.framework.branch.management.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.branch.management.test/META-INF/MANIFEST.MF
@@ -7,5 +7,6 @@ Bundle-Vendor: Eclipse Open System Engineering Environment
Fragment-Host: org.eclipse.osee.framework.branch.management;bundle-version="0.4.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.junit4;bundle-version="4.5.0"
-Import-Package: org.eclipse.osee.framework.core.message.test.mocks
+Import-Package: org.eclipse.osee.framework.core.message.test.mocks,
+ org.eclipse.osee.framework.core.test.mocks
Export-Package: org.eclipse.osee.framework.branch.management.test
diff --git a/plugins/org.eclipse.osee.framework.branch.management.test/src/org/eclipse/osee/framework/branch/management/test/change/ComputeNetChangeTest.java b/plugins/org.eclipse.osee.framework.branch.management.test/src/org/eclipse/osee/framework/branch/management/test/change/ComputeNetChangeTest.java
index 1cd8eee39e..554aa005fc 100644
--- a/plugins/org.eclipse.osee.framework.branch.management.test/src/org/eclipse/osee/framework/branch/management/test/change/ComputeNetChangeTest.java
+++ b/plugins/org.eclipse.osee.framework.branch.management.test/src/org/eclipse/osee/framework/branch/management/test/change/ComputeNetChangeTest.java
@@ -19,15 +19,13 @@ import static org.eclipse.osee.framework.core.enums.ModificationType.NEW;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.osee.framework.branch.management.change.ComputeNetChangeOperation;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.message.ChangeItem;
import org.eclipse.osee.framework.core.message.ChangeVersion;
import org.eclipse.osee.framework.core.message.test.mocks.ChangeTestUtility;
-import org.eclipse.osee.framework.core.operation.IOperation;
-import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.core.test.mocks.Asserts;
import org.junit.Assert;
import org.junit.Test;
@@ -103,7 +101,7 @@ public class ComputeNetChangeTest {
for (TestData testData : data) {
items.add(testData.getItem());
}
- computeNetChange(items, IStatus.OK);
+ Asserts.testOperation(new ComputeNetChangeOperation(items), IStatus.OK);
for (int index = 0; index < data.size(); index++) {
TestData testData = data.get(index);
@@ -124,15 +122,7 @@ public class ComputeNetChangeTest {
// Source to Non-Parent commit
items.add(ChangeTestUtility.createItem(3, entry(10L, MODIFIED), null, entry(11L, MODIFIED), null, null));
- computeNetChange(items, IStatus.ERROR);
- }
-
- private void computeNetChange(List<ChangeItem> changes, int status) {
- IOperation operation = new ComputeNetChangeOperation(changes);
-
- Operations.executeWork(operation, new NullProgressMonitor(), 0);
- String message = operation.getStatus().toString();
- Assert.assertEquals(message, status, operation.getStatus().getSeverity());
+ Asserts.testOperation(new ComputeNetChangeOperation(items), IStatus.ERROR);
}
private static TestData createTest(int itemId, ChangeVersion base, ChangeVersion first, ChangeVersion current, ChangeVersion destination, ChangeVersion expected, boolean isRemoved) {
diff --git a/plugins/org.eclipse.osee.framework.core.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.core.test/META-INF/MANIFEST.MF
index dd7e82cbfa..df68f684ca 100644
--- a/plugins/org.eclipse.osee.framework.core.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.core.test/META-INF/MANIFEST.MF
@@ -7,4 +7,5 @@ Bundle-Vendor: Eclipse Open System Engineering Environment
Fragment-Host: org.eclipse.osee.framework.core;bundle-version="0.8.3"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.junit4;bundle-version="4.5.0"
-Export-Package: org.eclipse.osee.framework.core.test
+Export-Package: org.eclipse.osee.framework.core.test,
+ org.eclipse.osee.framework.core.test.mocks
diff --git a/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/mocks/Asserts.java b/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/mocks/Asserts.java
new file mode 100644
index 0000000000..0580fb3696
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.core.test/src/org/eclipse/osee/framework/core/test/mocks/Asserts.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.framework.core.test.mocks;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.operation.Operations;
+import org.junit.Assert;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public final class Asserts {
+ public static void testOperation(IOperation operation, int expectedSeverity) {
+ Operations.executeWork(operation, new NullProgressMonitor(), -1);
+ String message = operation.getStatus().toString();
+ Assert.assertEquals(message, expectedSeverity, operation.getStatus().getSeverity());
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.lifecycle.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.lifecycle.test/META-INF/MANIFEST.MF
index 8ba26a554c..633f069fe2 100644
--- a/plugins/org.eclipse.osee.framework.lifecycle.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.lifecycle.test/META-INF/MANIFEST.MF
@@ -8,3 +8,4 @@ Fragment-Host: org.eclipse.osee.framework.lifecycle;bundle-version="0.9.5"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.junit4
Export-Package: org.eclipse.osee.framework.lifecycle.test
+Import-Package: org.eclipse.osee.framework.core.test.mocks
diff --git a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/LifecycleOperationTest.java b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/LifecycleOperationTest.java
index 3f3966676c..d8c795947a 100644
--- a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/LifecycleOperationTest.java
+++ b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/LifecycleOperationTest.java
@@ -14,14 +14,12 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.operation.IOperation;
-import org.eclipse.osee.framework.core.operation.LogProgressMonitor;
-import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.core.test.mocks.Asserts;
import org.eclipse.osee.framework.lifecycle.AbstractLifecycleOperation;
import org.eclipse.osee.framework.lifecycle.ILifecycleService;
import org.eclipse.osee.framework.lifecycle.LifecycleServiceImpl;
import org.eclipse.osee.framework.lifecycle.test.mock.MockHandler;
import org.eclipse.osee.framework.lifecycle.test.mock.StrictMockLifecycePoint;
-import org.junit.Assert;
import org.junit.Test;
/**
@@ -38,11 +36,8 @@ public class LifecycleOperationTest {
service.addHandler(StrictMockLifecycePoint.TYPE, new MockHandler());
- IOperation op = new MockLifecycleOperation(service, "a string", "b string");
- Operations.executeWork(op, new LogProgressMonitor(), -1.0);
-
- IStatus status = op.getStatus();
- Assert.assertTrue(status.isOK());
+ IOperation operation = new MockLifecycleOperation(service, "a string", "b string");
+ Asserts.testOperation(operation, IStatus.OK);
}
private static class MockLifecycleOperation extends AbstractLifecycleOperation {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF
index 31d40ad6c9..10b16ef2ec 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF
@@ -21,6 +21,7 @@ Import-Package: org.apache.commons.lang;version="2.4.0",
org.eclipse.osee.framework.core.client,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.model.test.mocks,
+ org.eclipse.osee.framework.core.test.mocks,
org.eclipse.osee.framework.jdk.core.util,
org.eclipse.osee.framework.skynet.core.event
Bundle-Vendor: Eclipse Open System Engineering Environment
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/BranchStateTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/BranchStateTest.java
index 957806d002..92223d7b60 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/BranchStateTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/BranchStateTest.java
@@ -18,7 +18,6 @@ import java.util.Collection;
import junit.framework.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
import org.eclipse.osee.framework.core.data.SystemUser;
@@ -27,7 +26,8 @@ import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.test.mocks.Asserts;
import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -35,6 +35,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.artifact.PurgeArtifacts;
import org.eclipse.osee.framework.skynet.core.artifact.operation.FinishUpdateBranchOperation;
+import org.eclipse.osee.framework.skynet.core.artifact.operation.UpdateBranchOperation;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.artifact.update.ConflictResolverOperation;
import org.eclipse.osee.framework.skynet.core.conflict.ConflictManagerExternal;
@@ -170,8 +171,8 @@ public class BranchStateTest {
}
};
- Job job = BranchManager.updateBranch(workingBranch, resolverOperation);
- job.join();
+ IOperation operation = new UpdateBranchOperation(workingBranch, resolverOperation);
+ Asserts.testOperation(operation, IStatus.OK);
Assert.assertEquals(BranchState.DELETED, workingBranch.getBranchState());
Assert.assertEquals(user.getArtId(), BranchManager.getAssociatedArtifact(workingBranch).getArtId());
@@ -225,10 +226,9 @@ public class BranchStateTest {
}
};
- Job job = BranchManager.updateBranch(workingBranch, resolverOperation);
- job.join();
- assertTrue("UpdateBranch was not successful", job.getResult().isOK());
- assertTrue("Resolver was executed", !resolverOperation.wasExecuted());
+ IOperation operation = new UpdateBranchOperation(workingBranch, resolverOperation);
+ Asserts.testOperation(operation, IStatus.OK);
+ assertFalse("Resolver was executed", resolverOperation.wasExecuted());
checkBranchWasRebaselined(originalBranchName, workingBranch);
// Check that the associated artifact remained unchanged
@@ -282,13 +282,9 @@ public class BranchStateTest {
}
};
- Job job = BranchManager.updateBranch(workingBranch, resolverOperation);
- job.join();
+ IOperation operation = new UpdateBranchOperation(workingBranch, resolverOperation);
+ Asserts.testOperation(operation, IStatus.OK);
- IStatus status = getCauseStatus(job.getResult());
- String message =
- String.format("UpdateBranch was not successful\n %s", status.getMessage(), status.getException());
- assertTrue(message, job.getResult().isOK());
assertTrue("Resolver not executed", resolverOperation.wasExecuted());
assertTrue("Branch was archived", !workingBranch.getArchiveState().isArchived());
@@ -314,12 +310,7 @@ public class BranchStateTest {
// Run FinishBranchUpdate and check
FinishUpdateBranchOperation finishUpdateOperation =
new FinishUpdateBranchOperation(resolverOperation.getConflictManager(), true, true);
- Operations.executeWork(finishUpdateOperation, new NullProgressMonitor(), -1);
-
- IStatus status1 = getCauseStatus(finishUpdateOperation.getStatus());
- message =
- String.format("FinishUpdateBranch was not successful\n %s", status1.getMessage(), status1.getException());
- assertTrue(message, status1.isOK());
+ Asserts.testOperation(finishUpdateOperation, IStatus.OK);
checkBranchWasRebaselined(originalBranchName, workingBranch);
@@ -341,20 +332,6 @@ public class BranchStateTest {
}
}
- private IStatus getCauseStatus(IStatus status) {
- IStatus toReturn = status;
- if (!status.isOK() && status.isMultiStatus()) {
- for (IStatus child : status.getChildren()) {
- Throwable error = child.getException();
- if (error != null) {
- toReturn = child;
- break;
- }
- }
- }
- return toReturn;
- }
-
private void cleanup(String originalBranchName, Branch workingBranch, Branch mergeBranch, Artifact... toDelete) {
try {
if (mergeBranch != null) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.ui.skynet.test/META-INF/MANIFEST.MF
index 5ff5386aba..7c3746b861 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/META-INF/MANIFEST.MF
@@ -12,6 +12,7 @@ Import-Package: com.lowagie.text.pdf;version="2.1.7",
org.eclipse.osee.framework.access,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.model.test.mocks,
+ org.eclipse.osee.framework.core.test.mocks,
org.eclipse.osee.framework.jdk.core.util.windows,
org.eclipse.osee.framework.skynet.core.test.util,
org.eclipse.osee.support.test.util,
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/DatabaseIntegrityTest.java b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/DatabaseIntegrityTest.java
index a0c3689e6f..f89d786a8d 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/DatabaseIntegrityTest.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/cases/DatabaseIntegrityTest.java
@@ -11,13 +11,11 @@
package org.eclipse.osee.framework.ui.skynet.test.cases;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.core.test.mocks.Asserts;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.ui.skynet.dbHealth.DatabaseHealthOperation;
import org.eclipse.osee.framework.ui.skynet.dbHealth.DatabaseHealthOpsExtensionManager;
@@ -42,23 +40,16 @@ public class DatabaseIntegrityTest {
@Test
@Ignore
public void testDatabaseIntegrity() {
- try {
- DatabaseHealthOperation operation = DatabaseHealthOpsExtensionManager.getVerifyOperationByName(operationId);
+ DatabaseHealthOperation operation = DatabaseHealthOpsExtensionManager.getVerifyOperationByName(operationId);
- assertNotNull(operation);
+ assertNotNull(operation);
- operation.setFixOperationEnabled(false);
- Operations.executeWork(operation, new NullProgressMonitor(), -1);
- assertEquals(String.format("Error [%s]: [%s]", operation.getName(), operation.getStatus().getMessage()),
- IStatus.OK, operation.getStatus().getSeverity());
-
- int totalItemsToFix = operation.getItemsToFixCount();
- assertEquals(String.format("Error [%s]: found [%s] items", operation.getName(), totalItemsToFix), 0,
- totalItemsToFix);
- } catch (Exception ex) {
- assertFalse(ex.getLocalizedMessage(), false);
- }
+ operation.setFixOperationEnabled(false);
+ Asserts.testOperation(operation, IStatus.OK);
+ int totalItemsToFix = operation.getItemsToFixCount();
+ assertEquals(String.format("Error [%s]: found [%s] items", operation.getName(), totalItemsToFix), 0,
+ totalItemsToFix);
}
@Parameters

Back to the top