This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 9271 - Coverage for upd:propagateNamespace
Summary: Coverage for upd:propagateNamespace
Status: VERIFIED FIXED
Alias: None
Product: XQuery Update Facility Test Suite
Classification: Unclassified
Component: XQuery Update Facility Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-18 15:36 UTC by Josh Spiegel
Modified: 2010-04-06 15:16 UTC (History)
2 users (show)

See Also:


Attachments
additional tests (15.68 KB, application/zip)
2010-03-30 22:25 UTC, Josh Spiegel
Details

Description Josh Spiegel 2010-03-18 15:36:21 UTC
There does not seem to be any test coverage for upd:propageNamespace.  

Here are some initial ideas for what the tests should cover:
(1) on/off depending if the copy-namespaces mode is inherit/no-inherit

(2) each primitive that can mark namespaces for propagation

(3) conditions where some namespaces are blocked by existing namespaces as you propagate down the tree

(4) propagating the default element/type namespace

As there are about 9 primitives that can mark a node, I would expect roughly 15 tests.  In the catalog, they would fit nicely in Minimal Conformance -> XML Query Update Operations -> XQuery Update Routines -> upd:propagateNamespace

I can write/submit these tests if it is helpful.
Comment 1 Andrew Eisenberg 2010-03-22 16:44:25 UTC
upd:propagateNamespace was added in response to Bug #5631. I found some of my notes, indicating that we had test cases for each situation in which upd:propageNamespace was to be invoked. My notes say:


The places where namespace bindings are marked for propagation are:

* on upd:insertBefore and upd:insertAfter all the namespace bindings of
parent($target) are marked for propagation

  id-insert-expr-084 - before
  id-insert-expr-085 - after

* on upd:insertInto, updInsertIntoAsFirst, and upd:insertIntoAsLast, all the
namespace bindings of $target are marked for propagation

  id-insert-expr-081 - insert into
  id-insert-expr-082 - as first
  id-insert-expr-083 - as last


* on upd:insertAttributes, any namespace bindings created in step 3b are
marked for propagation

  id-insert-expr-086

* on upd:replaceNode, any namespace bindings created in step 4b are marked
for propagation

  id-replace-expr-045

* on upd:rename, any namespace bindings created in step 1d or 2e is marked
for propagation

  id-rename-expr-033 - rename element
  id-rename-expr-034 - rename attribute


I'm hoping that these test cases adequately test upd:propagateNamespace.

By the way, offers to write new test cases are always appreciated.
Comment 2 Josh Spiegel 2010-03-22 18:19:58 UTC
Andrew,

Our implementation does not fail any tests related to upd:propagateNamespaces yet we have not implemented it yet.  

I have looked at each of the tests in your notes.  Each seems to allow result "a" or result "b"  where result "b" is empty and allows the test to pass if namespaces are not propagated.  

For example, consider test "id-insert-expr-084" where the result of the test can be either "http://www.example.com/myco" or empty.  This implies it is ok if the inserted <dependents/> element does not get the namespace definition of its parent, myco:employee.  

In other words, these tests imply that namespace propagation is optional even when the copy-namespaces mode specifies inherit.  However, my impression was that it is not optional (e.g. all of the "result b" options in the tests you mentioned are not valid).  

Could you please clarify?

Other than that, these tests would seem to cover item (2) that I mentioned above.  

Thanks,
Josh
Comment 3 Andrew Eisenberg 2010-03-30 15:48:53 UTC
I wrote these test cases in December 2008. The propagation of namespaces was not specified in the Update Facility CR at that time, and so I allowed two results. The issue was resolved by the WG in Jan. 2009 in Bug #5631. Apparently, I never revisisted these test cases.

I've eliminated the "b" results in id-insert-expr-081 through -086, id-replace-expr-045 and id-rename-expr-033/-034.

Comment 4 Josh Spiegel 2010-03-30 22:25:35 UTC
Created attachment 850 [details]
additional tests
Comment 5 Josh Spiegel 2010-03-30 22:35:07 UTC
Great.  I have attached a few additional tests that I wrote and you are welcome  to include them in the XQUTS (or not).  I made a "no-inherit" version of each of your tests which covers (1) from the bug description.  I also made propagateNamespaces01-06 which cover (3) and (4) from the bug description.  Thanks!
Comment 6 Andrew Eisenberg 2010-04-02 21:37:49 UTC
I've added the test cases that you provided in comment #4.

Please close this bug report if you are happy with this resolution.
Comment 7 Josh Spiegel 2010-04-04 18:01:19 UTC
I took a look at your change.  The catalog additions look good but I think you forgot to add the corresponding query files for propagateNamespaces01-06 to CVS.
Comment 8 Josh Spiegel 2010-04-04 18:16:58 UTC
Actually, it is the expected result files I think are missing, not the query files.
Comment 9 Andrew Eisenberg 2010-04-05 01:31:38 UTC
Apologies. These expected result files have been added and committed.
Comment 10 Josh Spiegel 2010-04-06 15:16:11 UTC
Works now.  Thanks!