Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2015-10-27 17:17:26 -0400
committerRyan D. Brooks2015-10-27 17:17:26 -0400
commitc804e2b9f1612ee7dbdd4f28782fdc08c9a83524 (patch)
tree238e913be9e57c67f59987696276a5e2ccaa6337 /plugins/org.eclipse.osee.orcs.db.test
parent924de4163bac781c495a45eb2e9c9228d8f39829 (diff)
downloadorg.eclipse.osee-c804e2b9f1612ee7dbdd4f28782fdc08c9a83524.tar.gz
org.eclipse.osee-c804e2b9f1612ee7dbdd4f28782fdc08c9a83524.tar.xz
org.eclipse.osee-c804e2b9f1612ee7dbdd4f28782fdc08c9a83524.zip
refactor: Use CoreBranches.COMMON_ID where applicable
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.java20
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java7
3 files changed, 15 insertions, 15 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 a441cd5b92..de8dffac9e 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
@@ -15,6 +15,7 @@ import static org.eclipse.osee.framework.core.enums.CoreArtifactTypes.OseeTypeDe
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Active;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Name;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.UriGeneralStringData;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
import static org.eclipse.osee.framework.core.enums.CoreRelationTypes.Default_Hierarchical__Parent;
import static org.eclipse.osee.framework.core.enums.ModificationType.NEW;
import static org.eclipse.osee.orcs.db.intergration.IntegrationUtil.integrationRule;
@@ -26,7 +27,6 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.util.Iterator;
import org.eclipse.osee.executor.admin.HasCancellation;
-import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.LoadLevel;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.GUID;
@@ -76,8 +76,6 @@ 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);
@@ -104,7 +102,7 @@ public class LoaderTest {
@org.junit.Test
public void testLoad() throws OseeCoreException {
- DataLoader loader = loaderFactory.newDataLoaderFromIds(session, commonBranchId, 5, 6, 7);
+ DataLoader loader = loaderFactory.newDataLoaderFromIds(session, COMMON_ID, 5, 6, 7);
loader.withLoadLevel(LoadLevel.ALL);
loader.load(cancellation, builder);
@@ -114,7 +112,7 @@ public class LoaderTest {
verify(builder).onLoadEnd();
LoadDescription descriptor = descriptorCaptor.getValue();
- assertEquals(commonBranchId, descriptor.getBranchId());
+ assertEquals(COMMON_ID, descriptor.getBranchId());
verify(builder, times(3)).onData(artifactCaptor.capture());
verify(builder, times(7)).onData(attributeCaptor.capture());
@@ -155,7 +153,7 @@ public class LoaderTest {
@org.junit.Test
public void testLoadByTypes() throws OseeCoreException {
- DataLoader loader = loaderFactory.newDataLoaderFromIds(session, commonBranchId, 5, 6, 7);
+ DataLoader loader = loaderFactory.newDataLoaderFromIds(session, COMMON_ID, 5, 6, 7);
loader.withLoadLevel(LoadLevel.ALL);
loader.withAttributeTypes(Name);
@@ -168,7 +166,7 @@ public class LoaderTest {
verify(builder).onLoadEnd();
LoadDescription descriptor = descriptorCaptor.getValue();
- assertEquals(commonBranchId, descriptor.getBranchId());
+ assertEquals(COMMON_ID, descriptor.getBranchId());
verify(builder, times(3)).onData(artifactCaptor.capture());
verify(builder, times(3)).onData(attributeCaptor.capture());
@@ -204,7 +202,7 @@ public class LoaderTest {
@org.junit.Test
public void testLoadByIds() throws OseeCoreException {
- DataLoader loader = loaderFactory.newDataLoaderFromIds(session, commonBranchId, 5, 6, 7);
+ DataLoader loader = loaderFactory.newDataLoaderFromIds(session, COMMON_ID, 5, 6, 7);
loader.withLoadLevel(LoadLevel.ALL);
loader.withAttributeIds(11, 14);
@@ -217,7 +215,7 @@ public class LoaderTest {
verify(builder).onLoadEnd();
LoadDescription descriptor = descriptorCaptor.getValue();
- assertEquals(commonBranchId, descriptor.getBranchId());
+ assertEquals(COMMON_ID, descriptor.getBranchId());
verify(builder, times(3)).onData(artifactCaptor.capture());
verify(builder, times(2)).onData(attributeCaptor.capture());
@@ -252,7 +250,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, commonBranchId, ids);
+ DataLoader loader = loaderFactory.newDataLoaderFromGuids(session, COMMON_ID, ids);
loader.withLoadLevel(LoadLevel.ALL);
loader.load(cancellation, builder);
@@ -262,7 +260,7 @@ public class LoaderTest {
verify(builder).onLoadEnd();
LoadDescription descriptor = descriptorCaptor.getValue();
- assertEquals(commonBranchId, descriptor.getBranchId());
+ assertEquals(COMMON_ID, 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/search/engines/ArtifactQuerySqlContextFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java
index 1c17b67f37..02848e78ec 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
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.db.internal.search.engines;
import static java.util.Arrays.asList;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
import static org.eclipse.osee.orcs.db.internal.search.handlers.SqlHandlerFactoryUtil.createArtifactSqlHandlerFactory;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
@@ -140,7 +141,7 @@ public class ArtifactQuerySqlContextFactoryImplTest {
CriteriaSet criteriaSet = new CriteriaSet();
Options options = OptionsUtil.createOptions();
- criteriaSet.add(new CriteriaBranch(CoreBranches.COMMON.getUuid()));
+ criteriaSet.add(new CriteriaBranch(COMMON_ID));
queryData = new QueryData(criteriaSet, options);
when(sqlProvider.getSql(OseeSql.QUERY_BUILDER)).thenReturn("/*+ ordered */");
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
index d98d244258..6c849fd255 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
@@ -17,6 +17,7 @@ import static org.eclipse.osee.framework.core.enums.BranchState.CREATION_IN_PROG
import static org.eclipse.osee.framework.core.enums.BranchType.SYSTEM_ROOT;
import static org.eclipse.osee.framework.core.enums.BranchType.WORKING;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import java.util.Arrays;
@@ -349,7 +350,7 @@ public class BranchQuerySqlContextFactoryImplTest {
assertEquals(0, joins.size());
Iterator<Object> iterator = parameters.iterator();
- assertEquals(COMMON.getGuid(), iterator.next());
+ assertEquals(COMMON_ID, iterator.next());
}
@Test
@@ -380,7 +381,7 @@ public class BranchQuerySqlContextFactoryImplTest {
assertEquals(0, joins.size());
Iterator<Object> iterator = parameters.iterator();
- assertEquals(COMMON.getGuid(), iterator.next());
+ assertEquals(COMMON_ID, iterator.next());
}
@Test
@@ -423,7 +424,7 @@ public class BranchQuerySqlContextFactoryImplTest {
Iterator<Object> iterator = parameters.iterator();
- assertEquals(COMMON.getGuid(), iterator.next());
+ assertEquals(COMMON_ID, iterator.next());
assertEquals(WORKING.getValue(), iterator.next());
assertEquals(joins.get(0).getQueryId(), iterator.next());
assertEquals(ARCHIVED.getValue(), iterator.next());

Back to the top