Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan E. Cook2016-08-26 20:24:59 +0000
committerAngel Avila2016-08-26 20:24:59 +0000
commitf4a3c0c693eb48852e8653f2e37ffd90bbaf9b7f (patch)
treeadfd03fb89541c693bd385ce7859cd19106039b2
parent98a1abc0aa4d82e9da671bc0d3baa782fc8b3dd3 (diff)
downloadorg.eclipse.osee-f4a3c0c693eb48852e8653f2e37ffd90bbaf9b7f.tar.gz
org.eclipse.osee-f4a3c0c693eb48852e8653f2e37ffd90bbaf9b7f.tar.xz
org.eclipse.osee-f4a3c0c693eb48852e8653f2e37ffd90bbaf9b7f.zip
refactor: Fix loading hard deleted and artifact deleted
Change-Id: I5d2564bf1f10a27981356db59d8cbca3f091b4af Signed-off-by: Morgan E. Cook <Morgan.e.cook@boeing.com>
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IRelationResolver.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsRelationResolverServiceImpl.java10
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsRelationResolverServiceImpl.java10
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java2
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/OseeLinkBuilder.java2
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/DeletionFlag.java1
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/ModificationType.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeCollectionTest.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java17
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/AttributeReadOnlyImplTest.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacenciesTest.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicatesTest.java14
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java25
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/AttributeReadOnlyImpl.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java19
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java12
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java2
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/HasDeleteState.java9
28 files changed, 153 insertions, 74 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IRelationResolver.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IRelationResolver.java
index 81d5e07b52..39438afdb7 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IRelationResolver.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IRelationResolver.java
@@ -16,6 +16,7 @@ import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
+import org.eclipse.osee.framework.core.enums.DeletionFlag;
/**
* @author Donald G. Dunne
@@ -26,6 +27,8 @@ public interface IRelationResolver {
<T extends IAtsObject> Collection<T> getRelated(IAtsObject atsObject, IRelationTypeSide relationType, Class<T> clazz);
+ <T extends IAtsObject> Collection<T> getRelated(IAtsObject atsObject, IRelationTypeSide relationType, DeletionFlag flag, Class<T> clazz);
+
boolean areRelated(ArtifactId artifact1, IRelationTypeSide relationType, ArtifactId artifact2);
boolean areRelated(IAtsObject atsObject1, IRelationTypeSide relationType, IAtsObject atsObject2);
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsRelationResolverServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsRelationResolverServiceImpl.java
index 17957c50ad..e685dfbd3d 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsRelationResolverServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsRelationResolverServiceImpl.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.ats.api.workdef.IRelationResolver;
import org.eclipse.osee.ats.core.client.IAtsClient;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
+import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -47,13 +48,18 @@ public class AtsRelationResolverServiceImpl implements IRelationResolver {
return results;
}
- @SuppressWarnings("unchecked")
@Override
public <T extends IAtsObject> Collection<T> getRelated(IAtsObject atsObject, IRelationTypeSide relationType, Class<T> clazz) {
+ return getRelated(atsObject, relationType, DeletionFlag.EXCLUDE_DELETED, clazz);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T extends IAtsObject> Collection<T> getRelated(IAtsObject atsObject, IRelationTypeSide relationType, DeletionFlag flag, Class<T> clazz) {
List<T> results = new ArrayList<>();
Artifact useArt = getArtifact(atsObject);
if (useArt != null) {
- for (Artifact art : useArt.getRelatedArtifacts(relationType)) {
+ for (Artifact art : useArt.getRelatedArtifacts(relationType, flag)) {
IAtsObject object = getAtsObject(art);
if (object != null) {
results.add((T) object);
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsRelationResolverServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsRelationResolverServiceImpl.java
index ac1cb4e12b..de32465427 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsRelationResolverServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsRelationResolverServiceImpl.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.ats.api.workdef.IRelationResolver;
import org.eclipse.osee.ats.rest.IAtsServer;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
+import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -51,13 +52,18 @@ public class AtsRelationResolverServiceImpl implements IRelationResolver {
return results;
}
- @SuppressWarnings("unchecked")
@Override
public <T extends IAtsObject> Collection<T> getRelated(IAtsObject atsObject, IRelationTypeSide relationType, Class<T> clazz) {
+ return getRelated(atsObject, relationType, DeletionFlag.EXCLUDE_DELETED, clazz);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T extends IAtsObject> Collection<T> getRelated(IAtsObject atsObject, IRelationTypeSide relationType, DeletionFlag flag, Class<T> clazz) {
List<T> results = new ArrayList<>();
ArtifactReadable useArt = getArtifact(atsObject);
if (useArt != null) {
- for (ArtifactReadable art : useArt.getRelated(relationType)) {
+ for (ArtifactReadable art : useArt.getRelated(relationType, flag)) {
IAtsObject object = getAtsObject(art);
if (object != null) {
results.add((T) object);
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java
index b94944d527..cd85659c2f 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java
@@ -75,7 +75,7 @@ public class AtsStoreServiceImpl implements IAtsStoreService {
@Override
public boolean isDeleted(IAtsObject atsObject) {
- return ((ArtifactReadable) atsObject.getStoreObject()).isHardDeleted();
+ return ((ArtifactReadable) atsObject.getStoreObject()).isDeleted();
}
@Override
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/OseeLinkBuilder.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/OseeLinkBuilder.java
index 8f20a894ae..a67f2acb64 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/OseeLinkBuilder.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/OseeLinkBuilder.java
@@ -172,7 +172,7 @@ public class OseeLinkBuilder {
}
builder.append(artifact.getName());
}
- if (artifact.isHardDeleted()) {
+ if (artifact.isDeleted()) {
builder.append(" (DELETED)");
}
return escapeXml(builder.toString());
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
index 88c2f52be9..4ea48f7f67 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/WordUpdateArtifact.java
@@ -116,7 +116,7 @@ public class WordUpdateArtifact {
ArtifactReadable artifact = getArtifact(data.getBranch(), extractorData.getGuid());
WordArtifactChange artChange = new WordArtifactChange();
artChange.setArtId(artifact.getLocalId());
- if (artifact.isHardDeleted()) {
+ if (artifact.isDeleted()) {
deletedArtifacts.add(artifact.getName());
} else {
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/DeletionFlag.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/DeletionFlag.java
index c5178dbeb6..a78f370eff 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/DeletionFlag.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/DeletionFlag.java
@@ -16,6 +16,7 @@ package org.eclipse.osee.framework.core.enums;
public enum DeletionFlag {
INCLUDE_DELETED,
+ INCLUDE_HARD_DELETED,
EXCLUDE_DELETED;
public boolean areDeletedAllowed() {
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/ModificationType.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/ModificationType.java
index aa06fb6ece..ab2d855460 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/ModificationType.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/ModificationType.java
@@ -112,6 +112,11 @@ public enum ModificationType {
return this == UNDELETED;
}
+ // Returns true if attribute or relation was deleted from an artifact deletion
+ public boolean isArtifactDeleted() {
+ return this == ARTIFACT_DELETED;
+ }
+
// Returns false for attributes and relations if artifact was deleted but the attribute or relation was not deleted
public boolean isHardDeleted() {
return this == DELETED;
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
index 5b4fff4190..5bb3f21904 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
@@ -103,7 +103,8 @@ public class ArtifactTest {
when(artifactData.getLocalId()).thenReturn(0);
when(version.getBranchId()).thenReturn(55L);
- when(deleted.isHardDeleted()).thenReturn(true);
+ when(deleted.getModificationType()).thenReturn(ModificationType.ARTIFACT_DELETED);
+ when(deleted.isDeleted()).thenReturn(true);
when(notDeleted.getOrcsData()).thenReturn(attributeData);
when(deleted.getOrcsData()).thenReturn(attributeData);
when(differentType.getOrcsData()).thenReturn(attributeData);
@@ -257,7 +258,7 @@ public class ArtifactTest {
for (ModificationType modType : ModificationType.values()) {
reset(artifactData);
when(artifactData.getModType()).thenReturn(modType);
- Assert.assertEquals(modType.isHardDeleted(), artifact.isHardDeleted());
+ Assert.assertEquals(modType.isDeleted(), artifact.isDeleted());
}
}
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeCollectionTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeCollectionTest.java
index 780b10ed4c..56861e71b5 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeCollectionTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeCollectionTest.java
@@ -21,6 +21,7 @@ import java.util.List;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
+import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.type.AttributeType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
@@ -56,7 +57,11 @@ public class AttributeCollectionTest {
attributeCollection.add(CoreAttributeTypes.Annotation, deletedAttr);
when(dirtyAttr.isDirty()).thenReturn(true);
- when(deletedAttr.isHardDeleted()).thenReturn(true);
+ when(deletedAttr.isDeleted()).thenReturn(true);
+
+ when(dirtyAttr.getModificationType()).thenReturn(ModificationType.MODIFIED);
+ when(cleanAttr.getModificationType()).thenReturn(ModificationType.NEW);
+ when(deletedAttr.getModificationType()).thenReturn(ModificationType.ARTIFACT_DELETED);
}
@Test
@@ -93,13 +98,13 @@ public class AttributeCollectionTest {
AttributeType typeC = mock(AttributeType.class);
when(dirtyAttr.getAttributeType()).thenReturn(typeA);
- when(dirtyAttr.isHardDeleted()).thenReturn(true);
+ when(dirtyAttr.isDeleted()).thenReturn(true);
when(cleanAttr.getAttributeType()).thenReturn(typeB);
- when(cleanAttr.isHardDeleted()).thenReturn(true);
+ when(cleanAttr.isDeleted()).thenReturn(true);
when(deletedAttr.getAttributeType()).thenReturn(typeC);
- when(deletedAttr.isHardDeleted()).thenReturn(false);
+ when(deletedAttr.isDeleted()).thenReturn(false);
Collection<? extends IAttributeType> types = attributeCollection.getExistingTypes(DeletionFlag.INCLUDE_DELETED);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java
index ca8ba3da17..24030f515c 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImplTest.java
@@ -38,6 +38,8 @@ import org.eclipse.osee.framework.core.data.IRelationTypeSide;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.enums.DeletionFlag;
+import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.type.ResultSets;
@@ -156,12 +158,14 @@ public class ArtifactReadOnlyImplTest {
@Test
public void testIsDeleted() {
- when(proxiedObject.isHardDeleted()).thenReturn(true);
+ when(proxiedObject.getModificationType()).thenReturn(ModificationType.DELETED);
+ when(proxiedObject.isDeleted()).thenReturn(true);
- boolean actual = readOnly.isHardDeleted();
+ boolean actual = readOnly.isDeleted();
assertEquals(true, actual);
- verify(proxiedObject).isHardDeleted();
+
+ verify(proxiedObject).isDeleted();
}
@Test
@@ -360,14 +364,15 @@ public class ArtifactReadOnlyImplTest {
ResultSet<ArtifactReadable> expected = ResultSets.singleton(readable1);
ResultSet<Artifact> resultSet1 = ResultSets.singleton(artifact1);
- when(relationManager.getRelated(session, DEFAULT_HIERARCHY, proxiedObject, IS_CHILD)).thenAnswer(
- answer(resultSet1));
+ when(relationManager.getRelated(session, DEFAULT_HIERARCHY, proxiedObject, IS_CHILD,
+ DeletionFlag.EXCLUDE_DELETED)).thenAnswer(answer(resultSet1));
when(proxyManager.asExternalArtifacts(session, resultSet1)).thenReturn(expected);
ResultSet<ArtifactReadable> actual = readOnly.getRelated(Default_Hierarchical__Parent);
assertEquals(expected, actual);
- verify(relationManager).getRelated(session, DEFAULT_HIERARCHY, proxiedObject, IS_CHILD);
+ verify(relationManager).getRelated(session, DEFAULT_HIERARCHY, proxiedObject, IS_CHILD,
+ DeletionFlag.EXCLUDE_DELETED);
verify(proxyManager).asExternalArtifacts(session, resultSet1);
}
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/AttributeReadOnlyImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/AttributeReadOnlyImplTest.java
index 678426ea53..d792ac1535 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/AttributeReadOnlyImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/proxy/impl/AttributeReadOnlyImplTest.java
@@ -125,12 +125,12 @@ public class AttributeReadOnlyImplTest {
@Test
public void testIsDeleted() {
boolean expected = true;
- when(proxiedObject.isHardDeleted()).thenReturn(expected);
+ when(proxiedObject.isDeleted()).thenReturn(expected);
- boolean actual = readOnly.isHardDeleted();
+ boolean actual = readOnly.isDeleted();
assertEquals(expected, actual);
- verify(proxiedObject).isHardDeleted();
+ verify(proxiedObject).isDeleted();
}
@Test
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java
index 47132c4f68..4e1576890d 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationManagerTest.java
@@ -33,6 +33,7 @@ import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.LoadLevel;
+import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.core.enums.RelationTypeMultiplicity;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -274,7 +275,8 @@ public class RelationManagerTest {
int actual = manager.getRelatedCount(session, DEFAULT_HIERARCHY, node1, IS_PARENT);
assertEquals(3, actual);
- when(relation2.isHardDeleted()).thenReturn(true);
+ when(relation2.getModificationType()).thenReturn(ModificationType.ARTIFACT_DELETED);
+ when(relation2.isDeleted()).thenReturn(true);
int actual2 = manager.getRelatedCount(session, DEFAULT_HIERARCHY, node1, IS_PARENT);
assertEquals(2, actual2);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java
index 8d52a15b33..7953460738 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java
@@ -127,11 +127,14 @@ public class RelationTest {
@Test
public void testIsDeleteD() {
+ when(data.getModType()).thenReturn(ModificationType.ARTIFACT_DELETED);
+ assertTrue(relation.isDeleted());
+
when(data.getModType()).thenReturn(ModificationType.DELETED);
- assertTrue(relation.isHardDeleted());
+ assertTrue(relation.isDeleted());
when(data.getModType()).thenReturn(ModificationType.MODIFIED);
- assertFalse(relation.isHardDeleted());
+ assertFalse(relation.isDeleted());
}
@Test
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java
index bba3f1c416..539a404012 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImplTest.java
@@ -665,7 +665,7 @@ public class RelationManagerImplTest {
when(container1.getRelation(node1, DEFAULT_HIERARCHY, node2, INCLUDE_DELETED)).thenReturn(null);
when(container2.getRelation(node1, DEFAULT_HIERARCHY, node2, INCLUDE_DELETED)).thenReturn(relation1);
- when(relation1.isHardDeleted()).thenReturn(true);
+ when(relation1.isDeleted()).thenReturn(true);
when(orderFactory.createOrderManager(node1)).thenReturn(orderManager1);
when(orderManager1.getSorterId(Default_Hierarchical__Child)).thenReturn(UNORDERED);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacenciesTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacenciesTest.java
index 7df839b88c..831e29c3f8 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacenciesTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationNodeAdjacenciesTest.java
@@ -24,6 +24,7 @@ import org.eclipse.osee.framework.core.data.HasLocalId;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
+import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
@@ -67,7 +68,9 @@ public class RelationNodeAdjacenciesTest {
collection.add(TYPE_3.getGuid(), deleted);
when(dirty.isDirty()).thenReturn(true);
- when(deleted.isHardDeleted()).thenReturn(true);
+
+ when(deleted.getModificationType()).thenReturn(ModificationType.ARTIFACT_DELETED);
+ when(deleted.isDeleted()).thenReturn(true);
}
@Test
@@ -104,13 +107,16 @@ public class RelationNodeAdjacenciesTest {
IRelationType typeC = mock(IRelationType.class);
when(dirty.getRelationType()).thenReturn(typeA);
- when(dirty.isHardDeleted()).thenReturn(true);
+ when(dirty.getModificationType()).thenReturn(ModificationType.ARTIFACT_DELETED);
+ when(dirty.isDeleted()).thenReturn(true);
when(clean.getRelationType()).thenReturn(typeB);
- when(clean.isHardDeleted()).thenReturn(true);
+ when(clean.getModificationType()).thenReturn(ModificationType.ARTIFACT_DELETED);
+ when(clean.isDeleted()).thenReturn(true);
when(deleted.getRelationType()).thenReturn(typeC);
- when(deleted.isHardDeleted()).thenReturn(false);
+ when(deleted.getModificationType()).thenReturn(ModificationType.MODIFIED);
+ when(deleted.isDeleted()).thenReturn(false);
Collection<? extends IRelationType> types = collection.getExistingTypes(DeletionFlag.INCLUDE_DELETED);
@@ -195,7 +201,7 @@ public class RelationNodeAdjacenciesTest {
@Test
public void testLocalIdOnSide() throws OseeCoreException {
- when(relation.isHardDeleted()).thenReturn(false);
+ when(relation.isDeleted()).thenReturn(false);
when(relation.getLocalIdForSide(RelationSide.SIDE_A)).thenReturn(11);
when(relation.getLocalIdForSide(RelationSide.SIDE_B)).thenReturn(22);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicatesTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicatesTest.java
index bd3dc70817..3e23322142 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicatesTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicatesTest.java
@@ -29,6 +29,7 @@ import com.google.common.base.Predicate;
import java.util.Date;
import java.util.regex.Pattern;
import org.eclipse.osee.framework.core.data.HasLocalId;
+import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.core.internal.attribute.Attribute;
@@ -80,8 +81,11 @@ public class OrcsPredicatesTest {
when(dirty.isDirty()).thenReturn(true);
when(notDirty.isDirty()).thenReturn(false);
- when(deleted.isHardDeleted()).thenReturn(true);
- when(notDeleted.isHardDeleted()).thenReturn(false);
+ when(deleted.getModificationType()).thenReturn(ModificationType.ARTIFACT_DELETED);
+ when(deleted.isDeleted()).thenReturn(true);
+
+ when(notDeleted.getModificationType()).thenReturn(ModificationType.NEW);
+ when(notDeleted.isDeleted()).thenReturn(false);
date = new Date();
@@ -124,8 +128,10 @@ public class OrcsPredicatesTest {
@Test
public void testDeletionFlag() {
- when(attribute1.isHardDeleted()).thenReturn(true);
- when(attribute2.isHardDeleted()).thenReturn(false);
+ when(attribute1.getModificationType()).thenReturn(ModificationType.ARTIFACT_DELETED);
+ when(attribute1.isDeleted()).thenReturn(true);
+ when(attribute2.getModificationType()).thenReturn(ModificationType.NEW);
+ when(attribute2.isDeleted()).thenReturn(false);
assertFalse(deletionFlagEquals(EXCLUDE_DELETED).apply(attribute1));
assertTrue(deletionFlagEquals(EXCLUDE_DELETED).apply(attribute2));
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
index 5d928e66db..1420477d85 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
@@ -65,7 +65,8 @@ public class ArtifactImpl extends AttributeManagerImpl implements Artifact {
objectEditState = EditState.NO_CHANGE;
}
- private ModificationType getModificationType() {
+ @Override
+ public ModificationType getModificationType() {
return getOrcsData().getModType();
}
@@ -143,11 +144,6 @@ public class ArtifactImpl extends AttributeManagerImpl implements Artifact {
}
@Override
- public boolean isHardDeleted() {
- return getModificationType().isHardDeleted();
- }
-
- @Override
public boolean isAttributeTypeValid(IAttributeType attributeType) throws OseeCoreException {
return artifactTypeCache.isValidAttributeType(getArtifactType(), getBranch(), attributeType);
}
@@ -182,7 +178,7 @@ public class ArtifactImpl extends AttributeManagerImpl implements Artifact {
@Override
public boolean isDeleteAllowed() {
- return !isHardDeleted();
+ return !isDeleted();
}
@Override
@@ -193,7 +189,7 @@ public class ArtifactImpl extends AttributeManagerImpl implements Artifact {
@Override
public boolean isAccessible() {
- return !isHardDeleted();
+ return !isDeleted();
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java
index 57101629d3..ea30cf5595 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java
@@ -238,7 +238,7 @@ public abstract class AttributeImpl<T> implements Comparable<AttributeImpl<T>>,
@Override
public boolean isDeleteAllowed() {
try {
- return !isHardDeleted() && getContainer().getAttributeCount(
+ return !isDeleted() && getContainer().getAttributeCount(
getAttributeType()) > attributeTypeCache.getMinOccurrences(getAttributeType());
} catch (OseeCoreException ex) {
return false;
@@ -285,11 +285,6 @@ public abstract class AttributeImpl<T> implements Comparable<AttributeImpl<T>>,
getOrcsData().setLocalId(attrId);
}
- @Override
- public boolean isHardDeleted() {
- return getModificationType().isHardDeleted();
- }
-
/**
* artifact.persist(); artifact.reloadAttributesAndRelations(); Will need to be called afterwards to see replaced
* data in memory
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
index 2be1a96ef6..d09e65327a 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.proxy.impl;
+import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED;
import static org.eclipse.osee.orcs.core.internal.relation.RelationUtil.asRelationType;
import java.util.ArrayList;
import java.util.Collection;
@@ -21,6 +22,7 @@ import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
+import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -188,11 +190,6 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
}
@Override
- public boolean isHardDeleted() {
- return getProxiedObject().isHardDeleted();
- }
-
- @Override
public int getMaximumRelationAllowed(IRelationTypeSide typeAndSide) throws OseeCoreException {
IRelationType type = asRelationType(typeAndSide);
RelationSide side = whichSideAmIOn(typeAndSide);
@@ -247,9 +244,15 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
@Override
public ResultSet<ArtifactReadable> getRelated(IRelationTypeSide typeAndSide) throws OseeCoreException {
+ return getRelated(typeAndSide, EXCLUDE_DELETED);
+ }
+
+ @Override
+ public ResultSet<ArtifactReadable> getRelated(IRelationTypeSide typeAndSide, DeletionFlag deletionFlag) throws OseeCoreException {
IRelationType type = asRelationType(typeAndSide);
RelationSide side = whichSideAmIOn(typeAndSide);
- ResultSet<Artifact> related = getRelationManager().getRelated(getSession(), type, getProxiedObject(), side);
+ ResultSet<Artifact> related =
+ getRelationManager().getRelated(getSession(), type, getProxiedObject(), side, deletionFlag);
return getProxyManager().asExternalArtifacts(getSession(), related);
}
@@ -288,4 +291,14 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
public Long getId() {
return Long.valueOf(getLocalId());
}
+
+ @Override
+ public boolean isDeleted() {
+ return getProxiedObject().isDeleted();
+ }
+
+ @Override
+ public ModificationType getModificationType() {
+ return getProxiedObject().getModificationType();
+ }
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/AttributeReadOnlyImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/AttributeReadOnlyImpl.java
index 2ee2841945..4ed4e06ffb 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/AttributeReadOnlyImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/AttributeReadOnlyImpl.java
@@ -38,8 +38,8 @@ public class AttributeReadOnlyImpl<T> extends AbstractProxied<Attribute<T>> impl
}
@Override
- public boolean isHardDeleted() {
- return getProxiedObject().isHardDeleted();
+ public boolean isDeleted() {
+ return getProxiedObject().isDeleted();
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java
index b600339dab..d3884b4c2f 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java
@@ -49,13 +49,14 @@ public class Relation implements HasOrcsData<RelationData>, OrcsWriteable {
return relationTypes.getByUuid(getOrcsData().getTypeUuid());
}
+ @Override
public ModificationType getModificationType() {
return getOrcsData().getModType();
}
@Override
- public boolean isHardDeleted() {
- return getModificationType().isHardDeleted();
+ public boolean isDeleted() {
+ return getModificationType().isDeleted();
}
@Override
@@ -153,7 +154,7 @@ public class Relation implements HasOrcsData<RelationData>, OrcsWriteable {
@Override
public boolean isDeleteAllowed() {
- return !isHardDeleted();
+ return !isDeleted();
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java
index 7700769b3b..ce55e2ee7d 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java
@@ -59,6 +59,8 @@ public interface RelationManager {
<T extends RelationNode> ResultSet<T> getRelated(OrcsSession session, IRelationType type, RelationNode node, RelationSide side) throws OseeCoreException;
+ <T extends RelationNode> ResultSet<T> getRelated(OrcsSession session, IRelationType type, RelationNode node, RelationSide side, DeletionFlag flag) throws OseeCoreException;
+
///////////////////////////////////////
void addChild(OrcsSession session, RelationNode parent, RelationNode child) throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
index 0de81caf9f..65741a7bb7 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
@@ -163,7 +163,12 @@ public class RelationManagerImpl implements RelationManager {
@Override
public <T extends RelationNode> ResultSet<T> getRelated(OrcsSession session, IRelationType type, RelationNode node, RelationSide side) throws OseeCoreException {
- List<Relation> links = getRelations(session, type, node, side, EXCLUDE_DELETED);
+ return getRelated(session, type, node, side, EXCLUDE_DELETED);
+ }
+
+ @Override
+ public <T extends RelationNode> ResultSet<T> getRelated(OrcsSession session, IRelationType type, RelationNode node, RelationSide side, DeletionFlag flag) throws OseeCoreException {
+ List<Relation> links = getRelations(session, type, node, side, flag);
List<T> result = null;
if (links.isEmpty()) {
result = Collections.emptyList();
@@ -242,7 +247,7 @@ public class RelationManagerImpl implements RelationManager {
graph.<RelationNodeAdjacencies> getAdjacencies(bNode).add(type.getGuid(), relation);
updated = true;
}
- if (relation.isHardDeleted()) {
+ if (relation.isDeleted()) {
relation.unDelete();
updated = true;
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java
index d93ae11e28..d78da3c3cb 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java
@@ -18,6 +18,7 @@ import static com.google.common.base.Predicates.not;
import java.util.regex.Pattern;
import org.eclipse.osee.framework.core.data.HasLocalId;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
+import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.core.internal.attribute.Attribute;
@@ -131,18 +132,26 @@ public final class OrcsPredicates {
private static class DeletedMatcher<T extends HasDeleteState> implements Predicate<T> {
- private final boolean checkNeeded;
+ DeletionFlag flag;
public DeletedMatcher(DeletionFlag includeDeleted) {
- this.checkNeeded = !includeDeleted.areDeletedAllowed();
+ flag = includeDeleted;
}
@Override
public boolean apply(T data) {
- boolean result = true;
- if (checkNeeded) {
- result = !data.isHardDeleted();
+ boolean result = false;
+ ModificationType modificationType = data.getModificationType();
+
+ if (flag == DeletionFlag.INCLUDE_HARD_DELETED) {
+ result = true;
+ } else if (flag == DeletionFlag.INCLUDE_DELETED && ModificationType.getAllNotHardDeletedTypes().contains(
+ modificationType)) {
+ result = true;
+ } else {
+ result = !data.isDeleted();
}
+
return result;
}
}
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java
index 8df8f8d4e1..a6efebfa91 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java
@@ -291,7 +291,7 @@ public class OrcsTransactionTest {
toDelete = query.fromBranch(COMMON).andIds(artifact).includeDeletedArtifacts().getResults().getOneOrNull();
assertNotNull(toDelete);
- assertTrue(toDelete.isHardDeleted());
+ assertTrue(toDelete.isDeleted());
}
@Test
@@ -332,7 +332,7 @@ public class OrcsTransactionTest {
toDelete = query.fromBranch(COMMON).andIds(artifact).includeDeletedArtifacts().getResults().getOneOrNull();
assertNotNull(toDelete);
- assertTrue(toDelete.isHardDeleted());
+ assertTrue(toDelete.isDeleted());
}
@@ -366,7 +366,7 @@ public class OrcsTransactionTest {
toDelete = query.fromBranch(COMMON).andIds(artifact1).includeDeletedArtifacts().getResults().getOneOrNull();
assertNotNull(toDelete);
- assertTrue(toDelete.isHardDeleted());
+ assertTrue(toDelete.isDeleted());
transactions = new TransactionId[] {tx1, tx2, tx3, tx4};
}
@@ -545,10 +545,10 @@ public class OrcsTransactionTest {
for (ArtifactReadable art : artifacts) {
if (artifact != null && art.matches(artifact)) {
assertEquals(1,
- art.getAttributeCount(CoreAttributeTypes.GeneralStringData, DeletionFlag.INCLUDE_DELETED));
- assertEquals(1, art.getAttributeCount(CoreAttributeTypes.PublishInline, DeletionFlag.INCLUDE_DELETED));
+ art.getAttributeCount(CoreAttributeTypes.GeneralStringData, DeletionFlag.INCLUDE_HARD_DELETED));
+ assertEquals(1, art.getAttributeCount(CoreAttributeTypes.PublishInline, DeletionFlag.INCLUDE_HARD_DELETED));
} else if (artifact1 != null && art.matches(artifact1)) {
- assertEquals(1, art.getAttributeCount(CoreAttributeTypes.Annotation, DeletionFlag.INCLUDE_DELETED));
+ assertEquals(1, art.getAttributeCount(CoreAttributeTypes.Annotation, DeletionFlag.INCLUDE_HARD_DELETED));
} else {
assertTrue("Unexpected artifact", false);
}
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
index 5cb47437a0..ca238924c2 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
@@ -94,6 +94,8 @@ public interface ArtifactReadable extends ArtifactId, HasLocalId<Integer>, HasTr
ResultSet<ArtifactReadable> getRelated(IRelationTypeSide relationTypeSide) throws OseeCoreException;
+ ResultSet<ArtifactReadable> getRelated(IRelationTypeSide relationTypeSide, DeletionFlag deletionFlag) throws OseeCoreException;
+
boolean areRelated(IRelationTypeSide typeAndSide, ArtifactReadable readable) throws OseeCoreException;
int getRelatedCount(IRelationTypeSide typeAndSide) throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/HasDeleteState.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/HasDeleteState.java
index 72faa05e12..b4607ff751 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/HasDeleteState.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/HasDeleteState.java
@@ -10,10 +10,17 @@
*******************************************************************************/
package org.eclipse.osee.orcs.data;
+import org.eclipse.osee.framework.core.enums.ModificationType;
+
/**
* @author Roberto E. Escobar
*/
public interface HasDeleteState {
- boolean isHardDeleted();
+ default boolean isDeleted() {
+ return getModificationType().isDeleted();
+ }
+
+ ModificationType getModificationType();
+
}

Back to the top