From: <bo...@us...> - 2009-05-12 10:46:57
|
Revision: 317 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=317&view=rev Author: bodewig Date: 2009-05-12 10:46:49 +0000 (Tue, 12 May 2009) Log Message: ----------- fix eol-style Modified Paths: -------------- trunk/xmlunit/src/main/net-core/ISource.cs trunk/xmlunit/src/main/net-core/builder/Input.cs trunk/xmlunit/src/main/net-core/input/AbstractSource.cs trunk/xmlunit/src/main/net-core/input/DOMSource.cs trunk/xmlunit/src/main/net-core/input/ReaderSource.cs trunk/xmlunit/src/main/net-core/input/StreamSource.cs Property Changed: ---------------- trunk/xmlunit/src/main/net-core/ISource.cs trunk/xmlunit/src/main/net-core/builder/Input.cs trunk/xmlunit/src/main/net-core/input/AbstractSource.cs trunk/xmlunit/src/main/net-core/input/DOMSource.cs trunk/xmlunit/src/main/net-core/input/ReaderSource.cs trunk/xmlunit/src/main/net-core/input/StreamSource.cs Modified: trunk/xmlunit/src/main/net-core/ISource.cs =================================================================== --- trunk/xmlunit/src/main/net-core/ISource.cs 2009-05-12 04:29:34 UTC (rev 316) +++ trunk/xmlunit/src/main/net-core/ISource.cs 2009-05-12 10:46:49 UTC (rev 317) @@ -1,20 +1,20 @@ -/* - 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. -*/ -using System.Xml; - -namespace net.sf.xmlunit { - public interface ISource { - XmlReader Reader {get;} - } -} +/* + 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. +*/ +using System.Xml; + +namespace net.sf.xmlunit { + public interface ISource { + XmlReader Reader {get;} + } +} Property changes on: trunk/xmlunit/src/main/net-core/ISource.cs ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/xmlunit/src/main/net-core/builder/Input.cs =================================================================== --- trunk/xmlunit/src/main/net-core/builder/Input.cs 2009-05-12 04:29:34 UTC (rev 316) +++ trunk/xmlunit/src/main/net-core/builder/Input.cs 2009-05-12 10:46:49 UTC (rev 317) @@ -1,136 +1,136 @@ -/* - 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. -*/ -using System.IO; -using System.Xml; -using System.Xml.Xsl; -using net.sf.xmlunit.input; - -namespace net.sf.xmlunit.builder { - public static class Input { - public interface IBuilder { - ISource Build(); - } - - internal class DOMBuilder : IBuilder { - private readonly ISource source; - internal DOMBuilder(XmlDocument d) { - source = new DOMSource(d); - } - public ISource Build() { - return source; - } - } - - public static IBuilder FromDocument(XmlDocument d) { - return new DOMBuilder(d); - } - - internal class StreamBuilder : IBuilder { - private readonly ISource source; - internal StreamBuilder(string s) { - source = new StreamSource(s); - } - internal StreamBuilder(Stream s) { - source = new StreamSource(s); - } - internal StreamBuilder(TextReader r) { - source = new StreamSource(r); - } - public ISource Build() { - return source; - } - } - - public static IBuilder FromFile(string name) { - return new StreamBuilder(name); - } - - public static IBuilder FromStream(Stream s) { - return new StreamBuilder(s); - } - - public static IBuilder FromReader(TextReader r) { - return new StreamBuilder(r); - } - - public static IBuilder FromMemory(string s) { - return FromReader(new StringReader(s)); - } - - public static IBuilder FromMemory(byte[] b) { - return FromStream(new MemoryStream(b)); - } - - public static IBuilder FromURI(string uri) { - return new StreamBuilder(uri); - } - - public static IBuilder FromURI(System.Uri uri) { - return new StreamBuilder(uri.AbsoluteUri); - } - - public interface ITransformationBuilder : IBuilder { - ITransformationBuilder WithStylesheet(ISource s); - ITransformationBuilder WithExtensionObject(string namespaceUri, - object extension); - ITransformationBuilder WithParameter(string name, - string namespaceUri, - object parameter); - } - - internal class Transformation : ITransformationBuilder { - private readonly ISource source; - private ISource styleSheet; - private readonly XsltArgumentList args = new XsltArgumentList(); - internal Transformation(ISource s) { - source = s; - } - public ITransformationBuilder WithStylesheet(ISource s) { - this.styleSheet = styleSheet; - return this; - } - - public ITransformationBuilder WithExtensionObject(string namespaceUri, - object extension) { - args.AddExtensionObject(namespaceUri, extension); - return this; - } - - public ITransformationBuilder WithParameter(string name, - string namespaceUri, - object parameter) { - args.AddParam(name, namespaceUri, parameter); - return this; - } - - public ISource Build() { - XslCompiledTransform t = new XslCompiledTransform(); - if (styleSheet != null) { - t.Load(styleSheet.Reader); - } - MemoryStream ms = new MemoryStream(); - using (ms) { - t.Transform(source.Reader, - args, - ms); - } - return FromMemory(ms.ToArray()).Build(); - } - } - - public static ITransformationBuilder ByTransforming(ISource s) { - return new Transformation(s); - } - } -} +/* + 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. +*/ +using System.IO; +using System.Xml; +using System.Xml.Xsl; +using net.sf.xmlunit.input; + +namespace net.sf.xmlunit.builder { + public static class Input { + public interface IBuilder { + ISource Build(); + } + + internal class DOMBuilder : IBuilder { + private readonly ISource source; + internal DOMBuilder(XmlDocument d) { + source = new DOMSource(d); + } + public ISource Build() { + return source; + } + } + + public static IBuilder FromDocument(XmlDocument d) { + return new DOMBuilder(d); + } + + internal class StreamBuilder : IBuilder { + private readonly ISource source; + internal StreamBuilder(string s) { + source = new StreamSource(s); + } + internal StreamBuilder(Stream s) { + source = new StreamSource(s); + } + internal StreamBuilder(TextReader r) { + source = new StreamSource(r); + } + public ISource Build() { + return source; + } + } + + public static IBuilder FromFile(string name) { + return new StreamBuilder(name); + } + + public static IBuilder FromStream(Stream s) { + return new StreamBuilder(s); + } + + public static IBuilder FromReader(TextReader r) { + return new StreamBuilder(r); + } + + public static IBuilder FromMemory(string s) { + return FromReader(new StringReader(s)); + } + + public static IBuilder FromMemory(byte[] b) { + return FromStream(new MemoryStream(b)); + } + + public static IBuilder FromURI(string uri) { + return new StreamBuilder(uri); + } + + public static IBuilder FromURI(System.Uri uri) { + return new StreamBuilder(uri.AbsoluteUri); + } + + public interface ITransformationBuilder : IBuilder { + ITransformationBuilder WithStylesheet(ISource s); + ITransformationBuilder WithExtensionObject(string namespaceUri, + object extension); + ITransformationBuilder WithParameter(string name, + string namespaceUri, + object parameter); + } + + internal class Transformation : ITransformationBuilder { + private readonly ISource source; + private ISource styleSheet; + private readonly XsltArgumentList args = new XsltArgumentList(); + internal Transformation(ISource s) { + source = s; + } + public ITransformationBuilder WithStylesheet(ISource s) { + this.styleSheet = styleSheet; + return this; + } + + public ITransformationBuilder WithExtensionObject(string namespaceUri, + object extension) { + args.AddExtensionObject(namespaceUri, extension); + return this; + } + + public ITransformationBuilder WithParameter(string name, + string namespaceUri, + object parameter) { + args.AddParam(name, namespaceUri, parameter); + return this; + } + + public ISource Build() { + XslCompiledTransform t = new XslCompiledTransform(); + if (styleSheet != null) { + t.Load(styleSheet.Reader); + } + MemoryStream ms = new MemoryStream(); + using (ms) { + t.Transform(source.Reader, + args, + ms); + } + return FromMemory(ms.ToArray()).Build(); + } + } + + public static ITransformationBuilder ByTransforming(ISource s) { + return new Transformation(s); + } + } +} Property changes on: trunk/xmlunit/src/main/net-core/builder/Input.cs ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/xmlunit/src/main/net-core/input/AbstractSource.cs =================================================================== --- trunk/xmlunit/src/main/net-core/input/AbstractSource.cs 2009-05-12 04:29:34 UTC (rev 316) +++ trunk/xmlunit/src/main/net-core/input/AbstractSource.cs 2009-05-12 10:46:49 UTC (rev 317) @@ -1,28 +1,28 @@ -/* - 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. -*/ -using System.Xml; - -namespace net.sf.xmlunit.input { - public abstract class AbstractSource : ISource { - private readonly XmlReader reader; - protected AbstractSource(XmlReader r) { - reader = r; - } - public XmlReader Reader { - get { - return reader; - } - } - } -} +/* + 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. +*/ +using System.Xml; + +namespace net.sf.xmlunit.input { + public abstract class AbstractSource : ISource { + private readonly XmlReader reader; + protected AbstractSource(XmlReader r) { + reader = r; + } + public XmlReader Reader { + get { + return reader; + } + } + } +} Property changes on: trunk/xmlunit/src/main/net-core/input/AbstractSource.cs ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/xmlunit/src/main/net-core/input/DOMSource.cs =================================================================== --- trunk/xmlunit/src/main/net-core/input/DOMSource.cs 2009-05-12 04:29:34 UTC (rev 316) +++ trunk/xmlunit/src/main/net-core/input/DOMSource.cs 2009-05-12 10:46:49 UTC (rev 317) @@ -1,22 +1,22 @@ -/* - 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. -*/ -using System.Xml; - -namespace net.sf.xmlunit.input { - public class DOMSource : AbstractSource { - public DOMSource(XmlNode node) - : base(new XmlNodeReader(node)) { - } - } -} +/* + 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. +*/ +using System.Xml; + +namespace net.sf.xmlunit.input { + public class DOMSource : AbstractSource { + public DOMSource(XmlNode node) + : base(new XmlNodeReader(node)) { + } + } +} Property changes on: trunk/xmlunit/src/main/net-core/input/DOMSource.cs ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/xmlunit/src/main/net-core/input/ReaderSource.cs =================================================================== --- trunk/xmlunit/src/main/net-core/input/ReaderSource.cs 2009-05-12 04:29:34 UTC (rev 316) +++ trunk/xmlunit/src/main/net-core/input/ReaderSource.cs 2009-05-12 10:46:49 UTC (rev 317) @@ -1,22 +1,22 @@ -/* - 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. -*/ -using System.Xml; - -namespace net.sf.xmlunit.input { - public class ReaderSource : AbstractSource { - public ReaderSource(XmlReader rdr) - : base(rdr) { - } - } -} +/* + 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. +*/ +using System.Xml; + +namespace net.sf.xmlunit.input { + public class ReaderSource : AbstractSource { + public ReaderSource(XmlReader rdr) + : base(rdr) { + } + } +} Property changes on: trunk/xmlunit/src/main/net-core/input/ReaderSource.cs ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/xmlunit/src/main/net-core/input/StreamSource.cs =================================================================== --- trunk/xmlunit/src/main/net-core/input/StreamSource.cs 2009-05-12 04:29:34 UTC (rev 316) +++ trunk/xmlunit/src/main/net-core/input/StreamSource.cs 2009-05-12 10:46:49 UTC (rev 317) @@ -1,31 +1,31 @@ -/* - 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. -*/ -using System.IO; -using System.Xml; - -namespace net.sf.xmlunit.input { - public class StreamSource : AbstractSource { - public StreamSource(TextReader rdr) - : base(XmlReader.Create(rdr)) { - } - - public StreamSource(Stream stream) - : base(XmlReader.Create(stream)) { - } - - public StreamSource(string uri) - : base(XmlReader.Create(uri)) { - } - } -} +/* + 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. +*/ +using System.IO; +using System.Xml; + +namespace net.sf.xmlunit.input { + public class StreamSource : AbstractSource { + public StreamSource(TextReader rdr) + : base(XmlReader.Create(rdr)) { + } + + public StreamSource(Stream stream) + : base(XmlReader.Create(stream)) { + } + + public StreamSource(string uri) + : base(XmlReader.Create(uri)) { + } + } +} Property changes on: trunk/xmlunit/src/main/net-core/input/StreamSource.cs ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |