[NETBEANS-54] Modules review xml.xam - no external library - checked Rat report: manually updated missed license header and added missing headers - skimmed through module, did not notice additional problems
Project: http://git-wip-us.apache.org/repos/asf/incubator-netbeans/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-netbeans/commit/188f2b59 Tree: http://git-wip-us.apache.org/repos/asf/incubator-netbeans/tree/188f2b59 Diff: http://git-wip-us.apache.org/repos/asf/incubator-netbeans/diff/188f2b59 Branch: refs/heads/master Commit: 188f2b59859bca080a0b95b12820dae45505b130 Parents: b810589 Author: Matthias Bläsing <[email protected]> Authored: Thu Oct 5 21:18:47 2017 +0200 Committer: Matthias Bläsing <[email protected]> Committed: Wed Oct 11 19:04:53 2017 +0200 ---------------------------------------------------------------------- xml.xam/apichanges.xml | 1 - .../modules/xml/xam/dom/ReadOnlyAccessTest.java | 32 ++++++++++---------- .../modules/xml/xam/locator/api/dummyFile.txt | 18 +++++++++++ .../modules/xml/xam/resources/test1.xml | 20 ++++++++++++ 4 files changed, 54 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/188f2b59/xml.xam/apichanges.xml ---------------------------------------------------------------------- diff --git a/xml.xam/apichanges.xml b/xml.xam/apichanges.xml index 5040d62..f43409a 100644 --- a/xml.xam/apichanges.xml +++ b/xml.xam/apichanges.xml @@ -1,5 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Search for CHANGEME in this document when copying and using it: --> <!-- Licensed to the Apache Software Foundation (ASF) under one http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/188f2b59/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/dom/ReadOnlyAccessTest.java ---------------------------------------------------------------------- diff --git a/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/dom/ReadOnlyAccessTest.java b/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/dom/ReadOnlyAccessTest.java index 3f1c08d..f6ead9d 100644 --- a/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/dom/ReadOnlyAccessTest.java +++ b/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/dom/ReadOnlyAccessTest.java @@ -49,58 +49,58 @@ public class ReadOnlyAccessTest extends TestCase { public void testFindPosition() throws Exception { TestModel2 model = Util.loadModel("resources/test1.xml"); - assertEquals(38 + lsl, model.getRootComponent().findPosition()); + assertEquals(860 + lsl, model.getRootComponent().findPosition()); assertEquals(4, model.getRootComponent().getChildren().size()); TestComponent2 component = model.getRootComponent().getChildren().get(0); assertEquals("a", component.getPeer().getLocalName()); - assertEquals(133 + lsl * 4, component.findPosition()); + assertEquals(955 + lsl * 4, component.findPosition()); } public void testFindPositionWithPrefix() throws Exception { TestModel2 model = Util.loadModel("resources/test1.xml"); TestComponent2.B b = model.getRootComponent().getChildren(TestComponent2.B.class).get(0); TestComponent2.Aa aa = b.getChildren(TestComponent2.Aa.class).get(0); - assertEquals(206 + lsl * 6, aa.findPosition()); + assertEquals(1028 + lsl * 6, aa.findPosition()); } public void testFindPositionWithElementTagInAttr() throws Exception { TestModel2 model = Util.loadModel("resources/test1.xml"); TestComponent2.C c = model.getRootComponent().getChildren(TestComponent2.C.class).get(0); - assertEquals(245 + lsl * 8, c.findPosition()); + assertEquals(1067 + lsl * 8, c.findPosition()); } public void testFindElement() throws Exception { TestModel2 model = Util.loadModel("resources/test1.xml"); TestComponent2 component = model.getRootComponent().getChildren().get(0); - assertEquals(component, model.findComponent(133 + lsl * 4)); - assertEquals(component, model.findComponent(147 + lsl * 4)); - assertEquals(component, model.findComponent(161 + lsl * 5)); + assertEquals(component, model.findComponent(955 + lsl * 4)); + assertEquals(component, model.findComponent(969 + lsl * 4)); + assertEquals(component, model.findComponent(983 + lsl * 5)); } public void testFindElementWithPrefix() throws Exception { TestModel2 model = Util.loadModel("resources/test1.xml"); TestComponent2.B b = model.getRootComponent().getChildren(TestComponent2.B.class).get(0); TestComponent2.Aa aa = b.getChildren(TestComponent2.Aa.class).get(0); - assertEquals(aa, model.findComponent(206 + lsl * 6)); - assertEquals(aa, model.findComponent(218 + lsl * 6)); - assertEquals(aa, model.findComponent(232 + lsl * 6)); + assertEquals(aa, model.findComponent(1028 + lsl * 6)); + assertEquals(aa, model.findComponent(1040 + lsl * 6)); + assertEquals(aa, model.findComponent(1054 + lsl * 6)); } public void testFindElementWithTagInAttr() throws Exception { TestModel2 model = Util.loadModel("resources/test1.xml"); TestComponent2.C c = model.getRootComponent().getChildren(TestComponent2.C.class).get(0); - assertEquals(c, model.findComponent(245 + lsl * 8)); - assertEquals(c, model.findComponent(249 + lsl * 8)); - assertEquals(c, model.findComponent(261 + lsl * 8)); + assertEquals(c, model.findComponent(1067 + lsl * 8)); + assertEquals(c, model.findComponent(1071 + lsl * 8)); + assertEquals(c, model.findComponent(1083 + lsl * 8)); } public void testFindElementGivenTextPosition() throws Exception { TestModel2 model = Util.loadModel("resources/test1.xml"); TestComponent2 root = model.getRootComponent(); TestComponent2.B b = root.getChildren(TestComponent2.B.class).get(0); - assertEquals(b, model.findComponent(201 + lsl * 5)); - assertEquals(root, model.findComponent(244 + lsl * 8)); - assertEquals(root, model.findComponent(265 + lsl * 9)); + assertEquals(b, model.findComponent(1023 + lsl * 5)); + assertEquals(root, model.findComponent(1066 + lsl * 8)); + assertEquals(root, model.findComponent(1087 + lsl * 9)); } public void testGetXmlFragment() throws Exception { http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/188f2b59/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/locator/api/dummyFile.txt ---------------------------------------------------------------------- diff --git a/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/locator/api/dummyFile.txt b/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/locator/api/dummyFile.txt index e69de29..d0d4024 100644 --- a/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/locator/api/dummyFile.txt +++ b/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/locator/api/dummyFile.txt @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +Dummy file \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-netbeans/blob/188f2b59/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/resources/test1.xml ---------------------------------------------------------------------- diff --git a/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/resources/test1.xml b/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/resources/test1.xml index 55d5f12..ef93eb7 100644 --- a/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/resources/test1.xml +++ b/xml.xam/test/unit/src/org/netbeans/modules/xml/xam/resources/test1.xml @@ -1,4 +1,24 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +--> <test xmlns="http://www.test.com/TestModel" xmlns:t2="http://www.test2.com/TestModel" >
