diff options
14 files changed, 144 insertions, 74 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF index d77c963c24e..017742db792 100644 --- a/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF @@ -78,6 +78,8 @@ Import-Package: javax.ws.rs.core;version="2.0.0", org.eclipse.osee.framework.ui.swt, org.eclipse.osee.jaxrs.client, org.eclipse.osee.jdbc, + org.eclipse.osee.orcs.rest.client, + org.eclipse.osee.orcs.rest.model, org.eclipse.osee.support.test.util Export-Package: org.eclipse.osee.ats.client.demo, diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java index 9382f12cff0..26ab0e93c8a 100644 --- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java +++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java @@ -41,6 +41,7 @@ import org.eclipse.osee.framework.core.data.ArtifactToken; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.core.exception.OseeWrappedException; +import org.eclipse.osee.framework.core.util.OsgiUtil; import org.eclipse.osee.framework.database.init.IDbInitializationTask; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts; @@ -52,6 +53,8 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction; import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager; import org.eclipse.osee.framework.skynet.core.utility.Requirements; +import org.eclipse.osee.orcs.rest.client.OseeClient; +import org.eclipse.osee.orcs.rest.model.ApplicabilityEndpoint; import org.eclipse.osee.support.test.util.TestUtil; /** @@ -70,6 +73,10 @@ public class DemoDatabaseConfig implements IDbInitializationTask { BranchManager.createTopLevelBranch(SAW_Bld_1); populateProgramBranch(SAW_Bld_1); + ApplicabilityEndpoint applEndpoint = + OsgiUtil.getService(getClass(), OseeClient.class).getApplicabilityEndpoint(SAW_Bld_1); + applEndpoint.createDemoApplicability(); + // Create build one branch for CIS BranchManager.createTopLevelBranch(CIS_Bld_1); populateProgramBranch(CIS_Bld_1); @@ -337,7 +344,6 @@ public class DemoDatabaseConfig implements IDbInitializationTask { sawProduct.persist(getClass().getSimpleName()); programRoot.persist(getClass().getSimpleName()); - } } diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ApplicabilityQueryImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ApplicabilityQueryImpl.java index 656c3c15cf5..8d75f49e01d 100644 --- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ApplicabilityQueryImpl.java +++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ApplicabilityQueryImpl.java @@ -24,6 +24,7 @@ import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.enums.CoreTupleTypes; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.orcs.data.ArtifactReadable; +import org.eclipse.osee.framework.jdk.core.type.HashCollection; import org.eclipse.osee.orcs.search.ApplicabilityQuery; import org.eclipse.osee.orcs.search.TupleQuery; @@ -102,4 +103,21 @@ public class ApplicabilityQueryImpl implements ApplicabilityQuery { } return featureDefinition; } + + @Override + public HashCollection<String, String> getBranchViewFeatureValues(ArtifactId artId, BranchId branch) { + HashCollection<String, String> toReturn = new HashCollection<>(); + List<ApplicabilityToken> result = new ArrayList<>(); + BiConsumer<Long, String> consumer = (id, name) -> result.add(new ApplicabilityToken(id, name)); + tupleQuery.getTuple2KeyValuePair(CoreTupleTypes.ViewApplicability, artId, branch, consumer); + + for (ApplicabilityToken app : result) { + if (!app.getName().equals("Base")) { + String[] nameValue = app.getName().split("="); + toReturn.put(nameValue[0].trim(), nameValue[1].trim()); + } + } + + return toReturn; + } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.orcs.db.mock/data/binary_data.zip b/plugins/org.eclipse.osee.orcs.db.mock/data/binary_data.zip Binary files differindex fa798cb3b4e..50213dcb48a 100644 --- a/plugins/org.eclipse.osee.orcs.db.mock/data/binary_data.zip +++ b/plugins/org.eclipse.osee.orcs.db.mock/data/binary_data.zip diff --git a/plugins/org.eclipse.osee.orcs.db.mock/data/hsql.zip b/plugins/org.eclipse.osee.orcs.db.mock/data/hsql.zip Binary files differindex 9102f85784e..4abf8ad6bac 100644 --- a/plugins/org.eclipse.osee.orcs.db.mock/data/hsql.zip +++ b/plugins/org.eclipse.osee.orcs.db.mock/data/hsql.zip 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 2345285cdf3..709e658d2bb 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 @@ -163,10 +163,10 @@ public class LoaderTest { verifyData(attrs.next(), 6, OseeTypesFrameworkId, NEW, UriGeneralStringData.getId(), COMMON,tx5, 15L, "", "attr://15/"+OseeTypesFrameworkGuid+".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(), 11, OseeTypesDemoId, NEW, Name.getId(), COMMON,tx5, 20L, "org.eclipse.osee.client.demo.OseeTypes_ClientDemo", ""); verifyData(attrs.next(), 12, OseeTypesDemoId, NEW, UriGeneralStringData.getId(), COMMON,tx5, 21L, "", "attr://21/"+OseeTypesDemoGuid+".zip"); - verifyData(attrs.next(), 20, UserGroupsId, NEW, Name.getId(), COMMON, tx7, 46L, "User Groups", ""); + verifyData(attrs.next(), 20, UserGroupsId, NEW, Name.getId(), COMMON, tx7, 70L, "User Groups", ""); // @formatter:on sort(relationCaptor.getAllValues()); @@ -177,22 +177,21 @@ public class LoaderTest { private void verifyRels(Iterator<RelationData> rels) { verifyData(rels.next(), 1, UserGroupsId, 48656, "", NEW, Default_Hierarchical__Parent.getGuid(), COMMON, tx7, - 43L); + 40L); 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(), COMMON, tx7, - 40L); + verifyData(rels.next(), 3, UserGroupsId, 52247, "", NEW, Default_Hierarchical__Parent.getGuid(), COMMON, tx7, 6L); verifyData(rels.next(), 9, UserGroupsId, 8033605, "", NEW, Default_Hierarchical__Parent.getGuid(), COMMON, tx10, - 111L); + 107L); verifyData(rels.next(), 10, UserGroupsId, 136750, "", NEW, Default_Hierarchical__Parent.getGuid(), COMMON, tx10, - 109L); + 106L); verifyData(rels.next(), 11, UserGroupsId, 5367074, "", NEW, Default_Hierarchical__Parent.getGuid(), COMMON, tx10, - 110L); + 105L); } private void verifyArts(Iterator<ArtifactData> arts) { // @formatter:off - verifyData(arts.next(), UserGroupsId, UserGroupsGuid, NEW, Folder.getId(), COMMON, tx7, 71L); + verifyData(arts.next(), UserGroupsId, UserGroupsGuid, NEW, Folder.getId(), COMMON, tx7, 47L); verifyData(arts.next(), OseeTypesDemoId, OseeTypesDemoGuid, NEW, OseeTypeDefinition.getId(), COMMON, tx5, 10L); verifyData(arts.next(), OseeTypesFrameworkId, OseeTypesFrameworkGuid, NEW, OseeTypeDefinition.getId(), COMMON, tx5, 8L); // @formatter:on @@ -230,8 +229,8 @@ public class LoaderTest { // @formatter:off 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", ""); + verifyData(attrs.next(), 11, OseeTypesDemoId, NEW, Name.getId(), COMMON,tx5, 20L, "org.eclipse.osee.client.demo.OseeTypes_ClientDemo", ""); + verifyData(attrs.next(), 20, UserGroupsId, NEW, Name.getId(), COMMON, tx7, 70L, "User Groups", ""); // @formatter:on sort(relationCaptor.getAllValues()); @@ -282,7 +281,7 @@ public class LoaderTest { 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(), COMMON, tx7, - 40L); + 6L); // @formatter:on } diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/TupleQueryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/TupleQueryImpl.java index b233dfb106a..ba0dc10cb02 100644 --- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/TupleQueryImpl.java +++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/engines/TupleQueryImpl.java @@ -37,6 +37,9 @@ public class TupleQueryImpl implements TupleQuery { private static final String SELECT_E2_BY_TUPLE_TYPE = "select distinct e2, value from osee_txs txs, osee_tuple2 app, osee_key_value where tuple_type = ? and app.gamma_id = txs.gamma_id and branch_id = ? and tx_current = 1 and e2 = key"; + private static final String SELECT_KEY_VALUE_FROM_BRANCH_VIEW = + "SELECT distinct e2, value from osee_tuple2 app, osee_txs txs1, osee_key_value where app.e1 = ? and tuple_type = ? and app.gamma_id = txs1.gamma_id and txs1.branch_id = ? AND txs1.tx_current = 1 and app.e2 = key"; + private static final String SELECT_TUPLE3_E1_BY_TUPLE_TYPE = "select distinct e1, value from osee_txs txs, osee_tuple3 app, osee_key_value where tuple_type = ? and app.gamma_id = txs.gamma_id and branch_id = ? and tx_current = 1 and e1 = key"; @@ -85,6 +88,11 @@ public class TupleQueryImpl implements TupleQuery { } @Override + public <E1, E2> void getTuple2KeyValuePair(Tuple2Type<E1, E2> tupleType, ArtifactId artId, BranchId branchId, BiConsumer<Long, String> consumer) { + runQuery(consumer, SELECT_KEY_VALUE_FROM_BRANCH_VIEW, "e2", artId, tupleType, branchId); + } + + @Override public <E1, E2> void getTuple2UniqueE2Pair(Tuple2Type<E1, E2> tupleType, BranchId branchId, BiConsumer<Long, String> consumer) { runQuery(consumer, SELECT_E2_BY_TUPLE_TYPE, "e2", tupleType, branchId); } diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchQueryTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchQueryTest.java index 786db459c96..5f79397101f 100644 --- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchQueryTest.java +++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchQueryTest.java @@ -92,10 +92,10 @@ public class OrcsBranchQueryTest { // list, IOseeBranch, BranchType, BranchState, isArchived, parentId, baseTx, sourceTx, assocArtId assertBranch(list, SYSTEM_ROOT, BranchType.SYSTEM_ROOT, MODIFIED, false, BranchId.SENTINEL, ArtifactId.SENTINEL); - assertBranch(list, SAW_Bld_1, BASELINE, MODIFIED, false, SYSTEM_ROOT, ArtifactId.SENTINEL); - assertBranch(list, CIS_Bld_1, BASELINE, MODIFIED, false, SYSTEM_ROOT, ArtifactId.SENTINEL); - assertBranch(list, SAW_Bld_2, BASELINE, MODIFIED, false, SAW_Bld_1, SystemUser.OseeSystem); - assertBranch(list, COMMON, BASELINE, MODIFIED, false, SYSTEM_ROOT, ArtifactId.SENTINEL); + assertBranch(list, SAW_Bld_1, BASELINE, MODIFIED, false, SYSTEM_ROOT, ArtifactId.valueOf(SystemUser.OseeSystem.getId())); + assertBranch(list, CIS_Bld_1, BASELINE, MODIFIED, false, SYSTEM_ROOT, ArtifactId.valueOf(SystemUser.OseeSystem.getId())); + assertBranch(list, SAW_Bld_2, BASELINE, MODIFIED, false, SAW_Bld_1, ArtifactId.valueOf(SystemUser.OseeSystem.getId())); + assertBranch(list, COMMON, BASELINE, MODIFIED, false, SYSTEM_ROOT, ArtifactId.valueOf(SystemUser.OseeSystem.getId())); } @Test diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java index 077f6ada6f8..39fb9f2635e 100644 --- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java +++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java @@ -97,9 +97,9 @@ public class OrcsQueryTest { @Test public void testAllArtifactsFromBranch() throws OseeCoreException { QueryBuilder builder = factory.fromBranch(COMMON_ID); - assertEquals(252, builder.getCount()); + assertEquals(245, builder.getCount()); - assertEquals(252, builder.getResults().size()); + assertEquals(245, builder.getResults().size()); } @Test @@ -113,7 +113,7 @@ public class OrcsQueryTest { public void testAttributeNotExists() { QueryBuilder builder = factory.fromBranch(COMMON_ID); builder.andNotExists(CoreAttributeTypes.Afha); - assertTrue(builder.getCount() >= 252); + assertTrue(builder.getCount() >= 245); } @Test @@ -258,9 +258,9 @@ public class OrcsQueryTest { List<IAttributeType> attributeTypes = Arrays.asList(CoreAttributeTypes.ContentUrl, CoreAttributeTypes.Name); builder.andNotExists(attributeTypes); - assertTrue(builder.getCount() >= 252); + assertTrue(builder.getCount() >= 245); ResultSet<ArtifactReadable> artifacts = builder.getResults(); - assertTrue(artifacts.size() >= 252); + assertTrue(artifacts.size() >= 245); Collection<String> names = Lib.getNames(artifacts.getList()); @@ -410,11 +410,12 @@ public class OrcsQueryTest { .followRelation(CoreRelationTypes.Default_Hierarchical__Child); ResultSet<ArtifactReadable> results = builder.getResults(); - assertEquals(8, results.size()); + assertEquals(9, results.size()); Iterator<String> iterator = getNames(results).iterator(); assertEquals("Hardware Requirements", iterator.next()); assertEquals("Integration Tests", iterator.next()); + assertEquals("Product Line", iterator.next()); assertEquals("SAW Product Decomposition", iterator.next()); assertEquals("Software Requirements", iterator.next()); assertEquals("Subsystem Requirements", iterator.next()); diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsScriptTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsScriptTest.java index eca1d4e1483..2b080fa0b05 100644 --- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsScriptTest.java +++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsScriptTest.java @@ -81,7 +81,7 @@ public class OrcsScriptTest { " 'results' : [ {\n" + // " 'branches' : [ {\n" + // " 'archived' : 'UNARCHIVED',\n" + // - " 'assoc-id' : -1,\n" + // + " 'assoc-id' : 11,\n" + // " 'baseline-tx-id' : 4,\n" + // " 'id' : 570,\n" + // " 'inherits-access-control' : 0,\n" + // @@ -109,7 +109,7 @@ public class OrcsScriptTest { " }, {\n" + // " 'name' : 'Common'\n" + // " }, {\n" + // - " 'name' : 'ATS9 - SAW (uncommitted) More Reqt Changes for...'\n" + // + " 'name' : 'ATS6 - SAW (uncommitted) More Reqt Changes for...'\n" + // " }, {\n" + // " 'name' : 'ATS20 - SAW (uncommitted-conflicted) More Requi...'\n" + // " } ]\n" + // @@ -171,19 +171,19 @@ public class OrcsScriptTest { " }\n" + // " }\n" + // " }, {\n" + // - " 'id' : 545949432,\n" + // - " 'attributes' : {\n" + // - " 'Name' : {\n" + // - " 'value' : 'Sprints'\n" + // - " }\n" + // - " }\n" + // - " }, {\n" + // - " 'id' : 849027577,\n" + // + " 'id' : 407107128,\n" + // " 'attributes' : {\n" + // " 'Name' : {\n" + // " 'value' : 'Feature Groups'\n" + // " }\n" + // - " }\n" + // + " }\n " + // + " }, {\n" + // + " 'id' : 1691279068,\n" + // + " 'attributes' : {\n" + // + " 'Name' : {\n" + // + " 'value' : 'Sprints'\n" + // + " }\n" + // + " }\n" + // " } ]\n" + // " } ]\n" + // "}"); diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTupleTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTupleTest.java index 19d7d02d674..b3746e52f6a 100644 --- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTupleTest.java +++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTupleTest.java @@ -11,12 +11,23 @@ package org.eclipse.osee.orcs.api; import static org.eclipse.osee.framework.core.enums.SystemUser.OseeSystem; +import java.util.ArrayList; +import java.util.List; +import java.util.function.BiConsumer; +import org.eclipse.osee.framework.core.data.ApplicabilityToken; +import org.eclipse.osee.framework.core.data.ArtifactId; +import org.eclipse.osee.framework.core.data.TokenFactory; import org.eclipse.osee.framework.core.data.TupleTypeId; +import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreBranches; +import org.eclipse.osee.framework.core.enums.CoreTupleTypes; +import org.eclipse.osee.framework.core.enums.DemoBranches; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; +import org.eclipse.osee.framework.jdk.core.type.ResultSet; import org.eclipse.osee.jdbc.JdbcException; import org.eclipse.osee.orcs.KeyValueOps; import org.eclipse.osee.orcs.OrcsApi; +import org.eclipse.osee.orcs.data.ArtifactReadable; import org.eclipse.osee.orcs.db.mock.OrcsIntegrationByClassRule; import org.eclipse.osee.orcs.db.mock.OseeClassDatabase; import org.eclipse.osee.orcs.db.mock.OsgiService; @@ -107,4 +118,19 @@ public class OrcsTupleTest { gamma_id = transaction.addTuple(createTuple4Type, 244L, 12L, "four", "four2"); transaction.commit(); } + + @Test + public void testGetTupleType2() throws OseeCoreException { + ResultSet<ArtifactReadable> branchViewArts = + orcsApi.getQueryFactory().fromBranch(DemoBranches.SAW_Bld_1.getId()).andTypeEquals( + CoreArtifactTypes.BranchView).getResults(); + List<ApplicabilityToken> result = new ArrayList<>(); + + BiConsumer<Long, String> consumer = (id, name) -> result.add(new ApplicabilityToken(id, name)); + orcsApi.getQueryFactory().tupleQuery().getTuple2KeyValuePair(CoreTupleTypes.ViewApplicability, + ArtifactId.valueOf(branchViewArts.getList().get(0).getId()), + TokenFactory.createBranch(DemoBranches.SAW_Bld_1.getId()), consumer); + + Assert.assertEquals(5, result.size()); + } } diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTxQueryTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTxQueryTest.java index 9d787f147c9..c129ca94f7a 100644 --- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTxQueryTest.java +++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTxQueryTest.java @@ -69,8 +69,8 @@ public class OrcsTxQueryTest { private final static DateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); private QueryFactory factory; private final ArtifactId JoeSmith = ArtifactId.valueOf(61106791); - private final Long CommonBranchHeadTransaction = 117L; - private final String CommonBranchTransComment = "Create new Agile Feature Group"; + private final Long CommonBranchHeadTransaction = 123L; + private final String CommonBranchTransComment = "Cleanup PopulateDemoActionsTest"; private final int NumberCommonTransactions = 77; @Before @@ -115,9 +115,9 @@ public class OrcsTxQueryTest { TransactionReadable actual = query.getResults().getExactlyOne(); assertEquals(1, query.getCount()); - assertTx(Arrays.asList(actual), Long.valueOf(26), Baselined, "Branch Creation for SAW_Bld_1", SAW_Bld_1, + assertTx(Arrays.asList(actual), Long.valueOf(30), Baselined, "Branch Creation for SAW_Bld_1", SAW_Bld_1, OseeSystem); - assertEquals(Long.valueOf(26), query.getResultsAsIds().getExactlyOne()); + assertEquals(Long.valueOf(30), query.getResultsAsIds().getExactlyOne()); } @Test @@ -142,11 +142,15 @@ public class OrcsTxQueryTest { assertEquals(8, query.getCount()); List<TransactionReadable> transactions = results.getList(); - assertTx(transactions, Long.valueOf(1), Baselined, "System Root Branch Creation", SYSTEM_ROOT, OseeSystem); - assertTx(transactions, Long.valueOf(4), Baselined, "Branch Creation for Common", COMMON, OseeSystem); - assertTx(transactions, Long.valueOf(26), Baselined, "Branch Creation for SAW_Bld_1", SAW_Bld_1, OseeSystem); - assertTx(transactions, Long.valueOf(28), Baselined, "Branch Creation for CIS_Bld_1", CIS_Bld_1, OseeSystem); - assertTx(transactions, Long.valueOf(66), Baselined, "Branch Creation for SAW_Bld_2", SAW_Bld_2, JoeSmith); + assertTx(transactions, Long.valueOf(1), Baselined, "System Root Branch Creation", SYSTEM_ROOT, + ArtifactId.valueOf(OseeSystem.getId())); + assertTx(transactions, Long.valueOf(4), Baselined, "Branch Creation for Common", COMMON, + ArtifactId.valueOf(OseeSystem.getId())); + assertTx(transactions, Long.valueOf(30), Baselined, "Branch Creation for SAW_Bld_1", SAW_Bld_1, + ArtifactId.valueOf(OseeSystem.getId())); + assertTx(transactions, Long.valueOf(33), Baselined, "Branch Creation for CIS_Bld_1", CIS_Bld_1, + ArtifactId.valueOf(OseeSystem.getId())); + assertTx(transactions, Long.valueOf(71), Baselined, "Branch Creation for SAW_Bld_2", SAW_Bld_2, JoeSmith); } @Test @@ -159,9 +163,9 @@ public class OrcsTxQueryTest { assertEquals(4, query.getCount()); List<TransactionReadable> transactions = results.getList(); - assertTx(transactions, Long.valueOf(28), Baselined, "Branch Creation for CIS_Bld_1", CIS_Bld_1, OseeSystem); - assertTx(transactions, Long.valueOf(66), Baselined, "Branch Creation for SAW_Bld_2", SAW_Bld_2, JoeSmith); - + assertTx(transactions, Long.valueOf(33), Baselined, "Branch Creation for CIS_Bld_1", CIS_Bld_1, + ArtifactId.valueOf(OseeSystem.getId())); + assertTx(transactions, Long.valueOf(71), Baselined, "Branch Creation for SAW_Bld_2", SAW_Bld_2, JoeSmith); } @Test @@ -170,19 +174,20 @@ public class OrcsTxQueryTest { query.andBranch(SAW_Bld_1, CIS_Bld_1); ResultSet<TransactionReadable> results = query.getResults(); - assertEquals(8, results.size()); - assertEquals(8, query.getCount()); + assertEquals(9, results.size()); + assertEquals(9, query.getCount()); List<TransactionReadable> transactions = results.getList(); //@formatter:off - assertTx(transactions, Long.valueOf(26), Baselined, "Branch Creation for SAW_Bld_1", SAW_Bld_1, OseeSystem); - assertTx(transactions, Long.valueOf(27), NonBaselined, "DemoDatabaseConfig", SAW_Bld_1, OseeSystem); - assertTx(transactions, Long.valueOf(28), Baselined, "Branch Creation for CIS_Bld_1", CIS_Bld_1, OseeSystem); - assertTx(transactions, Long.valueOf(29), NonBaselined, "DemoDatabaseConfig", CIS_Bld_1,OseeSystem); - assertTx(transactions, Long.valueOf(62), NonBaselined, "ArtifactImportOperationFactory: Artifact Import Wizard transaction", SAW_Bld_1, JoeSmith); - assertTx(transactions, Long.valueOf(63), NonBaselined, "ArtifactImportOperationFactory: Artifact Import Wizard transaction", SAW_Bld_1, JoeSmith); - assertTx(transactions, Long.valueOf(64), NonBaselined, "ArtifactImportOperationFactory: Artifact Import Wizard transaction", SAW_Bld_1, JoeSmith); - assertTx(transactions, Long.valueOf(65), NonBaselined, "Populate Demo DB - Create Traceability", SAW_Bld_1, JoeSmith); + assertTx(transactions, Long.valueOf(30), Baselined, "Branch Creation for SAW_Bld_1", SAW_Bld_1, ArtifactId.valueOf(OseeSystem.getId())); + assertTx(transactions, Long.valueOf(31), NonBaselined, "DemoDatabaseConfig", SAW_Bld_1, ArtifactId.valueOf(OseeSystem.getId())); + assertTx(transactions, Long.valueOf(32), NonBaselined, "Create Demo Applicability", SAW_Bld_1, ArtifactId.valueOf(OseeSystem.getId())); + assertTx(transactions, Long.valueOf(33), Baselined, "Branch Creation for CIS_Bld_1", CIS_Bld_1, ArtifactId.valueOf(OseeSystem.getId())); + assertTx(transactions, Long.valueOf(34), NonBaselined, "DemoDatabaseConfig", CIS_Bld_1,ArtifactId.valueOf(OseeSystem.getId())); + assertTx(transactions, Long.valueOf(67), NonBaselined, "ArtifactImportOperationFactory: Artifact Import Wizard transaction", SAW_Bld_1, JoeSmith); + assertTx(transactions, Long.valueOf(68), NonBaselined, "ArtifactImportOperationFactory: Artifact Import Wizard transaction", SAW_Bld_1, JoeSmith); + assertTx(transactions, Long.valueOf(69), NonBaselined, "ArtifactImportOperationFactory: Artifact Import Wizard transaction", SAW_Bld_1, JoeSmith); + assertTx(transactions, Long.valueOf(70), NonBaselined, "Populate Demo DB - Create Traceability", SAW_Bld_1, JoeSmith); //@formatter:on } @@ -251,7 +256,7 @@ public class OrcsTxQueryTest { results = query.getResults(); transactions = results.getList(); - assertEquals(NumberCommonTransactions - 1, results.size()); + assertEquals(NumberCommonTransactions - 1 + 5, results.size()); } @Test @@ -317,23 +322,23 @@ public class OrcsTxQueryTest { TransactionQuery query = factory.transactionQuery(); query.andAuthorLocalIds(OseeSystem); ResultSet<TransactionReadable> results = query.getResults(); - assertEquals(72, results.size()); - assertEquals(72, query.getCount()); + assertEquals(77, results.size()); + assertEquals(77, query.getCount()); List<TransactionReadable> transactions = results.getList(); - assertTx(transactions, Long.valueOf(28), Baselined, "Branch Creation for CIS_Bld_1", CIS_Bld_1, OseeSystem); + assertTx(transactions, Long.valueOf(33), Baselined, "Branch Creation for CIS_Bld_1", CIS_Bld_1, OseeSystem); query = factory.transactionQuery(); query.andAuthorLocalIds(OseeSystem, JoeSmith); results = query.getResults(); - assertEquals(117, results.size()); - assertEquals(117, query.getCount()); + assertEquals(123, results.size()); + assertEquals(123, query.getCount()); transactions = results.getList(); //@formatter:off - assertTx(transactions, Long.valueOf(28), Baselined, "Branch Creation for CIS_Bld_1", CIS_Bld_1, OseeSystem); - assertTx(transactions, Long.valueOf(62), NonBaselined, "ArtifactImportOperationFactory: Artifact Import Wizard transaction", SAW_Bld_1, JoeSmith); - assertTx(transactions, CommonBranchHeadTransaction, NonBaselined, CommonBranchTransComment, COMMON, OseeSystem); + assertTx(transactions, Long.valueOf(33), Baselined, "Branch Creation for CIS_Bld_1", CIS_Bld_1, ArtifactId.valueOf(OseeSystem.getId())); + assertTx(transactions, Long.valueOf(67), NonBaselined, "ArtifactImportOperationFactory: Artifact Import Wizard transaction", SAW_Bld_1, JoeSmith); + assertTx(transactions, CommonBranchHeadTransaction, NonBaselined, CommonBranchTransComment, COMMON, JoeSmith); //@formatter:on query = factory.transactionQuery(); @@ -342,14 +347,14 @@ public class OrcsTxQueryTest { list.add(JoeSmith); query.andAuthorLocalIds(list); results = query.getResults(); - assertEquals(117, results.size()); - assertEquals(117, query.getCount()); + assertEquals(123, results.size()); + assertEquals(123, query.getCount()); transactions = results.getList(); //@formatter:off - assertTx(transactions, Long.valueOf(28), Baselined, "Branch Creation for CIS_Bld_1", CIS_Bld_1, OseeSystem); - assertTx(transactions, Long.valueOf(62), NonBaselined, "ArtifactImportOperationFactory: Artifact Import Wizard transaction", SAW_Bld_1, JoeSmith); - assertTx(transactions, CommonBranchHeadTransaction, NonBaselined, CommonBranchTransComment, COMMON, OseeSystem); + assertTx(transactions, Long.valueOf(33), Baselined, "Branch Creation for CIS_Bld_1", CIS_Bld_1, ArtifactId.valueOf(OseeSystem.getId())); + assertTx(transactions, Long.valueOf(67), NonBaselined, "ArtifactImportOperationFactory: Artifact Import Wizard transaction", SAW_Bld_1, JoeSmith); + assertTx(transactions, CommonBranchHeadTransaction, NonBaselined, CommonBranchTransComment, COMMON, JoeSmith); //@formatter:on } @@ -359,7 +364,7 @@ public class OrcsTxQueryTest { TransactionQuery query = factory.transactionQuery(); query.andNullCommitId(); ResultSet<TransactionReadable> results = query.getResults(); - assertEquals(116, query.getCount()); + assertEquals(122, query.getCount()); List<TransactionReadable> transactions = results.getList(); assertTxExists(transactions, Long.valueOf(1)); @@ -413,7 +418,7 @@ public class OrcsTxQueryTest { assertEquals(1, results.size()); List<TransactionReadable> transactions = results.getList(); - assertTx(transactions, CommonBranchHeadTransaction, NonBaselined, CommonBranchTransComment, COMMON, OseeSystem); + assertTx(transactions, CommonBranchHeadTransaction, NonBaselined, CommonBranchTransComment, COMMON, JoeSmith); } @Test @@ -430,14 +435,14 @@ public class OrcsTxQueryTest { TransactionQuery query = factory.transactionQuery(); query.andAuthorLocalIds(joeArt); - assertEquals(45, query.getCount()); + assertEquals(46, query.getCount()); /********************************************************** * Only valid user is 17. Verify the multiple entry by entering the same user twice */ query = factory.transactionQuery(); query.andAuthorLocalIds(joeArt, joeArt); - assertEquals(45, query.getCount()); + assertEquals(46, query.getCount()); } diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/ApplicabilityQuery.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/ApplicabilityQuery.java index 49a7c35e01f..dc03cf1e858 100644 --- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/ApplicabilityQuery.java +++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/ApplicabilityQuery.java @@ -17,6 +17,7 @@ import org.eclipse.osee.framework.core.data.ArtifactId; import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.FeatureDefinitionData; import org.eclipse.osee.orcs.data.ArtifactReadable; +import org.eclipse.osee.framework.jdk.core.type.HashCollection; /** * @author Ryan D. Brooks @@ -32,4 +33,6 @@ public interface ApplicabilityQuery { HashMap<Long, ApplicabilityToken> getApplicabilityTokens(BranchId branch); List<FeatureDefinitionData> getFeatureDefinitionData(List<ArtifactReadable> featureDefinitionArts); + + HashCollection<String, String> getBranchViewFeatureValues(ArtifactId artId, BranchId branch); }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/TupleQuery.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/TupleQuery.java index 0fbb027ac58..8a8ea0ca9ce 100644 --- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/TupleQuery.java +++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/search/TupleQuery.java @@ -32,6 +32,8 @@ public interface TupleQuery { <E1, E2> void getTupleType2ForArtifactIds(List<ArtifactId> artIds, BranchId branch, BiConsumer<Long, String> consumer); + <E1, E2> void getTuple2KeyValuePair(Tuple2Type<E1, E2> tupleType, ArtifactId artId, BranchId branchId, BiConsumer<Long, String> consumer); + /** * Get each unique E2 (Id and associated String value) for a particular TupleType regardless of E1 * |