From: <bo...@us...> - 2010-05-21 15:13:00
|
Revision: 398 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=398&view=rev Author: bodewig Date: 2010-05-21 15:12:49 +0000 (Fri, 21 May 2010) Log Message: ----------- The Java codebase was undecided whether it used IFoo or Foo for interfaces. Stay true to your Java roots and drop the I everywhere. Modified Paths: -------------- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/AbstractTransformationBuilder.java trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/Input.java trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/Transform.java trunk/xmlunit/src/main/java-core/net/sf/xmlunit/xpath/JAXPXPathEngine.java trunk/xmlunit/src/tests/java-core/net/sf/xmlunit/xpath/AbstractXPathEngineTest.java trunk/xmlunit/src/tests/java-core/net/sf/xmlunit/xpath/JAXPXPathEngineTest.java Added Paths: ----------- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/TransformationBuilderBase.java trunk/xmlunit/src/main/java-core/net/sf/xmlunit/diff/DifferenceEngine.java trunk/xmlunit/src/main/java-core/net/sf/xmlunit/xpath/XPathEngine.java Removed Paths: ------------- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/ITransformationBuilderBase.java trunk/xmlunit/src/main/java-core/net/sf/xmlunit/diff/IDifferenceEngine.java trunk/xmlunit/src/main/java-core/net/sf/xmlunit/xpath/IXPathEngine.java Modified: trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/AbstractTransformationBuilder.java =================================================================== --- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/AbstractTransformationBuilder.java 2010-05-20 11:26:40 UTC (rev 397) +++ trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/AbstractTransformationBuilder.java 2010-05-21 15:12:49 UTC (rev 398) @@ -26,8 +26,8 @@ * <p>I wish there was a way to say <code>implements B</code>.</p> */ abstract class - AbstractTransformationBuilder<B extends ITransformationBuilderBase<B>> - implements ITransformationBuilderBase<B> { + AbstractTransformationBuilder<B extends TransformationBuilderBase<B>> + implements TransformationBuilderBase<B> { private final Transformation helper; Deleted: trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/ITransformationBuilderBase.java =================================================================== --- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/ITransformationBuilderBase.java 2010-05-20 11:26:40 UTC (rev 397) +++ trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/ITransformationBuilderBase.java 2010-05-21 15:12:49 UTC (rev 398) @@ -1,48 +0,0 @@ -/* - This file is licensed 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. -*/ -package net.sf.xmlunit.builder; - -import javax.xml.transform.Source; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.URIResolver; - -/** - * Holds the common builder methods for XSLT related builders. - * - * <p><code>B</code> is the derived builder interface.</p> - */ -public interface - ITransformationBuilderBase<B extends ITransformationBuilderBase<B>> { - /** - * sets the TraX factory to use. - */ - B usingFactory(TransformerFactory f); - /** - * Adds an output property. - */ - B withOutputProperty(String name, String value); - /** - * Adds a parameter. - */ - B withParameter(String name, Object value); - /** - * Sets the stylesheet to use. - */ - B withStylesheet(Source s); - /** - * Sets the resolver to use for the document() function and - * xsi:import/include. - */ - B withURIResolver(URIResolver r); -} Modified: trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/Input.java =================================================================== --- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/Input.java 2010-05-20 11:26:40 UTC (rev 397) +++ trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/Input.java 2010-05-21 15:12:49 UTC (rev 398) @@ -196,7 +196,7 @@ } public static interface TransformationBuilder - extends ITransformationBuilderBase<TransformationBuilder>, Builder { + extends TransformationBuilderBase<TransformationBuilder>, Builder { /** * Sets the stylesheet to use. */ Modified: trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/Transform.java =================================================================== --- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/Transform.java 2010-05-20 11:26:40 UTC (rev 397) +++ trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/Transform.java 2010-05-21 15:12:49 UTC (rev 398) @@ -23,7 +23,7 @@ */ public final class Transform { - public interface Builder extends ITransformationBuilderBase<Builder> { + public interface Builder extends TransformationBuilderBase<Builder> { /** * Create the result of the transformation. */ Copied: trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/TransformationBuilderBase.java (from rev 397, trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/ITransformationBuilderBase.java) =================================================================== --- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/TransformationBuilderBase.java (rev 0) +++ trunk/xmlunit/src/main/java-core/net/sf/xmlunit/builder/TransformationBuilderBase.java 2010-05-21 15:12:49 UTC (rev 398) @@ -0,0 +1,48 @@ +/* + This file is licensed 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. +*/ +package net.sf.xmlunit.builder; + +import javax.xml.transform.Source; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.URIResolver; + +/** + * Holds the common builder methods for XSLT related builders. + * + * <p><code>B</code> is the derived builder interface.</p> + */ +public interface + TransformationBuilderBase<B extends TransformationBuilderBase<B>> { + /** + * sets the TraX factory to use. + */ + B usingFactory(TransformerFactory f); + /** + * Adds an output property. + */ + B withOutputProperty(String name, String value); + /** + * Adds a parameter. + */ + B withParameter(String name, Object value); + /** + * Sets the stylesheet to use. + */ + B withStylesheet(Source s); + /** + * Sets the resolver to use for the document() function and + * xsi:import/include. + */ + B withURIResolver(URIResolver r); +} Copied: trunk/xmlunit/src/main/java-core/net/sf/xmlunit/diff/DifferenceEngine.java (from rev 397, trunk/xmlunit/src/main/java-core/net/sf/xmlunit/diff/IDifferenceEngine.java) =================================================================== --- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/diff/DifferenceEngine.java (rev 0) +++ trunk/xmlunit/src/main/java-core/net/sf/xmlunit/diff/DifferenceEngine.java 2010-05-21 15:12:49 UTC (rev 398) @@ -0,0 +1,54 @@ +/* + This file is licensed 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. +*/ +package net.sf.xmlunit.diff; + +import javax.xml.transform.Source; + +/** + * XMLUnit's difference engine. + */ +public interface DifferenceEngine { + /** + * Registers a listener that is notified of each comparison. + */ + void addComparisonListener(ComparisonListener l); + + /** + * Registers a listener that is notified of each comparison with + * outcome {@link ComparisonResult#EQUAL}. + */ + void addMatchListener(ComparisonListener l); + + /** + * Registers a listener that is notified of each comparison with + * outcome other than {@link ComparisonResult#EQUAL}. + */ + void addDifferenceListener(ComparisonListener l); + + /** + * Sets the strategy for selecting elements to compare. + */ + void setElementSelector(ElementSelector s); + + /** + * Determines whether the comparison should stop after given + * difference has been found. + */ + void setDifferenceEvaluator(DifferenceEvaluator e); + + /** + * Compares two pieces of XML and invokes the registered listeners. + */ + void compare(Source control, Source test); +} Deleted: trunk/xmlunit/src/main/java-core/net/sf/xmlunit/diff/IDifferenceEngine.java =================================================================== --- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/diff/IDifferenceEngine.java 2010-05-20 11:26:40 UTC (rev 397) +++ trunk/xmlunit/src/main/java-core/net/sf/xmlunit/diff/IDifferenceEngine.java 2010-05-21 15:12:49 UTC (rev 398) @@ -1,54 +0,0 @@ -/* - This file is licensed 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. -*/ -package net.sf.xmlunit.diff; - -import javax.xml.transform.Source; - -/** - * XMLUnit's difference engine. - */ -public interface IDifferenceEngine { - /** - * Registers a listener that is notified of each comparison. - */ - void addComparisonListener(ComparisonListener l); - - /** - * Registers a listener that is notified of each comparison with - * outcome {@link ComparisonResult#EQUAL}. - */ - void addMatchListener(ComparisonListener l); - - /** - * Registers a listener that is notified of each comparison with - * outcome other than {@link ComparisonResult#EQUAL}. - */ - void addDifferenceListener(ComparisonListener l); - - /** - * Sets the strategy for selecting elements to compare. - */ - void setElementSelector(ElementSelector s); - - /** - * Determines whether the comparison should stop after given - * difference has been found. - */ - void setDifferenceEvaluator(DifferenceEvaluator e); - - /** - * Compares two pieces of XML and invokes the registered listeners. - */ - void compare(Source control, Source test); -} Deleted: trunk/xmlunit/src/main/java-core/net/sf/xmlunit/xpath/IXPathEngine.java =================================================================== --- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/xpath/IXPathEngine.java 2010-05-20 11:26:40 UTC (rev 397) +++ trunk/xmlunit/src/main/java-core/net/sf/xmlunit/xpath/IXPathEngine.java 2010-05-21 15:12:49 UTC (rev 398) @@ -1,39 +0,0 @@ -/* - This file is licensed 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. -*/ -package net.sf.xmlunit.xpath; - -import java.util.Map; -import javax.xml.transform.Source; -import org.w3c.dom.Node; - -/** - * Interface for XMLUnit's XPath abstraction. - */ -public interface IXPathEngine { - /** - * Returns a potentially empty collection of Nodes matching an - * XPath expression. - */ - Iterable<Node> selectNodes(String xPath, Source s); - /** - * Evaluates an XPath expression and stringifies the result. - */ - String evaluate(String xPath, Source s); - /** - * Establish a namespace context. - * - * @param prefix2Uri maps from prefix to namespace URI. - */ - void setNamespaceContext(Map<String, String> prefix2Uri); -} Modified: trunk/xmlunit/src/main/java-core/net/sf/xmlunit/xpath/JAXPXPathEngine.java =================================================================== --- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/xpath/JAXPXPathEngine.java 2010-05-20 11:26:40 UTC (rev 397) +++ trunk/xmlunit/src/main/java-core/net/sf/xmlunit/xpath/JAXPXPathEngine.java 2010-05-21 15:12:49 UTC (rev 398) @@ -29,7 +29,7 @@ /** * Simplified access to JAXP's XPath API. */ -public class JAXPXPathEngine implements IXPathEngine { +public class JAXPXPathEngine implements XPathEngine { private final XPath xpath; public JAXPXPathEngine(XPathFactory fac) { Copied: trunk/xmlunit/src/main/java-core/net/sf/xmlunit/xpath/XPathEngine.java (from rev 397, trunk/xmlunit/src/main/java-core/net/sf/xmlunit/xpath/IXPathEngine.java) =================================================================== --- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/xpath/XPathEngine.java (rev 0) +++ trunk/xmlunit/src/main/java-core/net/sf/xmlunit/xpath/XPathEngine.java 2010-05-21 15:12:49 UTC (rev 398) @@ -0,0 +1,39 @@ +/* + This file is licensed 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. +*/ +package net.sf.xmlunit.xpath; + +import java.util.Map; +import javax.xml.transform.Source; +import org.w3c.dom.Node; + +/** + * Interface for XMLUnit's XPath abstraction. + */ +public interface XPathEngine { + /** + * Returns a potentially empty collection of Nodes matching an + * XPath expression. + */ + Iterable<Node> selectNodes(String xPath, Source s); + /** + * Evaluates an XPath expression and stringifies the result. + */ + String evaluate(String xPath, Source s); + /** + * Establish a namespace context. + * + * @param prefix2Uri maps from prefix to namespace URI. + */ + void setNamespaceContext(Map<String, String> prefix2Uri); +} Modified: trunk/xmlunit/src/tests/java-core/net/sf/xmlunit/xpath/AbstractXPathEngineTest.java =================================================================== --- trunk/xmlunit/src/tests/java-core/net/sf/xmlunit/xpath/AbstractXPathEngineTest.java 2010-05-20 11:26:40 UTC (rev 397) +++ trunk/xmlunit/src/tests/java-core/net/sf/xmlunit/xpath/AbstractXPathEngineTest.java 2010-05-21 15:12:49 UTC (rev 398) @@ -27,7 +27,7 @@ public abstract class AbstractXPathEngineTest { - protected abstract IXPathEngine getEngine(); + protected abstract XPathEngine getEngine(); private Source source; @@ -91,7 +91,7 @@ } @Test public void selectNodesWithNS() { - IXPathEngine e = getEngine(); + XPathEngine e = getEngine(); source = Input.fromMemory("<n:d xmlns:n='urn:test:1'><n:e/></n:d>") .build(); HashMap<String, String> m = new HashMap<String, String>(); @@ -102,7 +102,7 @@ } @Test public void selectNodesWithDefaultNS() { - IXPathEngine e = getEngine(); + XPathEngine e = getEngine(); source = Input.fromMemory("<d xmlns='urn:test:1'><e/></d>") .build(); HashMap<String, String> m = new HashMap<String, String>(); @@ -113,7 +113,7 @@ } @Test public void selectNodesWithDefaultNSEmptyPrefix() { - IXPathEngine e = getEngine(); + XPathEngine e = getEngine(); source = Input.fromMemory("<d xmlns='urn:test:1'><e/></d>") .build(); HashMap<String, String> m = new HashMap<String, String>(); @@ -125,7 +125,7 @@ // doesn't match public void selectNodesWithDefaultNSNoPrefix() { - IXPathEngine e = getEngine(); + XPathEngine e = getEngine(); source = Input.fromMemory("<d xmlns='urn:test:1'><e/></d>") .build(); HashMap<String, String> m = new HashMap<String, String>(); Modified: trunk/xmlunit/src/tests/java-core/net/sf/xmlunit/xpath/JAXPXPathEngineTest.java =================================================================== --- trunk/xmlunit/src/tests/java-core/net/sf/xmlunit/xpath/JAXPXPathEngineTest.java 2010-05-20 11:26:40 UTC (rev 397) +++ trunk/xmlunit/src/tests/java-core/net/sf/xmlunit/xpath/JAXPXPathEngineTest.java 2010-05-21 15:12:49 UTC (rev 398) @@ -14,7 +14,7 @@ package net.sf.xmlunit.xpath; public class JAXPXPathEngineTest extends AbstractXPathEngineTest { - @Override protected IXPathEngine getEngine() { + @Override protected XPathEngine getEngine() { return new JAXPXPathEngine(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |