Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make "NA" string configurable #16

Closed
kerrykimbrough opened this issue Jun 21, 2018 · 7 comments
Closed

Make "NA" string configurable #16

kerrykimbrough opened this issue Jun 21, 2018 · 7 comments

Comments

@kerrykimbrough
Copy link
Contributor

To avoid conflicts in system domains where "NA" has a different meaning.

@tkruse
Copy link
Contributor

tkruse commented Jun 24, 2018

If you can give a some hint about how you think this should be implemented, I can work on it. I see no straightforward way.

@tkruse
Copy link
Contributor

tkruse commented Jun 27, 2018

Honestly the clean solution to me seems to be using Java null, and in XML a non value, such as

    <Var name="pattern.size" value="ONE"/>
    <Var name="pattern.size"/>  <!-- NA -->

@tkruse
Copy link
Contributor

tkruse commented Jun 29, 2018

Other than that, patches I can imagine:

  • Make the global constant configurable in code (a setter method for a static mutable variable)
  • Make the global constant configurable otherwise (such as reading a properties file, if present).

@kerrykimbrough
Copy link
Contributor Author

As you've suggested, there's another way to look at this problem. Configuring the NA value is just a hack. The real issue is that the "not-applicable-ness" of a VarValueDef is a distinct property, different from its "name". But Tcases confuses things by encoding them together. A better solution would be to represent these 2 properties distinctly, both in the code for VarValueDef/VarBinding and in the XML representation of a SystemTestDef.

@kerrykimbrough
Copy link
Contributor Author

the clean solution to me seems to be using Java null, and in XML a non value

I think it's important for the XML to make "not-applicable-ness" explicit and visible. In the code, it could be represented by a null value. But assuming that NA-ness and value are encoded separately, it would be just as well (and more backward-compatible) to keep using "NA".

@tkruse
Copy link
Contributor

tkruse commented Jun 30, 2018

Actually a test variable value of "null" and "not applicable" might both be different interesting cases. So having a global NA type and allowing null as a value might also be interesting.

For changes to the XML, you would have to decide how to handle backwards compatibility if you are considering making changes.

A complex approach would be to start versioning the xml schema and supporting multiple versions (e.g. schema1.0 uses value="NA", schema 2.0 uses a new xml tag).

@kerrykimbrough
Copy link
Contributor Author

Fixed by PR #31

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

No branches or pull requests

2 participants