Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 13843 invoked from network); 9 Feb 2009 14:49:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2009 14:49:34 -0000 Received: (qmail 34704 invoked by uid 500); 9 Feb 2009 14:49:34 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 34669 invoked by uid 500); 9 Feb 2009 14:49:33 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 34660 invoked by uid 99); 9 Feb 2009 14:49:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 06:49:33 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 14:49:32 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 663E22388962; Mon, 9 Feb 2009 14:49:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r742538 - in /jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/xml: ParsingContentHandlerTest.java SerializingContentHandlerTest.java Date: Mon, 09 Feb 2009 14:49:12 -0000 To: commits@jackrabbit.apache.org From: jukka@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090209144912.663E22388962@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jukka Date: Mon Feb 9 14:49:11 2009 New Revision: 742538 URL: http://svn.apache.org/viewvc?rev=742538&view=rev Log: Added missing svn:eol-style settings Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/xml/ParsingContentHandlerTest.java (contents, props changed) jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/xml/SerializingContentHandlerTest.java (contents, props changed) Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/xml/ParsingContentHandlerTest.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/xml/ParsingContentHandlerTest.java?rev=742538&r1=742537&r2=742538&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/xml/ParsingContentHandlerTest.java (original) +++ jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/xml/ParsingContentHandlerTest.java Mon Feb 9 14:49:11 2009 @@ -1,76 +1,76 @@ -/* - * 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. - */ -package org.apache.jackrabbit.commons.xml; - -import java.io.ByteArrayInputStream; -import java.io.StringWriter; - -import junit.framework.TestCase; - -import org.xml.sax.ContentHandler; -import org.xml.sax.helpers.DefaultHandler; - -public class ParsingContentHandlerTest extends TestCase { - - public void testParsingContentHandler() throws Exception { - String source = - "abcxyz"; - StringWriter writer = new StringWriter(); - - ContentHandler handler = - SerializingContentHandler.getSerializer(writer); - new ParsingContentHandler(handler).parse( - new ByteArrayInputStream(source.getBytes("UTF-8"))); - - String xml = writer.toString(); - assertContains(xml, ""); - assertContains(xml, ""); - assertContains(xml, ""); - assertContains(xml, "xyz"); - assertContains(xml, ""); - } - - /** - * Test case for JCR-1355. - * - * @see https://issues.apache.org/jira/browse/JCR-1355 - */ - public void testExternalEntities() { - try { - String source = - ""; - new ParsingContentHandler(new DefaultHandler()).parse( - new ByteArrayInputStream(source.getBytes("UTF-8"))); - } catch (Exception e) { - fail("JCR-1355: XML import should not access external entities"); - } - } - - private void assertContains(String haystack, String needle) { - if (haystack.indexOf(needle) == -1) { - fail("'" + haystack + "' does not contain '" + needle+ "'"); - } - } -} +/* + * 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. + */ +package org.apache.jackrabbit.commons.xml; + +import java.io.ByteArrayInputStream; +import java.io.StringWriter; + +import junit.framework.TestCase; + +import org.xml.sax.ContentHandler; +import org.xml.sax.helpers.DefaultHandler; + +public class ParsingContentHandlerTest extends TestCase { + + public void testParsingContentHandler() throws Exception { + String source = + "abcxyz"; + StringWriter writer = new StringWriter(); + + ContentHandler handler = + SerializingContentHandler.getSerializer(writer); + new ParsingContentHandler(handler).parse( + new ByteArrayInputStream(source.getBytes("UTF-8"))); + + String xml = writer.toString(); + assertContains(xml, ""); + assertContains(xml, ""); + assertContains(xml, ""); + assertContains(xml, "xyz"); + assertContains(xml, ""); + } + + /** + * Test case for JCR-1355. + * + * @see https://issues.apache.org/jira/browse/JCR-1355 + */ + public void testExternalEntities() { + try { + String source = + ""; + new ParsingContentHandler(new DefaultHandler()).parse( + new ByteArrayInputStream(source.getBytes("UTF-8"))); + } catch (Exception e) { + fail("JCR-1355: XML import should not access external entities"); + } + } + + private void assertContains(String haystack, String needle) { + if (haystack.indexOf(needle) == -1) { + fail("'" + haystack + "' does not contain '" + needle+ "'"); + } + } +} Propchange: jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/xml/ParsingContentHandlerTest.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/xml/SerializingContentHandlerTest.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/xml/SerializingContentHandlerTest.java?rev=742538&r1=742537&r2=742538&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/xml/SerializingContentHandlerTest.java (original) +++ jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/xml/SerializingContentHandlerTest.java Mon Feb 9 14:49:11 2009 @@ -1,108 +1,108 @@ -/* - * 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. - */ -package org.apache.jackrabbit.commons.xml; - -import java.io.StringWriter; - -import junit.framework.TestCase; - -import org.xml.sax.ContentHandler; -import org.xml.sax.helpers.AttributesImpl; - -public class SerializingContentHandlerTest extends TestCase { - - public void testSerializingContentHandler() throws Exception { - StringWriter writer = new StringWriter(); - - ContentHandler handler = - SerializingContentHandler.getSerializer(writer); - handler.startDocument(); - handler.startPrefixMapping("p", "uri"); - handler.startElement("uri", "a", "p:a", new AttributesImpl()); - AttributesImpl attributes = new AttributesImpl(); - attributes.addAttribute("uri", "foo", "p:foo", "CDATA", "bar"); - handler.startElement(null, "b", "b", attributes); - handler.characters("abc".toCharArray(), 0, 3); - handler.endElement(null, "b", "b"); - handler.startElement(null, "c", "c", new AttributesImpl()); - handler.endElement(null, "c", "c"); - handler.characters("xyz".toCharArray(), 0, 3); - handler.endElement("uri", "a", "p:a"); - handler.endPrefixMapping("p"); - handler.endDocument(); - - String xml = writer.toString(); - assertContains(xml, ""); - assertContains(xml, ""); - assertContains(xml, ""); - assertContains(xml, "xyz"); - assertContains(xml, ""); - } - - /** - * Test case for JCR-1767. - * - * @see JCR-1767 - */ - public void testNoPrefixMappingCalls() throws Exception { - StringWriter writer = new StringWriter(); - - ContentHandler handler = - SerializingContentHandler.getSerializer(writer); - handler.startDocument(); - handler.startElement("uri", "a", "p:a", new AttributesImpl()); - AttributesImpl attributes = new AttributesImpl(); - attributes.addAttribute("uri", "foo", "p:foo", "CDATA", "bar"); - handler.startElement(null, "b", "b", attributes); - handler.characters("abc".toCharArray(), 0, 3); - handler.endElement(null, "b", "b"); - handler.startElement(null, "c", "c", new AttributesImpl()); - handler.endElement(null, "c", "c"); - handler.characters("xyz".toCharArray(), 0, 3); - handler.endElement("uri", "a", "p:a"); - handler.endDocument(); - - String xml = writer.toString(); - assertContains(xml, ""); - assertContains(xml, ""); - assertContains(xml, ""); - assertContains(xml, "xyz"); - assertContains(xml, ""); - } - - private void assertContains(String haystack, String needle) { - if (haystack.indexOf(needle) == -1) { - fail("'" + haystack + "' does not contain '" + needle+ "'"); - } - } -} +/* + * 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. + */ +package org.apache.jackrabbit.commons.xml; + +import java.io.StringWriter; + +import junit.framework.TestCase; + +import org.xml.sax.ContentHandler; +import org.xml.sax.helpers.AttributesImpl; + +public class SerializingContentHandlerTest extends TestCase { + + public void testSerializingContentHandler() throws Exception { + StringWriter writer = new StringWriter(); + + ContentHandler handler = + SerializingContentHandler.getSerializer(writer); + handler.startDocument(); + handler.startPrefixMapping("p", "uri"); + handler.startElement("uri", "a", "p:a", new AttributesImpl()); + AttributesImpl attributes = new AttributesImpl(); + attributes.addAttribute("uri", "foo", "p:foo", "CDATA", "bar"); + handler.startElement(null, "b", "b", attributes); + handler.characters("abc".toCharArray(), 0, 3); + handler.endElement(null, "b", "b"); + handler.startElement(null, "c", "c", new AttributesImpl()); + handler.endElement(null, "c", "c"); + handler.characters("xyz".toCharArray(), 0, 3); + handler.endElement("uri", "a", "p:a"); + handler.endPrefixMapping("p"); + handler.endDocument(); + + String xml = writer.toString(); + assertContains(xml, ""); + assertContains(xml, ""); + assertContains(xml, ""); + assertContains(xml, "xyz"); + assertContains(xml, ""); + } + + /** + * Test case for JCR-1767. + * + * @see JCR-1767 + */ + public void testNoPrefixMappingCalls() throws Exception { + StringWriter writer = new StringWriter(); + + ContentHandler handler = + SerializingContentHandler.getSerializer(writer); + handler.startDocument(); + handler.startElement("uri", "a", "p:a", new AttributesImpl()); + AttributesImpl attributes = new AttributesImpl(); + attributes.addAttribute("uri", "foo", "p:foo", "CDATA", "bar"); + handler.startElement(null, "b", "b", attributes); + handler.characters("abc".toCharArray(), 0, 3); + handler.endElement(null, "b", "b"); + handler.startElement(null, "c", "c", new AttributesImpl()); + handler.endElement(null, "c", "c"); + handler.characters("xyz".toCharArray(), 0, 3); + handler.endElement("uri", "a", "p:a"); + handler.endDocument(); + + String xml = writer.toString(); + assertContains(xml, ""); + assertContains(xml, ""); + assertContains(xml, ""); + assertContains(xml, "xyz"); + assertContains(xml, ""); + } + + private void assertContains(String haystack, String needle) { + if (haystack.indexOf(needle) == -1) { + fail("'" + haystack + "' does not contain '" + needle+ "'"); + } + } +} Propchange: jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/xml/SerializingContentHandlerTest.java ------------------------------------------------------------------------------ svn:eol-style = native