Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-05-12 18:19:01 -0400
committerRyan D. Brooks2016-08-31 12:16:51 -0400
commitba342e85f2fde7364034ee340de8d124623c30ad (patch)
treec1bef763bd2e352ccf9b4cb3cebafc4e941ac874 /plugins/org.eclipse.osee.orcs.db.test
parentf5898036272a06d3ee50482ed7a3464238da2b33 (diff)
downloadorg.eclipse.osee-ba342e85f2fde7364034ee340de8d124623c30ad.tar.gz
org.eclipse.osee-ba342e85f2fde7364034ee340de8d124623c30ad.tar.xz
org.eclipse.osee-ba342e85f2fde7364034ee340de8d124623c30ad.zip
refactor: Base TransactionId on Id
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/IntegrationUtil.java46
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java52
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java47
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java84
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java42
9 files changed, 156 insertions, 145 deletions
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java
index c54180c18e..e478e7f8b0 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java
@@ -14,6 +14,8 @@ import static org.junit.Assert.assertEquals;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
+import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.core.ds.ArtifactData;
import org.eclipse.osee.orcs.core.ds.AttributeData;
@@ -42,22 +44,18 @@ public class IntegrationUtil {
public static void verifyData(ArtifactData data, Object... values) {
int index = 0;
- assertEquals(values[index++], data.getLocalId());
- assertEquals(values[index++], data.getGuid());
- assertEquals(values[index++], data.getModType());
- assertEquals(values[index++], data.getTypeUuid());
+ assertEquals(data.getLocalId(), values[index++]);
+ assertEquals(data.getGuid(), values[index++]);
- verifyData(data.getVersion(), index, values);
+ verifyData(data, index, values);
}
public static void verifyData(AttributeData data, Object... values) throws OseeCoreException {
int index = 0;
- assertEquals(values[index++], data.getLocalId());
- assertEquals(values[index++], data.getArtifactId());
- assertEquals(values[index++], data.getModType());
- assertEquals(values[index++], data.getTypeUuid());
+ assertEquals(data.getLocalId(), values[index++]);
+ assertEquals(data.getArtifactId(), values[index++]);
- index = verifyData(data.getVersion(), index, values);
+ index = verifyData(data, index, values);
Object[] proxied = data.getDataProxy().getData();
assertEquals(values[index++], proxied[0]); // value
@@ -66,23 +64,24 @@ public class IntegrationUtil {
public static void verifyData(RelationData data, Object... values) {
int index = 0;
- assertEquals(values[index++], data.getLocalId());
+ assertEquals(data.getLocalId(), values[index++]);
- assertEquals(values[index++], data.getArtIdA());
- assertEquals(values[index++], data.getArtIdB());
- assertEquals(values[index++], data.getRationale());
+ assertEquals(data.getArtIdA(), values[index++]);
+ assertEquals(data.getArtIdB(), values[index++]);
+ assertEquals(data.getRationale(), values[index++]);
- assertEquals(values[index++], data.getModType());
- assertEquals(values[index++], data.getTypeUuid());
-
- verifyData(data.getVersion(), index, values);
+ verifyData(data, index, values);
}
- public static int verifyData(VersionData version, int index, Object... values) {
- assertEquals(values[index++], version.getBranchId());
- assertEquals(values[index++], version.getTransactionId());
- assertEquals(values[index++], version.getStripeId());
- assertEquals(values[index++], version.getGammaId());
+ private static int verifyData(OrcsData orcsData, int index, Object... values) {
+ assertEquals(orcsData.getModType(), values[index++]);
+ assertEquals(orcsData.getTypeUuid(), values[index++]);
+
+ VersionData version = orcsData.getVersion();
+ assertEquals(version.getBranchId(), ((BranchId) values[index++]).getId());
+ assertEquals(version.getTransactionId(), values[index++]);
+ assertEquals(version.getStripeId(), TransactionId.SENTINEL);
+ assertEquals(version.getGammaId(), values[index++]);
return index;
}
@@ -93,5 +92,4 @@ public class IntegrationUtil {
return arg0.getLocalId() - arg1.getLocalId();
}
};
-
}
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 398472382a..404c85bd9f 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;
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;
@@ -27,6 +28,7 @@ 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.data.TransactionId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTokens;
import org.eclipse.osee.framework.core.enums.LoadLevel;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -81,6 +83,10 @@ public class LoaderTest {
private final String OseeTypesDemoGuid = "AQjoNnwNdyjicTck2UwA";
private final int UserGroupsId = CoreArtifactTokens.UserGroups.getUuid().intValue();
private final String UserGroupsGuid = CoreArtifactTokens.UserGroups.getGuid();
+ private final TransactionId tx5 = TransactionId.valueOf(5);
+ private final TransactionId tx6 = TransactionId.valueOf(6);
+ private final TransactionId tx7 = TransactionId.valueOf(7);
+ private final TransactionId tx10 = TransactionId.valueOf(10);
@Before
public void setUp() throws OseeCoreException {
@@ -139,15 +145,15 @@ public class LoaderTest {
Iterator<AttributeData> attrs = attributeCaptor.getAllValues().iterator();
// @formatter:off
- verifyData(attrs.next(), 4, OseeTypesFrameworkId, NEW, Active.getId(), 570L,5, -1, 13L, "true", "");
- verifyData(attrs.next(), 5, OseeTypesFrameworkId, NEW, Name.getId(), 570L,5, -1, 14L, "org.eclipse.osee.framework.skynet.core.OseeTypes_Framework", "");
- verifyData(attrs.next(), 6, OseeTypesFrameworkId, NEW, UriGeneralStringData.getId(), 570L,5, -1, 15L, "", "attr://15/"+OseeTypesFrameworkGuid+".zip");
+ verifyData(attrs.next(), 4, OseeTypesFrameworkId, NEW, Active.getId(), COMMON,tx5, 13L, "true", "");
+ verifyData(attrs.next(), 5, OseeTypesFrameworkId, NEW, Name.getId(), COMMON,tx5, 14L, "org.eclipse.osee.framework.skynet.core.OseeTypes_Framework", "");
+ verifyData(attrs.next(), 6, OseeTypesFrameworkId, NEW, UriGeneralStringData.getId(), COMMON,tx5, 15L, "", "attr://15/"+OseeTypesFrameworkGuid+".zip");
- verifyData(attrs.next(), 10, OseeTypesDemoId, NEW, Active.getId(), 570L,5, -1, 19L, "true", "");
- verifyData(attrs.next(), 11, OseeTypesDemoId, NEW, Name.getId(), 570L,5, -1, 20L, "org.eclipse.osee.ats.client.demo.OseeTypes_Demo", "");
- verifyData(attrs.next(), 12, OseeTypesDemoId, NEW, UriGeneralStringData.getId(), 570L,5, -1, 21L, "", "attr://21/"+OseeTypesDemoGuid+".zip");
+ verifyData(attrs.next(), 10, OseeTypesDemoId, NEW, Active.getId(), COMMON,tx5, 19L, "true", "");
+ verifyData(attrs.next(), 11, OseeTypesDemoId, NEW, Name.getId(), COMMON,tx5, 20L, "org.eclipse.osee.ats.client.demo.OseeTypes_Demo", "");
+ verifyData(attrs.next(), 12, OseeTypesDemoId, NEW, UriGeneralStringData.getId(), COMMON,tx5, 21L, "", "attr://21/"+OseeTypesDemoGuid+".zip");
- verifyData(attrs.next(), 20, UserGroupsId, NEW, Name.getId(), 570L, 7, -1, 46L, "User Groups", "");
+ verifyData(attrs.next(), 20, UserGroupsId, NEW, Name.getId(), COMMON, tx7, 46L, "User Groups", "");
// @formatter:on
sort(relationCaptor.getAllValues());
@@ -157,25 +163,25 @@ public class LoaderTest {
}
private void verifyRels(Iterator<RelationData> rels) {
- verifyData(rels.next(), 1, UserGroupsId, 48656, "", NEW, Default_Hierarchical__Parent.getGuid(), 570L, 7, -1,
+ verifyData(rels.next(), 1, UserGroupsId, 48656, "", NEW, Default_Hierarchical__Parent.getGuid(), COMMON, tx7,
43L);
- verifyData(rels.next(), 2, 197818, UserGroupsId, "", NEW, Default_Hierarchical__Parent.getGuid(), 570L, 7, -1,
+ verifyData(rels.next(), 2, 197818, UserGroupsId, "", NEW, Default_Hierarchical__Parent.getGuid(), COMMON, tx7,
39L);
- verifyData(rels.next(), 3, UserGroupsId, 52247, "", NEW, Default_Hierarchical__Parent.getGuid(), 570L, 7, -1,
+ verifyData(rels.next(), 3, UserGroupsId, 52247, "", NEW, Default_Hierarchical__Parent.getGuid(), COMMON, tx7,
40L);
- verifyData(rels.next(), 9, UserGroupsId, 8033605, "", NEW, Default_Hierarchical__Parent.getGuid(), 570L, 10, -1,
+ verifyData(rels.next(), 9, UserGroupsId, 8033605, "", NEW, Default_Hierarchical__Parent.getGuid(), COMMON, tx10,
111L);
- verifyData(rels.next(), 10, UserGroupsId, 136750, "", NEW, Default_Hierarchical__Parent.getGuid(), 570L, 10, -1,
+ verifyData(rels.next(), 10, UserGroupsId, 136750, "", NEW, Default_Hierarchical__Parent.getGuid(), COMMON, tx10,
109L);
- verifyData(rels.next(), 11, UserGroupsId, 5367074, "", NEW, Default_Hierarchical__Parent.getGuid(), 570L, 10, -1,
+ verifyData(rels.next(), 11, UserGroupsId, 5367074, "", NEW, Default_Hierarchical__Parent.getGuid(), COMMON, tx10,
110L);
}
private void verifyArts(Iterator<ArtifactData> arts) {
// @formatter:off
- verifyData(arts.next(), UserGroupsId, UserGroupsGuid, NEW, Folder.getId(), 570L, 7, -1, 71L);
- verifyData(arts.next(), OseeTypesDemoId, OseeTypesDemoGuid, NEW, OseeTypeDefinition.getId(), 570L, 5, -1, 10L);
- verifyData(arts.next(), OseeTypesFrameworkId, OseeTypesFrameworkGuid, NEW, OseeTypeDefinition.getId(), 570L, 5, -1, 8L);
+ verifyData(arts.next(), UserGroupsId, UserGroupsGuid, NEW, Folder.getId(), COMMON, tx7, 71L);
+ verifyData(arts.next(), OseeTypesDemoId, OseeTypesDemoGuid, NEW, OseeTypeDefinition.getId(), COMMON, tx5, 10L);
+ verifyData(arts.next(), OseeTypesFrameworkId, OseeTypesFrameworkGuid, NEW, OseeTypeDefinition.getId(), COMMON, tx5, 8L);
// @formatter:on
}
@@ -210,9 +216,9 @@ public class LoaderTest {
Iterator<AttributeData> attrs = attributeCaptor.getAllValues().iterator();
// @formatter:off
- verifyData(attrs.next(), 5, OseeTypesFrameworkId, NEW, Name.getId(), 570L,5, -1, 14L, "org.eclipse.osee.framework.skynet.core.OseeTypes_Framework", "");
- verifyData(attrs.next(), 11, OseeTypesDemoId, NEW, Name.getId(), 570L,5, -1, 20L, "org.eclipse.osee.ats.client.demo.OseeTypes_Demo", "");
- verifyData(attrs.next(), 20, UserGroupsId, NEW, Name.getId(), 570L, 7, -1, 46L, "User Groups", "");
+ verifyData(attrs.next(), 5, OseeTypesFrameworkId, NEW, Name.getId(), COMMON,tx5, 14L, "org.eclipse.osee.framework.skynet.core.OseeTypes_Framework", "");
+ verifyData(attrs.next(), 11, OseeTypesDemoId, NEW, Name.getId(), COMMON,tx5, 20L, "org.eclipse.osee.ats.client.demo.OseeTypes_Demo", "");
+ verifyData(attrs.next(), 20, UserGroupsId, NEW, Name.getId(), COMMON, tx7, 46L, "User Groups", "");
// @formatter:on
sort(relationCaptor.getAllValues());
@@ -252,17 +258,17 @@ public class LoaderTest {
Iterator<AttributeData> attrs = attributeCaptor.getAllValues().iterator();
// @formatter:off
- verifyData(attrs.next(), 4, OseeTypesFrameworkId, NEW, Active.getId(), 570L,5, -1, 13L, "true", "");
- verifyData(attrs.next(), 10, OseeTypesDemoId, NEW, Active.getId(), 570L,5, -1, 19L, "true", "");
+ verifyData(attrs.next(), 4, OseeTypesFrameworkId, NEW, Active.getId(), COMMON,tx5, 13L, "true", "");
+ verifyData(attrs.next(), 10, OseeTypesDemoId, NEW, Active.getId(), COMMON,tx5, 19L, "true", "");
// @formatter:on
sort(relationCaptor.getAllValues());
Iterator<RelationData> rels = relationCaptor.getAllValues().iterator();
// @formatter:off
- verifyData(rels.next(), 2, 197818, UserGroupsId, "", NEW, Default_Hierarchical__Parent.getGuid(), 570L, 7, -1,
+ verifyData(rels.next(), 2, 197818, UserGroupsId, "", NEW, Default_Hierarchical__Parent.getGuid(), COMMON, tx7,
39L);
- verifyData(rels.next(), 3, UserGroupsId, 52247, "", NEW, Default_Hierarchical__Parent.getGuid(), 570L, 7, -1,
+ verifyData(rels.next(), 3, UserGroupsId, 52247, "", NEW, Default_Hierarchical__Parent.getGuid(), COMMON, tx7,
40L);
// @formatter:on
}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java
index 3449192bce..d9612a2c20 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/PurgeAttributeTest.java
@@ -40,6 +40,7 @@ public class PurgeAttributeTest {
@Test
public void testPurgeAttribute() throws Exception {
JdbcClient jdbcClient = jdbcService.getClient();
+ JdbcStatement stmt = jdbcClient.getStatement();
int prePurgeAttributeCount = getCount(jdbcClient, "osee_attribute");
int preAttributeRows = getCount(jdbcClient, "osee_attribute where value = 'Software Requirements'");
@@ -48,9 +49,11 @@ public class PurgeAttributeTest {
int prePurgeTxsCount = getCount(jdbcClient, "osee_txs");
+ stmt.runPreparedQuery("select attr_id from osee_attribute where value = 'Software Requirements'");
List<Long> toPurge = new LinkedList<>();
- jdbcClient.runQuery(stmt -> toPurge.add(stmt.getLong("attr_id")),
- "select attr_id from osee_attribute where value = 'Software Requirements'");
+ while (stmt.next()) {
+ toPurge.add(stmt.getLong("attr_id"));
+ }
PurgeAttributesDatabaseTxCallable callable =
new PurgeAttributesDatabaseTxCallable(null, null, jdbcClient, sqlJoinFactory, toPurge, null);
@@ -68,12 +71,11 @@ public class PurgeAttributeTest {
}
private int getCount(JdbcClient jdbcClient, String table) {
+ JdbcStatement stmt = jdbcClient.getStatement();
int toReturn = -1;
- try (JdbcStatement chStmt = jdbcClient.getStatement()) {
- chStmt.runPreparedQuery("select count(1) from " + table);
- while (chStmt.next()) {
- toReturn = chStmt.getInt(1);
- }
+ stmt.runPreparedQuery("select count(1) from " + table);
+ while (stmt.next()) {
+ toReturn = stmt.getInt(1);
}
return toReturn;
}
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 5378330efa..e4d2981622 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
@@ -21,6 +21,7 @@ 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.data.RelationalConstants;
+import org.eclipse.osee.framework.core.data.TransactionId;
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;
@@ -50,6 +51,8 @@ import org.mockito.MockitoAnnotations;
*/
public class DataFactoryImplTest {
private static final Long BRANCH_ID2 = Long.valueOf(11);
+ private static final TransactionId tx333 = TransactionId.valueOf(333);
+ private static final TransactionId tx444 = TransactionId.valueOf(444);
@Rule
public ExpectedException thrown = ExpectedException.none();
@@ -86,8 +89,8 @@ public class DataFactoryImplTest {
// VERSION
when(verData.getBranchId()).thenReturn(BRANCH_ID2);
when(verData.getGammaId()).thenReturn(222L);
- when(verData.getTransactionId()).thenReturn(333);
- when(verData.getStripeId()).thenReturn(444);
+ when(verData.getTransactionId()).thenReturn(tx333);
+ when(verData.getStripeId()).thenReturn(tx444);
when(verData.isHistorical()).thenReturn(true);
// ARTIFACT
@@ -166,8 +169,8 @@ public class DataFactoryImplTest {
assertEquals(COMMON_ID, actualVer.getBranchId());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
- assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
- assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getStripeId());
+ assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
+ assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
assertEquals(false, actualVer.isInStorage());
@@ -194,8 +197,8 @@ public class DataFactoryImplTest {
VersionData actualVer = actual.getVersion();
assertEquals(COMMON_ID, actualVer.getBranchId());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
- assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
- assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getStripeId());
+ assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
+ assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
assertEquals(false, actualVer.isInStorage());
@@ -220,8 +223,8 @@ public class DataFactoryImplTest {
VersionData actualVer = actual.getVersion();
assertEquals(BRANCH_ID2, actualVer.getBranchId());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
- assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
- assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getStripeId());
+ assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
+ assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
assertEquals(false, actualVer.isInStorage());
@@ -256,8 +259,8 @@ public class DataFactoryImplTest {
VersionData actualVer = actual.getVersion();
assertEquals(COMMON_ID, actualVer.getBranchId());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
- assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
- assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getStripeId());
+ assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
+ assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
assertEquals(false, actualVer.isInStorage());
@@ -280,7 +283,7 @@ public class DataFactoryImplTest {
assertNotSame(verData, actualVer);
assertEquals(COMMON_ID, actualVer.getBranchId());
assertEquals(222L, actualVer.getGammaId());
- assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
+ assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(artData.getVersion().getStripeId(), actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
assertEquals(false, actualVer.isInStorage());
@@ -301,7 +304,7 @@ public class DataFactoryImplTest {
assertNotSame(verData, actualVer);
assertEquals(COMMON_ID, actualVer.getBranchId());
assertEquals(222L, actualVer.getGammaId());
- assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
+ assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
assertEquals(attrData.getVersion().getStripeId(), actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
assertEquals(false, actualVer.isInStorage());
@@ -335,8 +338,8 @@ public class DataFactoryImplTest {
assertNotSame(verData, actualVer);
assertEquals(COMMON_ID, actualVer.getBranchId());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
- assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
- assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getStripeId());
+ assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
+ assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
assertEquals(false, actualVer.isInStorage());
@@ -356,8 +359,8 @@ public class DataFactoryImplTest {
assertNotSame(verData, actualVer);
assertEquals(COMMON_ID, actualVer.getBranchId());
assertEquals(RelationalConstants.GAMMA_SENTINEL, actualVer.getGammaId());
- assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getTransactionId());
- assertEquals(RelationalConstants.TRANSACTION_SENTINEL, actualVer.getStripeId());
+ assertEquals(TransactionId.SENTINEL, actualVer.getTransactionId());
+ assertEquals(TransactionId.SENTINEL, actualVer.getStripeId());
assertEquals(false, actualVer.isHistorical());
assertEquals(false, actualVer.isInStorage());
@@ -387,8 +390,8 @@ public class DataFactoryImplTest {
assertEquals(BRANCH_ID2, actualVer.getBranchId());
assertEquals(222L, actualVer.getGammaId());
- assertEquals(333, actualVer.getTransactionId());
- assertEquals(444, actualVer.getStripeId());
+ assertEquals(tx333, actualVer.getTransactionId());
+ assertEquals(tx444, actualVer.getStripeId());
assertEquals(true, actualVer.isHistorical());
assertEquals(true, actualVer.isInStorage());
@@ -412,8 +415,8 @@ public class DataFactoryImplTest {
assertEquals(BRANCH_ID2, actualVer.getBranchId());
assertEquals(222L, actualVer.getGammaId());
- assertEquals(333, actualVer.getTransactionId());
- assertEquals(444, actualVer.getStripeId());
+ assertEquals(tx333, actualVer.getTransactionId());
+ assertEquals(tx444, actualVer.getStripeId());
assertEquals(true, actualVer.isHistorical());
assertEquals(true, actualVer.isInStorage());
@@ -443,8 +446,8 @@ public class DataFactoryImplTest {
assertEquals(BRANCH_ID2, actualVer.getBranchId());
assertEquals(222L, actualVer.getGammaId());
- assertEquals(333, actualVer.getTransactionId());
- assertEquals(444, actualVer.getStripeId());
+ assertEquals(tx333, actualVer.getTransactionId());
+ assertEquals(tx444, actualVer.getStripeId());
assertEquals(true, actualVer.isHistorical());
assertEquals(true, actualVer.isInStorage());
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 420ca85b43..6ac083126a 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;
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;
@@ -26,6 +27,7 @@ import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import org.eclipse.osee.executor.admin.HasCancellation;
+import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
@@ -90,8 +92,8 @@ public class DataLoaderFactoryImplTest {
@Mock private OrcsSession session;
//@formatter:on
- private final static int EXPECTED_TX_ID = 45678;
- private final static int EXPECTED_HEAD_TX_ID = 50000;
+ private final static TransactionId EXPECTED_TX = TransactionId.valueOf(45678);
+ private final static TransactionId EXPECTED_HEAD_TX = TransactionId.valueOf(50000);
private DataLoaderFactory factory;
private SqlObjectLoader spyLoader;
@@ -110,8 +112,7 @@ public class DataLoaderFactoryImplTest {
factory = module.createDataLoaderFactory(spyLoader);
when(jdbcClient.getStatement()).thenReturn(chStmt);
- when(jdbcClient.fetch(eq(-1), Matchers.anyString(), eq(COMMON_ID))).thenReturn(
- EXPECTED_HEAD_TX_ID);
+ when(jdbcClient.fetch(eq(TransactionId.SENTINEL), Matchers.anyString(), eq(COMMON))).thenReturn(EXPECTED_HEAD_TX);
when(joinFactory.createArtifactJoinQuery()).thenAnswer(new Answer<ArtifactJoinQuery>() {
@@ -138,14 +139,14 @@ public class DataLoaderFactoryImplTest {
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
- dataLoader.fromTransaction(EXPECTED_TX_ID);
+ dataLoader.fromTransaction(EXPECTED_TX);
assertEquals(expectedLoadLevel, dataLoader.getLoadLevel());
dataLoader.load(cancellation, builder);
// @formatter:off
- verify(spyLoader, times(0)).loadHeadTransactionId(COMMON_ID);
+ verify(spyLoader, times(0)).loadHeadTransactionId(COMMON);
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));
@@ -172,7 +173,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected);
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected);
}
@Test
@@ -196,7 +197,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, INCLUDE_DELETED, expected);
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, INCLUDE_DELETED, expected);
}
@Test
@@ -214,13 +215,13 @@ public class DataLoaderFactoryImplTest {
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
- dataLoader.fromTransaction(EXPECTED_TX_ID);
+ dataLoader.fromTransaction(EXPECTED_TX);
assertEquals(expectedLoadLevel, dataLoader.getLoadLevel());
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected);
+ verifyCommon(EXPECTED_TX, expectedLoadLevel, EXCLUDE_DELETED, expected);
}
@Test
@@ -238,14 +239,14 @@ public class DataLoaderFactoryImplTest {
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
- dataLoader.fromTransaction(EXPECTED_TX_ID);
+ dataLoader.fromTransaction(EXPECTED_TX);
dataLoader.includeDeletedArtifacts();
assertEquals(expectedLoadLevel, dataLoader.getLoadLevel());
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_TX_ID, expectedLoadLevel, INCLUDE_DELETED, expected);
+ verifyCommon(EXPECTED_TX, expectedLoadLevel, INCLUDE_DELETED, expected);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -270,7 +271,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected);
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected);
}
@Test
@@ -295,7 +296,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected,
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected,
CoreAttributeTypes.Annotation.getGuid());
}
@@ -321,7 +322,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected, data(JQID),
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected, data(JQID),
list(data(CoreAttributeTypes.Annotation.getGuid(), CoreAttributeTypes.Category.getGuid())));
}
@@ -347,7 +348,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected, 45);
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected, 45);
}
@Test
@@ -372,7 +373,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected, data(JQID), list(data(45, 55)));
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected, data(JQID), list(data(45, 55)));
}
@Test
@@ -398,7 +399,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected, data(JQID, JQID),
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected, data(JQID, JQID),
list(data(45, 55), data(CoreAttributeTypes.Annotation.getGuid(), CoreAttributeTypes.Category.getGuid())));
}
@@ -425,7 +426,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected, 45,
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected, 45,
CoreAttributeTypes.Annotation.getGuid());
}
@@ -451,7 +452,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, INCLUDE_DELETED, expected);
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, INCLUDE_DELETED, expected);
}
@Test
@@ -470,13 +471,13 @@ public class DataLoaderFactoryImplTest {
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
- dataLoader.fromTransaction(EXPECTED_TX_ID);
+ dataLoader.fromTransaction(EXPECTED_TX);
assertEquals(expectedLoadLevel, dataLoader.getLoadLevel());
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected);
+ verifyCommon(EXPECTED_TX, expectedLoadLevel, EXCLUDE_DELETED, expected);
}
@Test
@@ -495,14 +496,14 @@ public class DataLoaderFactoryImplTest {
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
- dataLoader.fromTransaction(EXPECTED_TX_ID);
+ dataLoader.fromTransaction(EXPECTED_TX);
dataLoader.includeDeletedArtifacts();
assertEquals(expectedLoadLevel, dataLoader.getLoadLevel());
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_TX_ID, expectedLoadLevel, INCLUDE_DELETED, expected);
+ verifyCommon(EXPECTED_TX, expectedLoadLevel, INCLUDE_DELETED, expected);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -528,7 +529,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected);
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected);
}
@Test
@@ -553,7 +554,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, INCLUDE_DELETED, expected);
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, INCLUDE_DELETED, expected);
}
@Test
@@ -578,7 +579,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected,
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected,
CoreRelationTypes.Default_Hierarchical__Child.getGuid());
}
@@ -605,7 +606,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected, data(JQID),
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected, data(JQID),
list(data(CoreRelationTypes.Default_Hierarchical__Child.getGuid(),
CoreRelationTypes.Dependency__Artifact.getGuid())));
}
@@ -632,7 +633,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected, 45);
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected, 45);
}
@Test
@@ -657,7 +658,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected, data(JQID), list(data(45, 55)));
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected, data(JQID), list(data(45, 55)));
}
@Test
@@ -684,9 +685,8 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected, data(JQID, JQID),
- list(data(45, 55),
- data(CoreRelationTypes.Default_Hierarchical__Child.getGuid(), CoreRelationTypes.Dependency__Artifact)));
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected, data(JQID, JQID), list(data(45, 55),
+ data(CoreRelationTypes.Default_Hierarchical__Child.getGuid(), CoreRelationTypes.Dependency__Artifact)));
}
@Test
@@ -712,7 +712,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected, 45,
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected, 45,
CoreRelationTypes.Default_Hierarchical__Child.getGuid());
}
@@ -732,13 +732,13 @@ public class DataLoaderFactoryImplTest {
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
- dataLoader.fromTransaction(EXPECTED_TX_ID);
+ dataLoader.fromTransaction(EXPECTED_TX);
assertEquals(expectedLoadLevel, dataLoader.getLoadLevel());
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected);
+ verifyCommon(EXPECTED_TX, expectedLoadLevel, EXCLUDE_DELETED, expected);
}
@Test
@@ -764,7 +764,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected);
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected);
}
@Test
@@ -789,7 +789,7 @@ public class DataLoaderFactoryImplTest {
dataLoader.load(cancellation, builder);
- verifyCommon(EXPECTED_HEAD_TX_ID, expectedLoadLevel, EXCLUDE_DELETED, expected,
+ verifyCommon(EXPECTED_HEAD_TX, expectedLoadLevel, EXCLUDE_DELETED, expected,
CoreRelationTypes.Default_Hierarchical__Child.getGuid());
}
@@ -805,23 +805,23 @@ public class DataLoaderFactoryImplTest {
return data;
}
- private void verifyCommon(int txId, LoadLevel level, DeletionFlag includeDeleted, String expectedSQL, Object... params) throws OseeCoreException {
+ private void verifyCommon(TransactionId txId, LoadLevel level, DeletionFlag includeDeleted, String expectedSQL, Object... params) throws OseeCoreException {
verifyCommon(txId, level, includeDeleted, expectedSQL, params, list());
}
- private void verifyCommon(int txId, LoadLevel level, DeletionFlag includeDeleted, String expectedSQL, Object[] params, List<Object[]> joinDatas) throws OseeCoreException {
+ private void verifyCommon(TransactionId txId, LoadLevel level, DeletionFlag includeDeleted, String expectedSQL, Object[] params, List<Object[]> joinDatas) throws OseeCoreException {
verify(spyLoader).loadArtifacts(eq(cancellation), eq(builder), joinCaptor.capture(), criteriaCaptor.capture(),
contextCaptor.capture(), eq(200));
verify(builder, times(1)).onLoadDescription(descriptionCaptor.capture());
LoadDescription descriptor = descriptionCaptor.getValue();
- boolean isHeadTx = EXPECTED_HEAD_TX_ID == txId;
+ boolean isHeadTx = EXPECTED_HEAD_TX.equals(txId);
assertEquals(session, descriptor.getSession());
Options options = descriptor.getOptions();
- assertEquals(COMMON_ID, descriptor.getBranchId());
+ assertEquals(COMMON, descriptor.getBranch());
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 a19cdee6b3..5b3d20714d 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
@@ -22,6 +22,8 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.eclipse.osee.executor.admin.ExecutorAdmin;
+import org.eclipse.osee.framework.core.data.TokenFactory;
+import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
@@ -120,7 +122,7 @@ public class ArtifactQuerySqlContextFactoryImplTest {
// @formatter:on
private final static long EXPECTED_BRANCH_ID = 570;
- private final static int EXPECTED_TX_ID = 45678;
+ private final static TransactionId EXPECTED_TX_ID = TransactionId.valueOf(45678);
private QuerySqlContextFactory queryEngine;
private QueryData queryData;
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java
index dc94404d30..ea78f18a8d 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java
@@ -59,7 +59,7 @@ import org.mockito.stubbing.Answer;
*/
public class TxQuerySqlContextFactoryImplTest {
- private static final Criteria IDS = id(1, 2, 3, 4, 5);
+ private static final Criteria IDS = id(1L, 2L, 3L, 4l, 5L);
private static final Criteria COMMENT = comment("SimpleTemplateProviderTask", false);
private static final Criteria TYPES =
type(Arrays.asList(TransactionDetailsType.Baselined, TransactionDetailsType.NonBaselined));
@@ -298,7 +298,7 @@ public class TxQuerySqlContextFactoryImplTest {
assertEquals(tx, iterator.next());
}
- private static Criteria id(Integer... values) {
+ private static Criteria id(Long... values) {
return new CriteriaTxIds(Arrays.asList(values));
}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java
index 5725d15d40..bb5124d063 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java
@@ -55,8 +55,8 @@ public class TransactionWriterTest {
private static final int QUERY_ID_1 = 88;
private static final int QUERY_ID_2 = 89;
- private static final int TX_1 = 51;
- private static final int TX_2 = 52;
+ private static final long TX_1 = 51;
+ private static final long TX_2 = 52;
private static final long GAMMA_1 = 80000L;
private static final long GAMMA_2 = 80001L;
@@ -111,7 +111,7 @@ public class TransactionWriterTest {
when(jdbcClient.getStatement(connection)).thenReturn(chStmt);
when(chStmt.next()).thenReturn(true).thenReturn(true).thenReturn(false);
- when(chStmt.getInt("transaction_id")).thenReturn(TX_1).thenReturn(TX_2);
+ when(chStmt.getLong("transaction_id")).thenReturn(TX_1).thenReturn(TX_2);
when(chStmt.getLong("gamma_id")).thenReturn(GAMMA_1).thenReturn(GAMMA_2);
}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java
index b85a2e9f0b..33899956c0 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderTest.java
@@ -28,6 +28,7 @@ import java.util.Date;
import java.util.List;
import java.util.Map.Entry;
import org.eclipse.osee.framework.core.data.RelationalConstants;
+import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.core.enums.TxChange;
@@ -40,11 +41,11 @@ import org.eclipse.osee.orcs.core.ds.OrcsChangeSet;
import org.eclipse.osee.orcs.core.ds.OrcsData;
import org.eclipse.osee.orcs.core.ds.RelationData;
import org.eclipse.osee.orcs.core.ds.VersionData;
-import org.eclipse.osee.orcs.data.TransactionReadable;
import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.loader.data.ArtifactDataImpl;
import org.eclipse.osee.orcs.db.internal.loader.data.AttributeDataImpl;
import org.eclipse.osee.orcs.db.internal.loader.data.RelationDataImpl;
+import org.eclipse.osee.orcs.db.internal.loader.data.TransactionDataImpl;
import org.eclipse.osee.orcs.db.internal.loader.data.VersionDataImpl;
import org.eclipse.osee.orcs.db.internal.sql.join.IdJoinQuery;
import org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory;
@@ -59,7 +60,7 @@ import org.mockito.stubbing.Answer;
/**
* Test Case for {@link TxSqlBuilderImpl}
- *
+ *
* @author Roberto E. Escobar
*/
public class TxSqlBuilderTest {
@@ -68,8 +69,8 @@ public class TxSqlBuilderTest {
private static final List<ModificationType> MODS_REUSE_ROW =
Arrays.asList(ARTIFACT_DELETED, DELETED, INTRODUCED, REPLACED_WITH_VERSION);
- private static final int EXPECTED_TX_ID = 10000;
- private static final int LOADED_TX_ID = 567;
+ private static final TransactionId EXPECTED_TX = TransactionId.valueOf(10000);
+ private static final TransactionId LOADED_TX_ID = TransactionId.valueOf(567);
private static final int EXPECTED_COMMIT_ID = 46;
private static final long EXPECTED_BRANCH_ID = 65L;
private static final int EXPECTED_AUTHOR_ID = 89;
@@ -94,8 +95,7 @@ public class TxSqlBuilderTest {
// @formatter:off
@Mock private SqlJoinFactory joinFactory;
@Mock private IdentityManager idManager;
-
- @Mock private TransactionReadable tx;
+
@Mock private OrcsChangeSet txData;
@Mock private DataProxy dataProxy;
@@ -108,6 +108,7 @@ public class TxSqlBuilderTest {
private ArtifactData artData;
private AttributeData attrData;
private RelationData relData;
+ private final TransactionDataImpl tx = new TransactionDataImpl(EXPECTED_TX.getId());
@Before
public void setUp() throws OseeCoreException {
@@ -140,13 +141,12 @@ public class TxSqlBuilderTest {
relData.setArtIdB(B_ART_ID);
relData.setRationale(RATIONALE);
- when(tx.getGuid()).thenReturn(EXPECTED_TX_ID);
- when(tx.getAuthorId()).thenReturn(EXPECTED_AUTHOR_ID);
- when(tx.getBranchId()).thenReturn(EXPECTED_BRANCH_ID);
- when(tx.getComment()).thenReturn(EXPECTED_COMMENT);
- when(tx.getCommit()).thenReturn(EXPECTED_COMMIT_ID);
- when(tx.getDate()).thenReturn(EXPECTED_TX_TIME);
- when(tx.getTxType()).thenReturn(EXPECTED_TX_TYPE);
+ tx.setAuthorId(EXPECTED_AUTHOR_ID);
+ tx.setBranchId(EXPECTED_BRANCH_ID);
+ tx.setComment(EXPECTED_COMMENT);
+ tx.setCommit(EXPECTED_COMMIT_ID);
+ tx.setDate(EXPECTED_TX_TIME);
+ tx.setTxType(EXPECTED_TX_TYPE);
when(idManager.getNextGammaId()).thenReturn(NEXT_GAMMA_ID);
@@ -181,7 +181,7 @@ public class TxSqlBuilderTest {
assertEquals(1, datas.size());
Object[] data = datas.iterator().next();
int index = 0;
- assertEquals(EXPECTED_TX_ID, data[index++]);
+ assertEquals(EXPECTED_TX, data[index++]);
assertEquals(EXPECTED_COMMENT, data[index++]);
assertEquals(EXPECTED_TX_TIME, data[index++]);
assertEquals(EXPECTED_AUTHOR_ID, data[index++]);
@@ -202,7 +202,7 @@ public class TxSqlBuilderTest {
// @formatter:off
verifyRow(SqlOrderEnum.ARTIFACTS, ITEM_ID, TYPE_UUID, NEXT_GAMMA_ID, EXP_GUID);
- verifyRow(SqlOrderEnum.TXS, EXPECTED_TX_ID, NEXT_GAMMA_ID, modType.getValue(), TxChange.CURRENT.getValue(), EXPECTED_BRANCH_ID);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, NEXT_GAMMA_ID, modType.getValue(), TxChange.CURRENT.getValue(), EXPECTED_BRANCH_ID);
verifyQuery(SqlOrderEnum.ARTIFACTS);
// @formatter:on
@@ -224,7 +224,7 @@ public class TxSqlBuilderTest {
ModificationType expectedType = modType != REPLACED_WITH_VERSION ? modType : MODIFIED;
// @formatter:off
- verifyRow(SqlOrderEnum.TXS, EXPECTED_TX_ID, -1L, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), EXPECTED_BRANCH_ID);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, -1L, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), EXPECTED_BRANCH_ID);
verifyQuery(SqlOrderEnum.ARTIFACTS);
// @formatter:on
@@ -238,7 +238,7 @@ public class TxSqlBuilderTest {
// test new artData that is deleted adds no rows
artData.setModType(ModificationType.DELETED);
- artData.getVersion().setTransactionId(RelationalConstants.TRANSACTION_SENTINEL);
+ artData.getVersion().setTransactionId(TransactionId.SENTINEL);
builder.visit(artData);
@@ -272,7 +272,7 @@ public class TxSqlBuilderTest {
// @formatter:off
verifyRow(SqlOrderEnum.RELATIONS, ITEM_ID, TYPE_UUID, NEXT_GAMMA_ID, A_ART_ID, B_ART_ID, RATIONALE);
- verifyRow(SqlOrderEnum.TXS, EXPECTED_TX_ID, NEXT_GAMMA_ID, modType.getValue(), TxChange.CURRENT.getValue(), EXPECTED_BRANCH_ID);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, NEXT_GAMMA_ID, modType.getValue(), TxChange.CURRENT.getValue(), EXPECTED_BRANCH_ID);
verifyQuery(SqlOrderEnum.RELATIONS);
// @formatter:on
@@ -294,7 +294,7 @@ public class TxSqlBuilderTest {
ModificationType expectedType = modType != REPLACED_WITH_VERSION ? modType : MODIFIED;
// @formatter:off
- verifyRow(SqlOrderEnum.TXS, EXPECTED_TX_ID, -1L, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), EXPECTED_BRANCH_ID);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, -1L, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), EXPECTED_BRANCH_ID);
verifyQuery(SqlOrderEnum.RELATIONS);
// @formatter:on
@@ -316,7 +316,7 @@ public class TxSqlBuilderTest {
// @formatter:off
verifyRow(SqlOrderEnum.ATTRIBUTES, ITEM_ID, TYPE_UUID, NEXT_GAMMA_ID, ATTR_ARTIFACT_ID, ATTR_VALUE, ATTR_URI);
- verifyRow(SqlOrderEnum.TXS, EXPECTED_TX_ID, NEXT_GAMMA_ID, modType.getValue(), TxChange.CURRENT.getValue(), EXPECTED_BRANCH_ID);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, NEXT_GAMMA_ID, modType.getValue(), TxChange.CURRENT.getValue(), EXPECTED_BRANCH_ID);
verifyQuery(SqlOrderEnum.ATTRIBUTES);
// @formatter:on
@@ -350,7 +350,7 @@ public class TxSqlBuilderTest {
ModificationType expectedType = modType != REPLACED_WITH_VERSION ? modType : MODIFIED;
// @formatter:off
- verifyRow(SqlOrderEnum.TXS, EXPECTED_TX_ID, -1L, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), EXPECTED_BRANCH_ID);
+ verifyRow(SqlOrderEnum.TXS, EXPECTED_TX, -1L, expectedType.getValue(), TxChange.getCurrent(expectedType).getValue(), EXPECTED_BRANCH_ID);
verifyQuery(SqlOrderEnum.ATTRIBUTES);
// @formatter:on

Back to the top