Skip to content

Specobject bugfixes#169

Merged
kaklakariada merged 5 commits into
developfrom
specobject-bugfixes
Aug 7, 2018
Merged

Specobject bugfixes#169
kaklakariada merged 5 commits into
developfrom
specobject-bugfixes

Conversation

@kaklakariada

Copy link
Copy Markdown
Contributor
  • Fix location when importing specobjects
  • Fix exported covers name

@kaklakariada
kaklakariada requested a review from redcatbear August 4, 2018 12:40
@codecov

codecov Bot commented Aug 4, 2018

Copy link
Copy Markdown

Codecov Report

Merging #169 into develop will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #169      +/-   ##
=============================================
+ Coverage      94.31%   94.31%   +<.01%     
  Complexity      1004     1004              
=============================================
  Files            106      106              
  Lines           2743     2745       +2     
  Branches         231      231              
=============================================
+ Hits            2587     2589       +2     
  Misses            98       98              
  Partials          58       58
Impacted Files Coverage Δ Complexity Δ
...sallcode/openfasttrace/core/SpecificationItem.java 100% <ø> (ø) 65 <0> (ø) ⬇️
...llcode/openfasttrace/core/SpecificationItemId.java 95.57% <100%> (+0.07%) 30 <1> (ø) ⬇️
...enfasttrace/importer/SpecificationListBuilder.java 100% <100%> (ø) 39 <1> (ø) ⬇️
.../specobject/handler/SpecObjectsHandlerBuilder.java 100% <100%> (ø) 5 <0> (ø) ⬇️
...ttrace/exporter/specobject/SpecobjectExporter.java 94.28% <100%> (ø) 30 <0> (ø) ⬇️
...bject/handler/SingleSpecObjectsHandlerBuilder.java 97.77% <100%> (ø) 13 <1> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54757ae...fd5c585. Read the comment docs.

@kaklakariada
kaklakariada requested a review from p1pp5l3r August 6, 2018 06:35
}
else
{
LOG.warning(() -> "Name '" + this.name + "' does not match legacy name pattern '"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might potentially spam the log.
The warning is okay in cases where the error is rare though.

Longterm question: I thought about formalizing importer error collection. Instead of a regular text log a separate data structure that collects meta data about defect or spurious specification items? Opinions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding error collection: 👍

{
this.writer.writeStartElement("provcov");
writeElement("linksto", coveredId.getName());
writeElement("linksto", coveredId.getArtifactType() + ":" + coveredId.getName());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is correct since it will break in cases where people use existing ReqM documents without our proprietary <artifact-type>:<requirement name> convention.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only affects the export. The importer is unchanged. If we don't modify the exporter like this, the importer will use unknown as default which is also not good.

public void setLocation(final String path, final int line)
{
this.location = Location.create(path, line);
this.setLocation(Location.create(path, line));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Ooops, that kind of design slip should not happen. whistles slightly embarrassed

this.listener.setId(this.idBuilder.build());
this.listener.endSpecificationItem();
this.listener.setLocation(this.locationBuilder.build());
this.listener.endSpecificationItem();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's a nasty one. Good job uncovering that!

+ " <providescoverage>\n" //
+ " <provcov>\n" //
+ " <linksto>covered</linksto>\n" //
+ " <linksto>feat:covered</linksto>\n" //

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is what I meant earlier: existing documents will break. There must be a more robust solution that at least allows you to import a specobject and get the same back in export.

In absence of a better idea I suggest an exporter configuration switch. The current solution fixes one thing by breaking another.

* the file content.
* @return an {@link InputFile}.
*/
public static InputFile forContent(final Path path, final String content)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is under src/test: 👍

@Test
public void testTraceContent()
{
final String content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" //

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java Designers should finally make heredocs part of the language. :-)

@kaklakariada

Copy link
Copy Markdown
Contributor Author

Approved by @redcatbear, merging now.

@kaklakariada
kaklakariada merged commit f74b51f into develop Aug 7, 2018
@kaklakariada
kaklakariada deleted the specobject-bugfixes branch August 7, 2018 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants