Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2015-10-09 13:19:00 -0400
committerRyan D. Brooks2015-10-09 13:19:00 -0400
commitc702038787a4947b5705cac7b14c7106c4593170 (patch)
tree812bbcd7cf026f5301c633855fd48457f19dc99a /plugins/org.eclipse.osee.orcs.db.test
parenta68ad4bebbdfcd868e0bc78d453856b44609a9b2 (diff)
downloadorg.eclipse.osee-c702038787a4947b5705cac7b14c7106c4593170.tar.gz
org.eclipse.osee-c702038787a4947b5705cac7b14c7106c4593170.tar.xz
org.eclipse.osee-c702038787a4947b5705cac7b14c7106c4593170.zip
refactor: Use branchId directly
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.db.test')
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java22
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java17
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java53
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java60
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java2
5 files changed, 77 insertions, 77 deletions
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java
index b0f9e1a71d..a441cd5b92 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java
@@ -62,7 +62,7 @@ public class LoaderTest {
// @formatter:off
// @OsgiService private JdbcClient jdbcClient;
@OsgiService private OrcsDataStore dataStore;
- @Mock private LoadDataHandler builder;
+ @Mock private LoadDataHandler builder;
@Captor private ArgumentCaptor<LoadDescription> descriptorCaptor;
@Captor private ArgumentCaptor<ArtifactData> artifactCaptor;
@Captor private ArgumentCaptor<AttributeData> attributeCaptor;
@@ -76,6 +76,8 @@ public class LoaderTest {
private HasCancellation cancellation;
private DataLoaderFactory loaderFactory;
+ private static final Long commonBranchId = CoreBranches.COMMON.getUuid();
+
@Before
public void setUp() throws OseeCoreException {
MockitoAnnotations.initMocks(this);
@@ -102,7 +104,7 @@ public class LoaderTest {
@org.junit.Test
public void testLoad() throws OseeCoreException {
- DataLoader loader = loaderFactory.newDataLoaderFromIds(session, CoreBranches.COMMON, 5, 6, 7);
+ DataLoader loader = loaderFactory.newDataLoaderFromIds(session, commonBranchId, 5, 6, 7);
loader.withLoadLevel(LoadLevel.ALL);
loader.load(cancellation, builder);
@@ -112,7 +114,7 @@ public class LoaderTest {
verify(builder).onLoadEnd();
LoadDescription descriptor = descriptorCaptor.getValue();
- assertEquals(CoreBranches.COMMON, descriptor.getBranch());
+ assertEquals(commonBranchId, descriptor.getBranchId());
verify(builder, times(3)).onData(artifactCaptor.capture());
verify(builder, times(7)).onData(attributeCaptor.capture());
@@ -153,7 +155,7 @@ public class LoaderTest {
@org.junit.Test
public void testLoadByTypes() throws OseeCoreException {
- DataLoader loader = loaderFactory.newDataLoaderFromIds(session, CoreBranches.COMMON, 5, 6, 7);
+ DataLoader loader = loaderFactory.newDataLoaderFromIds(session, commonBranchId, 5, 6, 7);
loader.withLoadLevel(LoadLevel.ALL);
loader.withAttributeTypes(Name);
@@ -166,7 +168,7 @@ public class LoaderTest {
verify(builder).onLoadEnd();
LoadDescription descriptor = descriptorCaptor.getValue();
- assertEquals(CoreBranches.COMMON, descriptor.getBranch());
+ assertEquals(commonBranchId, descriptor.getBranchId());
verify(builder, times(3)).onData(artifactCaptor.capture());
verify(builder, times(3)).onData(attributeCaptor.capture());
@@ -178,7 +180,7 @@ public class LoaderTest {
// @formatter:off
verifyData(arts.next(), 5, "AkA10I4aUSDLuFNIaegA", NEW, OseeTypeDefinition.getGuid(), 570L,5, -1, 15L);
verifyData(arts.next(), 6, "AkA10LiAPEZLR4+jdFQA", NEW, OseeTypeDefinition.getGuid(), 570L,5, -1, 16L);
- verifyData(arts.next(), 7, "AkA2AcT6AXe6ivMFRhAA", NEW, Folder.getGuid(), 570L,6, -1, 43L);
+ verifyData(arts.next(), 7, "AkA2AcT6AXe6ivMFRhAA", NEW, Folder.getGuid(), 570L,6, -1, 43L);
// @formatter:on
sort(attributeCaptor.getAllValues());
@@ -202,7 +204,7 @@ public class LoaderTest {
@org.junit.Test
public void testLoadByIds() throws OseeCoreException {
- DataLoader loader = loaderFactory.newDataLoaderFromIds(session, CoreBranches.COMMON, 5, 6, 7);
+ DataLoader loader = loaderFactory.newDataLoaderFromIds(session, commonBranchId, 5, 6, 7);
loader.withLoadLevel(LoadLevel.ALL);
loader.withAttributeIds(11, 14);
@@ -215,7 +217,7 @@ public class LoaderTest {
verify(builder).onLoadEnd();
LoadDescription descriptor = descriptorCaptor.getValue();
- assertEquals(CoreBranches.COMMON, descriptor.getBranch());
+ assertEquals(commonBranchId, descriptor.getBranchId());
verify(builder, times(3)).onData(artifactCaptor.capture());
verify(builder, times(2)).onData(attributeCaptor.capture());
@@ -250,7 +252,7 @@ public class LoaderTest {
@org.junit.Test
public void testLoadByGuids() throws OseeCoreException {
String[] ids = new String[] {"AkA10I4aUSDLuFNIaegA", "AkA10LiAPEZLR4+jdFQA", "AkA2AcT6AXe6ivMFRhAA"};
- DataLoader loader = loaderFactory.newDataLoaderFromGuids(session, CoreBranches.COMMON, ids);
+ DataLoader loader = loaderFactory.newDataLoaderFromGuids(session, commonBranchId, ids);
loader.withLoadLevel(LoadLevel.ALL);
loader.load(cancellation, builder);
@@ -260,7 +262,7 @@ public class LoaderTest {
verify(builder).onLoadEnd();
LoadDescription descriptor = descriptorCaptor.getValue();
- assertEquals(CoreBranches.COMMON, descriptor.getBranch());
+ assertEquals(commonBranchId, descriptor.getBranchId());
verify(builder, times(3)).onData(artifactCaptor.capture());
verify(builder, times(7)).onData(attributeCaptor.capture());
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java
index e29d2204f8..7318dcb8b3 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java
@@ -20,7 +20,6 @@ import java.util.LinkedList;
import java.util.List;
import org.eclipse.osee.executor.admin.HasCancellation;
import org.eclipse.osee.framework.core.enums.ModificationType;
-import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
import org.eclipse.osee.framework.core.model.change.ChangeItemUtil;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -58,8 +57,8 @@ public class MissingChangeItemFactoryTest {
@Mock private DataLoaderFactory dataLoaderFactory;
@Mock private DataLoader sourceDataLoader;
@Mock private DataLoader destDataLoader;
- @Mock private Branch sourceBranch;
- @Mock private Branch destBranch;
+ @Mock private Long sourceBranch;
+ @Mock private Long destBranch;
@Mock private TransactionReadable sourceTx;
@Mock private TransactionReadable destTx;
@Mock private OrcsSession session;
@@ -100,12 +99,12 @@ public class MissingChangeItemFactoryTest {
String sessionGuid = GUID.create();
when(session.getGuid()).thenReturn(sessionGuid);
- when(dataLoaderFactory.newDataLoaderFromIds(any(OrcsSession.class), eq(sourceBranch), any(Collection.class))).thenReturn(
- sourceDataLoader);
- when(dataLoaderFactory.newDataLoaderFromIds(any(OrcsSession.class), eq(destBranch), any(Collection.class))).thenReturn(
- destDataLoader);
- when(sourceTx.getBranchId()).thenReturn(sourceBranch.getGuid());
- when(destTx.getBranchId()).thenReturn(destBranch.getGuid());
+ when(dataLoaderFactory.newDataLoaderFromIds(any(OrcsSession.class), eq(sourceBranch),
+ any(Collection.class))).thenReturn(sourceDataLoader);
+ when(dataLoaderFactory.newDataLoaderFromIds(any(OrcsSession.class), eq(destBranch),
+ any(Collection.class))).thenReturn(destDataLoader);
+ when(sourceTx.getBranchId()).thenReturn(sourceBranch);
+ when(destTx.getBranchId()).thenReturn(destBranch);
changeItemFactory = new MissingChangeItemFactoryImpl(dataLoaderFactory);
}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
index fe3d1f35e1..558ae06c81 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
import static org.mockito.Mockito.mock;
@@ -19,7 +20,6 @@ import org.eclipse.osee.framework.core.data.HasLocalId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IRelationType;
-import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -42,13 +42,13 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-
/**
* Test Case for {@link DataFactoryImplTest} and {@link OrcsObjectFactoryImpl}
- *
+ *
* @author Roberto E. Escobar
*/
public class DataFactoryImplTest {
+ private static final Long BRANCH_ID2 = Long.valueOf(11);
@Rule
public ExpectedException thrown = ExpectedException.none();
@@ -58,14 +58,14 @@ public class DataFactoryImplTest {
@Mock private ProxyDataFactory proxyFactory;
@Mock private IdentityLocator identityService;
@Mock private ArtifactTypes artifactCache;
-
+
@Mock private ArtifactData artData;
@Mock private AttributeData attrData;
@Mock private RelationData relData;
@Mock private VersionData verData;
@Mock private DataProxy dataProxy;
@Mock private DataProxy otherDataProxy;
-
+
@Mock private IArtifactType artifactTypeToken;
//@formatter:on
@@ -83,7 +83,7 @@ public class DataFactoryImplTest {
dataFactory = new DataFactoryImpl(idFactory, objectFactory, artifactCache);
// VERSION
- when(verData.getBranchId()).thenReturn(11L);
+ when(verData.getBranchId()).thenReturn(BRANCH_ID2);
when(verData.getGammaId()).thenReturn(222L);
when(verData.getTransactionId()).thenReturn(333);
when(verData.getStripeId()).thenReturn(444);
@@ -133,7 +133,7 @@ public class DataFactoryImplTest {
thrown.expect(OseeArgumentException.class);
thrown.expectMessage("Cannot create an instance of abstract type [artifactTypeToken]");
- dataFactory.create(CoreBranches.COMMON, artifactTypeToken, guid);
+ dataFactory.create(COMMON_ID, artifactTypeToken, guid);
}
@Test
@@ -147,7 +147,7 @@ public class DataFactoryImplTest {
thrown.expect(OseeArgumentException.class);
thrown.expectMessage("Invalid guid [123] during artifact creation [type: artifactTypeToken]");
- dataFactory.create(CoreBranches.COMMON, artifactTypeToken, guid);
+ dataFactory.create(COMMON_ID, artifactTypeToken, guid);
}
@Test
@@ -157,13 +157,13 @@ public class DataFactoryImplTest {
when(idFactory.getUniqueGuid(guid)).thenReturn(guid);
when(idFactory.getNextArtifactId()).thenReturn(987);
- ArtifactData actual = dataFactory.create(CoreBranches.COMMON, artifactTypeToken, guid);
+ ArtifactData actual = dataFactory.create(COMMON_ID, artifactTypeToken, guid);
verify(idFactory).getUniqueGuid(guid);
verify(idFactory).getNextArtifactId();
VersionData actualVer = actual.getVersion();
- assertEquals(570, actualVer.getBranchId());
+ assertEquals(COMMON_ID, actualVer.getBranchId());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getStripeId());
@@ -186,12 +186,12 @@ public class DataFactoryImplTest {
when(idFactory.getUniqueGuid(guid)).thenReturn(guid);
when(idFactory.getNextArtifactId()).thenReturn(987);
- ArtifactData actual = dataFactory.create(CoreBranches.COMMON, artifactTypeToken, guid);
+ ArtifactData actual = dataFactory.create(COMMON_ID, artifactTypeToken, guid);
verify(idFactory).getUniqueGuid(guid);
verify(idFactory).getNextArtifactId();
VersionData actualVer = actual.getVersion();
- assertEquals(570, actualVer.getBranchId());
+ assertEquals(COMMON_ID, actualVer.getBranchId());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getStripeId());
@@ -217,7 +217,7 @@ public class DataFactoryImplTest {
AttributeData actual = dataFactory.create(artData, attributeType);
VersionData actualVer = actual.getVersion();
- assertEquals(11, actualVer.getBranchId());
+ assertEquals(BRANCH_ID2, actualVer.getBranchId());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getStripeId());
@@ -250,11 +250,10 @@ public class DataFactoryImplTest {
when(localId1.getLocalId()).thenReturn(4562);
when(localId2.getLocalId()).thenReturn(9513);
- RelationData actual =
- dataFactory.createRelationData(relationType, CoreBranches.COMMON, localId1, localId2, "My rationale");
+ RelationData actual = dataFactory.createRelationData(relationType, COMMON_ID, localId1, localId2, "My rationale");
VersionData actualVer = actual.getVersion();
- assertEquals(570, actualVer.getBranchId());
+ assertEquals(COMMON_ID, actualVer.getBranchId());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getStripeId());
@@ -274,11 +273,11 @@ public class DataFactoryImplTest {
@Test
public void testIntroduceArtifactData() throws OseeCoreException {
- ArtifactData actual = dataFactory.introduce(CoreBranches.COMMON, artData);
+ ArtifactData actual = dataFactory.introduce(COMMON_ID, artData);
VersionData actualVer = actual.getVersion();
assertNotSame(verData, actualVer);
- assertEquals(570, actualVer.getBranchId());
+ assertEquals(COMMON_ID, actualVer.getBranchId());
assertEquals(222L, actualVer.getGammaId());
assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
assertEquals(artData.getVersion().getStripeId(), actualVer.getStripeId());
@@ -295,11 +294,11 @@ public class DataFactoryImplTest {
@Test
public void testIntroduceAttributeData() throws OseeCoreException {
- AttributeData actual = dataFactory.introduce(CoreBranches.COMMON, attrData);
+ AttributeData actual = dataFactory.introduce(COMMON_ID, attrData);
VersionData actualVer = actual.getVersion();
assertNotSame(verData, actualVer);
- assertEquals(570, actualVer.getBranchId());
+ assertEquals(COMMON_ID, actualVer.getBranchId());
assertEquals(222L, actualVer.getGammaId());
assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
assertEquals(attrData.getVersion().getStripeId(), actualVer.getStripeId());
@@ -328,12 +327,12 @@ public class DataFactoryImplTest {
when(idFactory.getNextArtifactId()).thenReturn(987);
when(idFactory.getUniqueGuid(null)).thenReturn(newGuid);
- ArtifactData actual = dataFactory.copy(CoreBranches.COMMON, artData);
+ ArtifactData actual = dataFactory.copy(COMMON_ID, artData);
verify(idFactory).getUniqueGuid(null);
VersionData actualVer = actual.getVersion();
assertNotSame(verData, actualVer);
- assertEquals(570, actualVer.getBranchId());
+ assertEquals(COMMON_ID, actualVer.getBranchId());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getStripeId());
@@ -350,11 +349,11 @@ public class DataFactoryImplTest {
@Test
public void testCopyAttributeData() throws OseeCoreException {
- AttributeData actual = dataFactory.copy(CoreBranches.COMMON, attrData);
+ AttributeData actual = dataFactory.copy(COMMON_ID, attrData);
VersionData actualVer = actual.getVersion();
assertNotSame(verData, actualVer);
- assertEquals(570, actualVer.getBranchId());
+ assertEquals(COMMON_ID, actualVer.getBranchId());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getStripeId());
@@ -385,7 +384,7 @@ public class DataFactoryImplTest {
assertNotSame(artData, actual);
assertNotSame(verData, actualVer);
- assertEquals(11, actualVer.getBranchId());
+ assertEquals(BRANCH_ID2, actualVer.getBranchId());
assertEquals(222L, actualVer.getGammaId());
assertEquals(333, actualVer.getTransactionId());
assertEquals(444, actualVer.getStripeId());
@@ -410,7 +409,7 @@ public class DataFactoryImplTest {
assertNotSame(attrData, actual);
assertNotSame(verData, actualVer);
- assertEquals(11, actualVer.getBranchId());
+ assertEquals(BRANCH_ID2, actualVer.getBranchId());
assertEquals(222L, actualVer.getGammaId());
assertEquals(333, actualVer.getTransactionId());
assertEquals(444, actualVer.getStripeId());
@@ -441,7 +440,7 @@ public class DataFactoryImplTest {
assertNotSame(relData, actual);
assertNotSame(verData, actualVer);
- assertEquals(11, actualVer.getBranchId());
+ assertEquals(BRANCH_ID2, actualVer.getBranchId());
assertEquals(222L, actualVer.getGammaId());
assertEquals(333, actualVer.getTransactionId());
assertEquals(444, actualVer.getStripeId());
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
index 5d2e991274..3db8f228c6 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED;
import static org.eclipse.osee.framework.core.enums.DeletionFlag.INCLUDE_DELETED;
import static org.junit.Assert.assertEquals;
@@ -96,7 +97,6 @@ public class DataLoaderFactoryImplTest {
private final static int EXPECTED_TX_ID = 45678;
private final static int EXPECTED_HEAD_TX_ID = 50000;
- private final static IOseeBranch BRANCH = CoreBranches.COMMON;
private DataLoaderFactory factory;
private SqlObjectLoader spyLoader;
@@ -117,7 +117,7 @@ public class DataLoaderFactoryImplTest {
when(sqlProvider.getSql(OseeSql.QUERY_BUILDER)).thenReturn("/*+ ordered */");
when(jdbcClient.getStatement()).thenReturn(chStmt);
- when(jdbcClient.runPreparedQueryFetchObject(eq(-1), Matchers.anyString(), eq(BRANCH.getUuid()))).thenReturn(
+ when(jdbcClient.runPreparedQueryFetchObject(eq(-1), Matchers.anyString(), eq(COMMON_ID))).thenReturn(
EXPECTED_HEAD_TX_ID);
when(joinFactory.createArtifactJoinQuery()).thenAnswer(new Answer<ArtifactJoinQuery>() {
@@ -143,7 +143,7 @@ public class DataLoaderFactoryImplTest {
public void testLoadFull() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ALL;
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.fromTransaction(EXPECTED_TX_ID);
@@ -152,7 +152,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
// @formatter:off
- verify(spyLoader, times(0)).loadHeadTransactionId(BRANCH);
+ verify(spyLoader, times(0)).loadHeadTransactionId(COMMON_ID);
verify(spyLoader, times(1)).loadArtifacts(eq(builder), criteriaCaptor.capture(), contextCaptor.capture(), eq(200));
verify(spyLoader, times(1)).loadAttributes(eq(builder), criteriaCaptor.capture(), contextCaptor.capture(), eq(200));
verify(spyLoader, times(1)).loadRelations(eq(builder), criteriaCaptor.capture(), contextCaptor.capture(), eq(200));
@@ -171,7 +171,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
assertEquals(expectedLoadLevel, dataLoader.getLoadLevel());
@@ -193,7 +193,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.includeDeletedArtifacts();
@@ -217,7 +217,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.transaction_id <= jart1.transaction_id AND txs1.mod_type != 3 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.fromTransaction(EXPECTED_TX_ID);
@@ -241,7 +241,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.transaction_id <= jart1.transaction_id AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.fromTransaction(EXPECTED_TX_ID);
dataLoader.includeDeletedArtifacts();
@@ -267,7 +267,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
assertEquals(expectedLoadLevel, dataLoader.getLoadLevel());
@@ -291,7 +291,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withAttributeTypes(CoreAttributeTypes.Annotation);
@@ -317,7 +317,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withAttributeTypes(CoreAttributeTypes.Annotation, CoreAttributeTypes.Category);
@@ -342,7 +342,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withAttributeIds(45);
@@ -367,7 +367,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withAttributeIds(45, 55);
@@ -392,7 +392,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withAttributeIds(45, 55);
dataLoader.withAttributeTypes(CoreAttributeTypes.Annotation, CoreAttributeTypes.Category);
@@ -419,7 +419,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withAttributeIds(45);
dataLoader.withAttributeTypes(CoreAttributeTypes.Annotation);
@@ -445,7 +445,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.includeDeletedArtifacts();
@@ -470,7 +470,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.transaction_id <= jart1.transaction_id AND txs1.mod_type != 3 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.fromTransaction(EXPECTED_TX_ID);
@@ -495,7 +495,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.transaction_id <= jart1.transaction_id AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.fromTransaction(EXPECTED_TX_ID);
dataLoader.includeDeletedArtifacts();
@@ -523,7 +523,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
assertEquals(expectedLoadLevel, dataLoader.getLoadLevel());
@@ -547,7 +547,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.includeDeletedArtifacts();
@@ -572,7 +572,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withRelationTypes(CoreRelationTypes.Default_Hierarchical__Child);
@@ -598,7 +598,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withRelationTypes(CoreRelationTypes.Default_Hierarchical__Child,
CoreRelationTypes.Dependency__Artifact);
@@ -631,7 +631,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withRelationIds(45);
@@ -656,7 +656,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withRelationIds(45, 55);
@@ -681,7 +681,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withRelationIds(45, 55);
dataLoader.withRelationTypes(CoreRelationTypes.Default_Hierarchical__Child,
@@ -715,7 +715,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.withRelationIds(45);
dataLoader.withRelationTypes(CoreRelationTypes.Default_Hierarchical__Child);
@@ -742,7 +742,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.transaction_id <= jart1.transaction_id AND txs1.mod_type != 3 AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.fromTransaction(EXPECTED_TX_ID);
@@ -766,7 +766,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.includeDeletedAttributes();
dataLoader.withAttributeIds(45, 55);
@@ -792,7 +792,7 @@ public class DataLoaderFactoryImplTest {
" AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
" ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
- DataLoader dataLoader = factory.newDataLoaderFromIds(session, BRANCH, Arrays.asList(1, 2, 3));
+ DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
dataLoader.includeDeletedRelations();
dataLoader.withRelationTypes(CoreRelationTypes.Default_Hierarchical__Child);
@@ -833,7 +833,7 @@ public class DataLoaderFactoryImplTest {
assertEquals(session, descriptor.getSession());
Options options = descriptor.getOptions();
- assertEquals(BRANCH, descriptor.getBranch());
+ assertEquals(COMMON_ID, descriptor.getBranchId());
assertEquals(txId, descriptor.getTransaction());
assertEquals(isHeadTx, OptionsUtil.isHeadTransaction(options));
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java
index 7937b4ea4b..1c17b67f37 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java
@@ -140,7 +140,7 @@ public class ArtifactQuerySqlContextFactoryImplTest {
CriteriaSet criteriaSet = new CriteriaSet();
Options options = OptionsUtil.createOptions();
- criteriaSet.add(new CriteriaBranch(CoreBranches.COMMON));
+ criteriaSet.add(new CriteriaBranch(CoreBranches.COMMON.getUuid()));
queryData = new QueryData(criteriaSet, options);
when(sqlProvider.getSql(OseeSql.QUERY_BUILDER)).thenReturn("/*+ ordered */");

Back to the top