private void loadAtsConfigCacheArtifacts( IAtsArtifactStore artifactStore, AtsArtifactConfigCache cache, Artifact artifact) throws OseeCoreException { if (artifact.isOfType(AtsArtifactTypes.TeamDefinition)) { IAtsTeamDefinition teamDef = artifactStore.load(cache, artifact); for (String staticId : artifact.getAttributesToStringList(CoreAttributeTypes.StaticId)) { cache.cacheByTag(staticId, teamDef); } } if (artifact.isOfType(AtsArtifactTypes.ActionableItem)) { IAtsActionableItem ai = artifactStore.load(cache, artifact); for (String staticId : artifact.getAttributesToStringList(CoreAttributeTypes.StaticId)) { cache.cacheByTag(staticId, ai); } } if (artifact.isOfType(AtsArtifactTypes.Version)) { IAtsVersion version = artifactStore.load(cache, artifact); for (String staticId : artifact.getAttributesToStringList(CoreAttributeTypes.StaticId)) { cache.cacheByTag(staticId, version); } } }
@Test public void testSetAttributeValuesAddOneRemoveOne() throws Exception { artifact.setAttributeValues(CoreAttributeTypes.StaticId, ADD_ONE_REMOVE_ONE); List<String> actual = artifact.getAttributesToStringList(CoreAttributeTypes.StaticId); assertTrue(Collections.isEqual(ADD_ONE_REMOVE_ONE, actual)); }
@Test public void testSetAttributeValuesWithDuplicates() throws Exception { artifact.setAttributeValues(CoreAttributeTypes.StaticId, ADD_DUPLICATES); List<String> actual = artifact.getAttributesToStringList(CoreAttributeTypes.StaticId); assertTrue(Collections.isEqual(ADD_DUPLICATES_EXPECTED, actual)); }
@Test public void testSetAttributeValuesRemoveAll() throws Exception { artifact.setAttributeValues( CoreAttributeTypes.StaticId, java.util.Collections.<String>emptyList()); List<String> actual = artifact.getAttributesToStringList(CoreAttributeTypes.StaticId); assertTrue(actual.isEmpty()); }
@Test public void testSetAttributeValues() throws Exception { List<String> actual = artifact.getAttributesToStringList(CoreAttributeTypes.StaticId); assertTrue(Collections.isEqual(START_VALUE, actual)); }
private static void processTeam( TeamWorkFlowArtifact teamArt, String buildId, IAttributeType attributeType, ICommitConfigArtifact commitConfigArt, XResultData rd) throws OseeCoreException { String rpcrNum = teamArt.getSoleAttributeValue(AtsAttributeTypes.LegacyPcrId, ""); ChangeData changeData = AtsBranchManager.getChangeData(teamArt, commitConfigArt); for (Artifact modArt : changeData.getArtifacts( KindType.Artifact, ModificationType.NEW, ModificationType.MODIFIED)) { List<String> attrStrs = modArt.getAttributesToStringList(attributeType); if (attrStrs.isEmpty()) { attrStrs.add(EnumeratedAttribute.UNSPECIFIED_VALUE); } for (String attrStr : attrStrs) { rd.addRaw( AHTML.addRowMultiColumnTable( new String[] { teamArt.getHumanReadableId(), buildId, modArt.getName(), attrStr, rpcrNum, "Content" })); } } for (Artifact artChg : changeData.getArtifacts(KindType.Artifact, ModificationType.DELETED)) { List<String> attrStrs = artChg.getAttributesToStringList(attributeType); if (attrStrs.isEmpty()) { attrStrs.add(EnumeratedAttribute.UNSPECIFIED_VALUE); } for (String attrStr : attrStrs) { rd.addRaw( AHTML.addRowMultiColumnTable( new String[] { teamArt.getHumanReadableId(), buildId, artChg.getName(), attrStr, rpcrNum, "Deleted" })); } } for (Artifact artChg : changeData.getArtifacts( KindType.RelationOnly, ModificationType.NEW, ModificationType.MODIFIED)) { List<String> attrStrs = artChg.getAttributesToStringList(attributeType); if (attrStrs.isEmpty()) { attrStrs.add(EnumeratedAttribute.UNSPECIFIED_VALUE); } for (String attrStr : attrStrs) { rd.addRaw( AHTML.addRowMultiColumnTable( new String[] { teamArt.getHumanReadableId(), buildId, artChg.getName(), attrStr, rpcrNum, "Relation" })); } } }