Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid W. Miller2016-01-20 09:39:29 -0500
committerDavid Miller2016-01-21 11:01:20 -0500
commit08566a74201ff7be10b26bd69442446bb1c86043 (patch)
tree8b7cb404542b08b17c0200ee2a001c0ac8569de1
parent1b857215763906febddc8bb0975e27f99fb2a5d7 (diff)
downloadorg.eclipse.osee-08566a74201ff7be10b26bd69442446bb1c86043.tar.gz
org.eclipse.osee-08566a74201ff7be10b26bd69442446bb1c86043.tar.xz
org.eclipse.osee-08566a74201ff7be10b26bd69442446bb1c86043.zip
bug[ats_ATS249282]: Fix subsystem for trace tools
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java23
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemFullTraceReport.java25
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityPage.java33
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityWizard.java5
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java49
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java20
6 files changed, 105 insertions, 50 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java
index fa8003926c..4ed82a7e57 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java
@@ -244,7 +244,7 @@ public class DetailedTestStatusOld extends AbstractBlam {
// Load Requirements Data
TraceabilityProviderOperation provider =
- new ScriptTraceabilityOperation(scriptDir, requirementsBranch, false, traceHandlers);
+ new ScriptTraceabilityOperation(scriptDir, requirementsBranch, false, traceHandlers, false);
RequirementTraceabilityData traceabilityData = new RequirementTraceabilityData(procedureBranch, provider);
IStatus status = traceabilityData.initialize(monitor);
@@ -340,8 +340,8 @@ public class DetailedTestStatusOld extends AbstractBlam {
excelWriter.writeRow("Category", "Test POCs", CoreAttributeTypes.Partition.getName(),
CoreAttributeTypes.Subsystem.getName(), "Requirement Name", CoreAttributeTypes.QualificationMethod.getName(),
"Requirement POCs", "SW Enhancement", CoreArtifactTypes.TestProcedure.getName(),
- CoreArtifactTypes.TestCase.getName(), "Run Date", "Total Test Points", "Failed Test Points",
- "Hours Remaining", "RPCR", "Hours", "Resolution by Partition");
+ CoreArtifactTypes.TestCase.getName(), "Run Date", "Total Test Points", "Failed Test Points", "Hours Remaining",
+ "RPCR", "Hours", "Resolution by Partition");
for (Artifact requirement : requirements) {
writeRequirementStatusLines(requirement);
@@ -542,9 +542,8 @@ public class DetailedTestStatusOld extends AbstractBlam {
String requirementName = taskNameMatcher.group(2);
RequirementStatus requirementStatus = reqTaskMap.get(requirementName, legacyId);
if (requirementStatus == null) {
- requirementStatus =
- new RequirementStatus(requirementName, legacyId, workflow.getSoleAttributeValueAsString(
- AtsAttributeTypes.SwEnhancement, ""));
+ requirementStatus = new RequirementStatus(requirementName, legacyId,
+ workflow.getSoleAttributeValueAsString(AtsAttributeTypes.SwEnhancement, ""));
reqTaskMap.put(requirementName, legacyId, requirementStatus);
}
@@ -574,7 +573,8 @@ public class DetailedTestStatusOld extends AbstractBlam {
sb.append("<xWidgets>");
sb.append("<XWidget xwidgetType=\"XAtsProgramComboWidget\" horizontalLabel=\"true\" displayName=\"Program\" />");
sb.append("<XWidget xwidgetType=\"XVersionList\" displayName=\"Versions\" multiSelect=\"true\" />");
- sb.append("<XWidget xwidgetType=\"XText\" displayName=\"Script Root Directory\" defaultValue=\"C:/UserData/workspaceScripts\" />");
+ sb.append(
+ "<XWidget xwidgetType=\"XText\" displayName=\"Script Root Directory\" defaultValue=\"C:/UserData/workspaceScripts\" />");
availableTraceHandlers = new LinkedList<>();
sb.append("<XWidget xwidgetType=\"XLabel\" displayName=\"Select appropriate script parser:\" />");
@@ -584,9 +584,12 @@ public class DetailedTestStatusOld extends AbstractBlam {
availableTraceHandlers.add(handler);
}
- sb.append("<XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Requirements Branch\" toolTip=\"Select a requirements branch.\" />");
- sb.append("<XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Test Results Branch\" toolTip=\"Select a scripts results branch.\" />");
- sb.append("<XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Test Procedure Branch\" toolTip=\"Select a test procedures branch.\" />");
+ sb.append(
+ "<XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Requirements Branch\" toolTip=\"Select a requirements branch.\" />");
+ sb.append(
+ "<XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Test Results Branch\" toolTip=\"Select a scripts results branch.\" />");
+ sb.append(
+ "<XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Test Procedure Branch\" toolTip=\"Select a test procedures branch.\" />");
sb.append("</xWidgets>");
return sb.toString();
}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemFullTraceReport.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemFullTraceReport.java
index 7c3489859b..9e631c8006 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemFullTraceReport.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemFullTraceReport.java
@@ -68,6 +68,7 @@ public class SubsystemFullTraceReport extends AbstractBlam {
private final String SCRIPT_ROOT_DIR = "Script Root Directory";
private final String USE_TRACE_IN_OSEE = "Use traceability from Subsystem Requirements";
+ private final String USE_GIT_CODE_STRUCTURE = "Use Git Code Structure";
private XCheckBox useTraceInOsee;
private XText scriptDir;
@@ -96,6 +97,7 @@ public class SubsystemFullTraceReport extends AbstractBlam {
init();
String scriptDir = variableMap.getString(SCRIPT_ROOT_DIR);
Boolean checked = variableMap.getBoolean(USE_TRACE_IN_OSEE);
+ Boolean isGitCodeStructure = variableMap.getBoolean(USE_GIT_CODE_STRUCTURE);
Collection<TraceHandler> traceHandlers = new LinkedList<>();
for (String handler : availableTraceHandlers) {
@@ -109,7 +111,7 @@ public class SubsystemFullTraceReport extends AbstractBlam {
File dir = new File(scriptDir);
if (dir.exists()) {
ScriptTraceabilityOperation traceOperation =
- new ScriptTraceabilityOperation(dir.getParentFile(), branch, false, traceHandlers);
+ new ScriptTraceabilityOperation(dir.getParentFile(), branch, false, traceHandlers, isGitCodeStructure);
Operations.executeWorkAndCheckStatus(traceOperation, monitor);
requirementsToCodeUnits = traceOperation.getRequirementToCodeUnitsMap();
}
@@ -153,7 +155,8 @@ public class SubsystemFullTraceReport extends AbstractBlam {
private void processSubSystemRequirement(Artifact subSystemRequirement) throws IOException, OseeCoreException {
boolean topRowForSubsystemReq = true;
- for (Artifact systemRequirement : subSystemRequirement.getRelatedArtifacts(CoreRelationTypes.Requirement_Trace__Higher_Level)) {
+ for (Artifact systemRequirement : subSystemRequirement.getRelatedArtifacts(
+ CoreRelationTypes.Requirement_Trace__Higher_Level)) {
writer.writeCell(systemRequirement.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, ""));
writer.writeCell(systemRequirement.getName());
writer.writeCell(getRequirementText(systemRequirement));
@@ -169,7 +172,8 @@ public class SubsystemFullTraceReport extends AbstractBlam {
topRowForSubsystemReq = false;
}
- for (Artifact softwareRequirement : subSystemRequirement.getRelatedArtifacts(CoreRelationTypes.Requirement_Trace__Lower_Level)) {
+ for (Artifact softwareRequirement : subSystemRequirement.getRelatedArtifacts(
+ CoreRelationTypes.Requirement_Trace__Lower_Level)) {
processSoftwareRequirement(softwareRequirement);
}
writer.endRow();
@@ -186,8 +190,8 @@ public class SubsystemFullTraceReport extends AbstractBlam {
writer.writeCell(softwareRequirement.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, ""),
SOFTWARE_REQUIREMENT_INDEX);
writer.writeCell(softwareRequirement.getName());
- writer.writeCell(Collections.toString(",",
- softwareRequirement.getAttributesToStringList(CoreAttributeTypes.Partition)));
+ writer.writeCell(
+ Collections.toString(",", softwareRequirement.getAttributesToStringList(CoreAttributeTypes.Partition)));
writer.writeCell(softwareRequirement.getAttributesToStringSorted(CoreAttributeTypes.QualificationMethod));
tests.clear();
@@ -215,10 +219,15 @@ public class SubsystemFullTraceReport extends AbstractBlam {
public String getXWidgetsXml() throws OseeCoreException {
StringBuilder sb = new StringBuilder();
sb.append("<xWidgets>");
- sb.append("<XWidget xwidgetType=\"XCheckBox\" displayName=\"" + USE_TRACE_IN_OSEE + "\" defaultValue=\"true\" labelAfter=\"true\" horizontalLabel=\"true\" />");
- sb.append("<XWidget xwidgetType=\"XText\" displayName=\"" + SCRIPT_ROOT_DIR + "\" defaultValue=\"C:/UserData/workspaceScripts\" toolTip=\"Leave blank if test script traceability is not needed.\" />");
+ sb.append(
+ "<XWidget xwidgetType=\"XCheckBox\" displayName=\"" + USE_TRACE_IN_OSEE + "\" defaultValue=\"true\" labelAfter=\"true\" horizontalLabel=\"true\" />");
+ sb.append(
+ "<XWidget xwidgetType=\"XCheckBox\" displayName=\"" + USE_GIT_CODE_STRUCTURE + "\" defaultValue=\"true\" labelAfter=\"true\" horizontalLabel=\"true\" />");
+ sb.append(
+ "<XWidget xwidgetType=\"XText\" displayName=\"" + SCRIPT_ROOT_DIR + "\" defaultValue=\"C:/UserData/workspaceScripts\" toolTip=\"Leave blank if test script traceability is not needed.\" />");
availableTraceHandlers = new LinkedList<>();
- sb.append("<XWidget xwidgetType=\"XLabel\" displayName=\"Select appropriate script parser (if script traceability needed):\" />");
+ sb.append(
+ "<XWidget xwidgetType=\"XLabel\" displayName=\"Select appropriate script parser (if script traceability needed):\" />");
Collection<String> traceHandlerNames = TraceUnitExtensionManager.getInstance().getAllTraceHandlerNames();
for (String handler : traceHandlerNames) {
sb.append(String.format(TRACE_HANDLER_CHECKBOX, handler));
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityPage.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityPage.java
index b30fbd3916..b1bb3883a3 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityPage.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityPage.java
@@ -48,10 +48,12 @@ public class ImportTraceabilityPage extends WizardDataTransferPage {
public static final String PAGE_NAME = "org.eclipse.osee.define.wizardPage.importTraceabilityPage";
private static final String TRACE_UNIT_HANDLER_GROUP = "Select trace unit parser";
+ private static final String GIT_CODE_STRUCTURE_GROUP = "Select to use Git codebase";
private DirectoryOrFileSelector directoryFileSelector;
private BranchSelectComposite branchSelectComposite;
private final Map<Button, Boolean> traceUnitHandlers;
+ private boolean isGitCodeStructure = false;
private IResource currentResourceSelection;
@@ -65,7 +67,7 @@ public class ImportTraceabilityPage extends WizardDataTransferPage {
if (selection != null && selection.size() == 1) {
Object firstElement = selection.getFirstElement();
if (firstElement instanceof IAdaptable) {
- currentResourceSelection = (IResource) ((IAdaptable) firstElement).getAdapter(IResource.class);
+ currentResourceSelection = ((IAdaptable) firstElement).getAdapter(IResource.class);
}
}
}
@@ -82,7 +84,7 @@ public class ImportTraceabilityPage extends WizardDataTransferPage {
createSourceGroup(composite);
createParserSelectArea(composite);
-
+ createGitStructureCheckbox(composite);
restoreWidgetValues();
updateWidgetEnablements();
setPageComplete(determinePageCompletion());
@@ -93,7 +95,7 @@ public class ImportTraceabilityPage extends WizardDataTransferPage {
/**
* The <code>WizardResourceImportPage</code> implementation of this <code>Listener</code> method handles all events
* and enablements for controls on this page. Subclasses may extend.
- *
+ *
* @param event Event
*/
@Override
@@ -143,6 +145,27 @@ public class ImportTraceabilityPage extends WizardDataTransferPage {
}
}
+ private void createGitStructureCheckbox(Composite parent) {
+ Group composite = new Group(parent, SWT.NONE);
+ composite.setText(GIT_CODE_STRUCTURE_GROUP);
+ composite.setLayout(new GridLayout());
+ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Button handlerButton = new Button(composite, SWT.CHECK);
+ handlerButton.setText("Use Git Code Structure");
+ handlerButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Object source = e.getSource();
+ if (source instanceof Button) {
+ Button button = (Button) source;
+ isGitCodeStructure = button.getSelection();
+ }
+ }
+ });
+ }
+
private void createTraceHandler(Composite parent, String text, String handlerId) {
Button handlerButton = new Button(parent, SWT.CHECK);
handlerButton.setText(text);
@@ -198,6 +221,10 @@ public class ImportTraceabilityPage extends WizardDataTransferPage {
return branchSelectComposite.getSelectedBranch();
}
+ public boolean isGitBased() {
+ return isGitCodeStructure;
+ }
+
@Override
protected boolean allowNewContainerName() {
return false;
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityWizard.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityWizard.java
index 6bdcc1f512..ad2544b3a2 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityWizard.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityWizard.java
@@ -41,11 +41,14 @@ public class ImportTraceabilityWizard extends Wizard implements IImportWizard {
try {
IOseeBranch branch = mainPage.getSelectedBranch();
File file = mainPage.getImportFile();
+ boolean isGitBased = mainPage.isGitBased();
+
Collection<TraceHandler> handlers = new LinkedList<>();
for (String handlerId : mainPage.getTraceUnitHandlerIds()) {
handlers.add(TraceUnitExtensionManager.getInstance().getTraceUnitHandlerById(handlerId));
}
- Operations.executeWorkAndCheckStatus(new ScriptTraceabilityOperation(file, branch, true, handlers));
+ Operations.executeWorkAndCheckStatus(
+ new ScriptTraceabilityOperation(file, branch, true, handlers, isGitBased));
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, "Traceability Import Error", ex);
}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java
index c7178de5c1..8724b2f5eb 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java
@@ -62,37 +62,39 @@ public class ScriptTraceabilityOperation extends TraceabilityProviderOperation {
private static final Matcher embeddedVolumeMatcher = Pattern.compile("\\{\\d+ (.*)\\}[ .]*").matcher("");
private static final Matcher stripTrailingReqNameMatcher = Pattern.compile("(\\}|\\])(.*)").matcher("");
private static final Matcher nonWordMatcher = Pattern.compile("[^A-Z_0-9]").matcher("");
- private static final Matcher subsystemMatcher = Pattern.compile("\\w*\\.ss").matcher("");
-
+ private static final Matcher subsystemMatcher = Pattern.compile("(\\w*)\\.ss").matcher("");
+ private static final Matcher gitSubsystemMatcher = Pattern.compile("\\w*\\.ofp\\\\(\\w*)").matcher("");
private final Collection<TraceHandler> traceHandlers;
private final File file;
private final RequirementData requirementData;
private final ArrayList<String> noTraceabilityFiles = new ArrayList<>(200);
private final CountingMap<Artifact> reqsTraceCounts = new CountingMap<>();
- private final HashCollection<Artifact, String> requirementToCodeUnitsMap = new HashCollection<>(
- false, LinkedHashSet.class);
+ private final HashCollection<Artifact, String> requirementToCodeUnitsMap =
+ new HashCollection<>(false, LinkedHashSet.class);
private final HashSet<String> codeUnits = new HashSet<>();
private final CharBackedInputStream charBak;
private final ISheetWriter excelWriter;
private int pathPrefixLength;
private final boolean writeOutResults;
+ private final boolean isGitBased;
- private ScriptTraceabilityOperation(RequirementData requirementData, File file, boolean writeOutResults, Collection<TraceHandler> traceHandlers) throws IOException {
+ private ScriptTraceabilityOperation(RequirementData requirementData, File file, boolean writeOutResults, Collection<TraceHandler> traceHandlers, boolean isGitBased) throws IOException {
super("Importing Traceability", Activator.PLUGIN_ID);
this.file = file;
this.requirementData = requirementData;
this.writeOutResults = writeOutResults;
this.traceHandlers = traceHandlers;
+ this.isGitBased = isGitBased;
charBak = new CharBackedInputStream();
excelWriter = new ExcelXmlWriter(charBak.getWriter());
}
- public ScriptTraceabilityOperation(File file, IOseeBranch branch, boolean writeOutResults, Collection<TraceHandler> traceHandlers) throws IOException {
- this(new RequirementData(branch), file, writeOutResults, traceHandlers);
+ public ScriptTraceabilityOperation(File file, IOseeBranch branch, boolean writeOutResults, Collection<TraceHandler> traceHandlers, boolean isGitBased) throws IOException {
+ this(new RequirementData(branch), file, writeOutResults, traceHandlers, isGitBased);
}
- public ScriptTraceabilityOperation(File file, IOseeBranch branch, boolean writeOutResults, Collection<? extends IArtifactType> types, boolean withInheritance, Collection<TraceHandler> traceHandlers) throws IOException {
- this(new RequirementData(branch, types, withInheritance), file, writeOutResults, traceHandlers);
+ public ScriptTraceabilityOperation(File file, IOseeBranch branch, boolean writeOutResults, Collection<? extends IArtifactType> types, boolean withInheritance, Collection<TraceHandler> traceHandlers, boolean isGitBased) throws IOException {
+ this(new RequirementData(branch, types, withInheritance), file, writeOutResults, traceHandlers, isGitBased);
}
@Override
@@ -221,6 +223,18 @@ public class ScriptTraceabilityOperation extends TraceabilityProviderOperation {
return canonicalReqReference;
}
+ private String getSubsystem(String source, Matcher matcher) {
+ String subSystem = null;
+ matcher.reset(source);
+ if (matcher.find()) {
+ subSystem = matcher.group(1);
+ subSystem = subSystem.toUpperCase();
+ } else {
+ subSystem = "no valid subsystem found";
+ }
+ return subSystem;
+ }
+
private void handelReqTrace(String path, TraceMark traceMark, File sourceFile) throws OseeCoreException, IOException {
Artifact reqArtifact = null;
String foundStr;
@@ -228,14 +242,8 @@ public class ScriptTraceabilityOperation extends TraceabilityProviderOperation {
String textContent = null;
boolean traceMatch = false;
- subsystemMatcher.reset(sourceFile.getPath());
- if (subsystemMatcher.find()) {
- subSystem = subsystemMatcher.group();
- subSystem = subSystem.replace(".ss", "");
- subSystem = subSystem.toUpperCase();
- } else {
- subSystem = "no valid subsystem found";
- }
+ subSystem = (isGitBased) ? getSubsystem(sourceFile.getPath(),
+ gitSubsystemMatcher) : getSubsystem(sourceFile.getPath(), subsystemMatcher);
if (traceMark.getTraceType().equals("Uses")) {
foundStr = "invalid trace mark";
@@ -256,15 +264,16 @@ public class ScriptTraceabilityOperation extends TraceabilityProviderOperation {
//There is no WordTemplateContent in a button requirement so we need to verify it exists
//If its not there we need to render the button requirement in Word and pull out the body.
if (reqArtifact.getAttributeCount(CoreAttributeTypes.WordTemplateContent) > 0) {
- textContent =
- WordUtil.textOnly(reqArtifact.getSoleAttributeValue(CoreAttributeTypes.WordTemplateContent, "")).toUpperCase();
+ textContent = WordUtil.textOnly(
+ reqArtifact.getSoleAttributeValue(CoreAttributeTypes.WordTemplateContent, "")).toUpperCase();
} else {
List<Attribute<?>> attributes = reqArtifact.getAttributes();
for (Attribute<?> attribute : attributes) {
textContent = textContent + attribute.toString();
}
}
- if (textContent.contains(structuredRequirement.getSecond()) || textContent.contains(getCanonicalRequirementName(structuredRequirement.getSecond()))) {
+ if (textContent.contains(structuredRequirement.getSecond()) || textContent.contains(
+ getCanonicalRequirementName(structuredRequirement.getSecond()))) {
foundStr = "req body match";
} else {
foundStr = "req name match/element missing in body";
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java
index b3f4cb89f3..fd1cb5ad4e 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java
@@ -54,6 +54,8 @@ public class PublishStdStpTraceability extends AbstractBlam {
"<XWidget xwidgetType=\"XArtifactTypeMultiChoiceSelect\" displayName=\"Artifact Type(s) to Trace\" defaultValue=\"" + CoreArtifactTypes.SoftwareRequirement.getName() + "\"/>";
private static final String searchInheritedTypes =
"<XWidget xwidgetType=\"XCheckBox\" displayName=\"Search Inherited Types\" labelAfter=\"true\" horizontalLabel=\"true\" defaultValue=\"false\" />";
+ private static final String useGitCodeStructure =
+ "<XWidget xwidgetType=\"XCheckBox\" displayName=\"Search Git Code Structure\" labelAfter=\"true\" horizontalLabel=\"true\" defaultValue=\"false\" />";
private static final String TRACE_HANDLER_CHECKBOX =
"<XWidget xwidgetType=\"XCheckBox\" displayName=\"%s\" labelAfter=\"true\" horizontalLabel=\"true\"/>";
private Collection<String> availableTraceHandlers;
@@ -88,7 +90,9 @@ public class PublishStdStpTraceability extends AbstractBlam {
builder.append(artifactTypeChooser);
builder.append(searchInheritedTypes);
- builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\"=== For traceability stored in test scripts, select the following ===\" />");
+ builder.append(
+ "<XWidget xwidgetType=\"XLabel\" displayName=\"=== For traceability stored in test scripts, select the following ===\" />");
+ builder.append(useGitCodeStructure);
availableTraceHandlers = new LinkedList<>();
builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\"Select appropriate script parser:\" />");
Collection<String> traceHandlers = TraceUnitExtensionManager.getInstance().getAllTraceHandlerNames();
@@ -140,9 +144,9 @@ public class PublishStdStpTraceability extends AbstractBlam {
if (traceHandlers.isEmpty()) {
provider = new BranchTraceabilityOperation(requirementsBranch, types, searchInherited);
} else {
- provider =
- new ScriptTraceabilityOperation(scriptDir, requirementsBranch, false, types, searchInherited,
- traceHandlers);
+ boolean isGitBased = variableMap.getBoolean("Search Git Code Structure");
+ provider = new ScriptTraceabilityOperation(scriptDir, requirementsBranch, false, types, searchInherited,
+ traceHandlers, isGitBased);
}
RequirementTraceabilityData traceabilityData = new RequirementTraceabilityData(requirementsBranch, provider);
IStatus status = traceabilityData.initialize(monitor);
@@ -153,8 +157,8 @@ public class PublishStdStpTraceability extends AbstractBlam {
int count = 0;
List<IFile> files = new ArrayList<>();
for (TraceabilityStyle style : selectedReports) {
- monitor.subTask(String.format("Creating table: [%s] [%s of %s]", style.asLabel(), ++count,
- selectedReports.size()));
+ monitor.subTask(
+ String.format("Creating table: [%s] [%s of %s]", style.asLabel(), ++count, selectedReports.size()));
TraceabilityTable table = TraceabilityFactory.getTraceabilityTable(style, traceabilityData);
if (table != null) {
@@ -163,8 +167,8 @@ public class PublishStdStpTraceability extends AbstractBlam {
monitor.worked(1);
if (table != null) {
- monitor.subTask(String.format("Writing table: [%s] [%s of %s]", style.asLabel(), count,
- selectedReports.size()));
+ monitor.subTask(
+ String.format("Writing table: [%s] [%s of %s]", style.asLabel(), count, selectedReports.size()));
String fileName = style.toString() + "." + Lib.getDateTimeString() + ".xml";
IFile iFile = OseeData.getIFile(fileName);
AIFile.writeToFile(iFile, table.toString());

Back to the top