Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn F. Cook2011-08-02 16:05:40 -0400
committerRyan D. Brooks2011-08-02 16:05:40 -0400
commitdad30d551e147defe4d124ec94b7c6aa704b08cf (patch)
treedf00bdb845c0acdda98346d6650f1b25c749ad25 /plugins/org.eclipse.osee.framework.skynet.core.test
parenta75fa5b6a515a19ae050b72a1d53ce1abc8b40c8 (diff)
downloadorg.eclipse.osee-dad30d551e147defe4d124ec94b7c6aa704b08cf.tar.gz
org.eclipse.osee-dad30d551e147defe4d124ec94b7c6aa704b08cf.tar.xz
org.eclipse.osee-dad30d551e147defe4d124ec94b7c6aa704b08cf.zip
refinement[bgz_350331]: Migrate PurgeTransactionBlam to server side command line
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core.test')
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeTransactionTest.java5
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/TransactionEventTest.java27
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/DeletionTest.java4
3 files changed, 8 insertions, 28 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeTransactionTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeTransactionTest.java
index 74c44e80bc3..15834d9eebf 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeTransactionTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeTransactionTest.java
@@ -24,10 +24,10 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.test.mocks.Asserts;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
-import org.eclipse.osee.framework.skynet.core.internal.Activator;
import org.eclipse.osee.framework.skynet.core.mocks.DbTestUtil;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.util.FrameworkTestUtil;
+import org.eclipse.osee.framework.skynet.core.utility.PurgeTransactionOperationWithListener;
import org.eclipse.osee.support.test.util.DemoSawBuilds;
import org.eclipse.osee.support.test.util.TestUtil;
@@ -98,8 +98,7 @@ public class PurgeTransactionTest {
}
private void purge(int transactionId, Map<String, Integer> dbCount) throws Exception {
- IOperation operation =
- new PurgeTransactionOperation(Activator.getInstance().getOseeDatabaseService(), true, transactionId);
+ IOperation operation = PurgeTransactionOperationWithListener.getPurgeTransactionOperation(true, transactionId);
Asserts.testOperation(operation, IStatus.OK);
DbTestUtil.getTableRowCounts(dbCount, tables);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/TransactionEventTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/TransactionEventTest.java
index 310374866d6..f843d22c118 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/TransactionEventTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/event/TransactionEventTest.java
@@ -13,25 +13,21 @@ package org.eclipse.osee.framework.skynet.core.event;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
-import org.eclipse.osee.framework.core.enums.CoreBranches;
-import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidArtifact;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.test.mocks.Asserts;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
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.PurgeTransactionOperation;
import org.eclipse.osee.framework.skynet.core.event.model.Sender;
import org.eclipse.osee.framework.skynet.core.event.model.TransactionChange;
import org.eclipse.osee.framework.skynet.core.event.model.TransactionEvent;
import org.eclipse.osee.framework.skynet.core.event.model.TransactionEventType;
-import org.eclipse.osee.framework.skynet.core.internal.Activator;
import org.eclipse.osee.framework.skynet.core.mocks.MockTransactionEventListener;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.skynet.core.utility.PurgeTransactionOperationWithListener;
import org.eclipse.osee.support.test.util.TestUtil;
import org.junit.After;
import org.junit.Assert;
@@ -110,8 +106,7 @@ public abstract class TransactionEventTest {
Assert.assertEquals(1, OseeEventManager.getNumberOfListeners());
// Delete it
- IOperation operation =
- new PurgeTransactionOperation(Activator.getInstance().getOseeDatabaseService(), false, transIdToDelete);
+ IOperation operation = PurgeTransactionOperationWithListener.getPurgeTransactionOperation(false, transIdToDelete);
Asserts.testOperation(operation, IStatus.OK);
// Verify that all stuff reverted
@@ -124,22 +119,8 @@ public abstract class TransactionEventTest {
Assert.assertEquals(TransactionEventType.Purged, resultTransEvent.getEventType());
- Collection<TransactionChange> transactions = resultTransEvent.getTransactions();
- Assert.assertEquals(1, transactions.size());
-
- TransactionChange transChange = transactions.iterator().next();
- Assert.assertEquals(transIdToDelete, transChange.getTransactionId());
- Assert.assertEquals(CoreBranches.COMMON.getGuid(), transChange.getBranchGuid());
-
- Collection<DefaultBasicGuidArtifact> artifacts = transChange.getArtifacts();
- Assert.assertEquals(1, artifacts.size());
-
- DefaultBasicGuidArtifact guidArt = artifacts.iterator().next();
-
- Assert.assertEquals(CoreBranches.COMMON.getGuid(), guidArt.getBranchGuid());
- Assert.assertEquals(newArt.getGuid(), guidArt.getGuid());
-
- Assert.assertEquals(CoreArtifactTypes.GeneralData.getGuid(), guidArt.getArtTypeGuid());
+ Collection<TransactionChange> transactionChanges = resultTransEvent.getTransactionChanges();
+ Assert.assertTrue(transactionChanges.isEmpty());
TestUtil.severeLoggingEnd(monitorLog, (isRemoteTest() ? Arrays.asList("") : new ArrayList<String>()));
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/DeletionTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/DeletionTest.java
index 21d8d312601..651fddc2ba5 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/DeletionTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/DeletionTest.java
@@ -32,9 +32,9 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
-import org.eclipse.osee.framework.skynet.core.artifact.PurgeTransactionOperation;
import org.eclipse.osee.framework.skynet.core.internal.Activator;
import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
+import org.eclipse.osee.framework.skynet.core.utility.PurgeTransactionOperationWithListener;
import org.junit.Before;
/**
@@ -170,7 +170,7 @@ public class DeletionTest {
if (DELETE_TRANSACTION_TEST) {
IOseeDatabaseServiceProvider databaseProvider = Activator.getInstance();
IOperation operation =
- new PurgeTransactionOperation(databaseProvider.getOseeDatabaseService(), true, deletionTransaction);
+ PurgeTransactionOperationWithListener.getPurgeTransactionOperation(true, deletionTransaction);
Asserts.testOperation(operation, IStatus.OK);
if (DEBUG) {
System.err.println("Deleting the Transaction");

Back to the top