Comments (1)
When working on #750 where I included special handling for inserted attributes, I took a look at how deletion works. For reference, I will include that here, too.
How it works
A deletion is represented as follows:
key: id, expected=foo, actual=(default or absent)
recheck assumes that actual=null
indicates that the attribute has been deleted.
When applying an (identifying) attribute difference, it is passed down to the respective attributes collection (IdentifyingAttributes
or Attributes
) and eventually to the attribute itself.
The Attributes
collection already handles deletions correctly, but the IdentifyingAttributes
does not. It simply applies the attribute, which returns Attribute(key: id, value: null)
which then results in an empty attribute in the Golden Master.
Proposal
One could assume that we simply remove that attribute from the collection. However, this is not the case, since some attributes may require special handling (e.g. the path attribute should never be removed, see IdentifyingAttributesTest).
With that in mind, I would propose either of the following:
-
The
Attribute
class still handles deletions as a form of change (indicated by the above PR). Thus theAttribute
decides if the new value is valid and ifnull
should result in a deletion. This can be either indicated by returning either anull
attribute or anOptional<Attribute>
withinAttribute#applyChanges
.This gives the power to the attribute and can be expanded. But this requires implementation of such (e.g. return the
null
attribute, ifactual=null
). Consequently, this removes power from theIdentifyingAttributes
. -
The
IdentifyingAttributes
handles deletions (as indicated byactual=null
), but excludes special attributes.This gives central power to the
IdentifyingAttributes
to ensure the removal works for ever attribute. However, this comes at the cost, that theIdentifyingAttributes
knows of the special attributes (i.e. path never be null), either by class or by key, and cannot be expanded easily.
The first approach is based on the assumption that special handling is required (currently only path) and might not even be the case anymore. I think, that this special handling is the responsibility of the extension at hand, not of the user applying the change. Thus these cases should be handled earlier and should not be reported to the user on apply.
The second approach is more clean, as the collection can decide when to remove a attribute., thus I prefer this approach. For the special handling is the decision to be made, if it should be re-implemented or simply removed for now. Thus an extension has to respect and enforce this.
from recheck.
Related Issues (20)
- Parameterized tests are overwritten HOT 1
- Avoid implementation-specific filters in recheck HOT 5
- Integration with SoapUI HOT 23
- RecheckOptions should reuse given FileNamerStrategy HOT 1
- Wrong report version HOT 12
- Warning: Nashorn engine is planned to be removed from a future JDK release
- An illegal reflective access operation has occurred HOT 4
- Multiple (aggregated) tests.report are uploaded during a single build
- Make `RecheckOptionsBuilder` more generalized and robust
- RGB differences are not updated in the recheck.ignore file HOT 8
- Integrate into JUnit for life-cycle management HOT 4
- Matcher doesn't ignore child elements if other than XPath HOT 4
- Investigate problem triggering assertion in Alignment#createAlignment() HOT 6
- I am getting "java.util.ServiceConfigurationError: de.retest.recheck.RecheckAdapter: Provider de.retest.web.RecheckSeleniumAdapter could not be instantiated", HOT 19
- IllegalArgumentException: Unnamed path parameter HOT 3
- Detect modifications of project files for project setup
- Cannot able to see the retest id in the log HOT 2
- Build with a JDK > 8 took long time HOT 2
- We should use kryo.setRegistrationRequired( true )
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recheck.