Author: tilman
Date: Fri Jun 14 14:39:31 2024
New Revision: 1918339

URL: http://svn.apache.org/viewvc?rev=1918339&view=rev
Log:
PDFBOX-5835: add test with reduced file

Added:
    pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/xml/
    
pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java
   (with props)
    pdfbox/branches/2.0/xmpbox/src/test/resources/org/apache/xmpbox/xml/
    
pdfbox/branches/2.0/xmpbox/src/test/resources/org/apache/xmpbox/xml/PDFBOX-5835.xml
   (with props)

Added: 
pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java
URL: 
http://svn.apache.org/viewvc/pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java?rev=1918339&view=auto
==============================================================================
--- 
pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java
 (added)
+++ 
pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java
 Fri Jun 14 14:39:31 2024
@@ -0,0 +1,52 @@
+/** ***************************************************************************
+ *
+ * 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.xmpbox.xml;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.xmpbox.XMPMetadata;
+import static org.junit.Assert.assertEquals;
+import org.junit.Test;
+
+/**
+ *
+ * @author Tilman Hausherr
+ */
+public class DomXmpParserTest
+{
+
+    public DomXmpParserTest()
+    {
+    }
+
+    @Test
+    public void testPDFBox5835() throws IOException, XmpParsingException
+    {
+        InputStream fis = 
DomXmpParser.class.getResourceAsStream("/org/apache/xmpbox/xml/PDFBOX-5835.xml");
+        DomXmpParser dxp = new DomXmpParser();
+        dxp.setStrictParsing(false);
+        XMPMetadata xmp = dxp.parse(fis);
+        assertEquals("A", xmp.getPDFIdentificationSchema().getConformance());
+        assertEquals((Integer) 3, xmp.getPDFIdentificationSchema().getPart());
+        fis.close();
+    }
+}

Propchange: 
pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
pdfbox/branches/2.0/xmpbox/src/test/resources/org/apache/xmpbox/xml/PDFBOX-5835.xml
URL: 
http://svn.apache.org/viewvc/pdfbox/branches/2.0/xmpbox/src/test/resources/org/apache/xmpbox/xml/PDFBOX-5835.xml?rev=1918339&view=auto
==============================================================================
--- 
pdfbox/branches/2.0/xmpbox/src/test/resources/org/apache/xmpbox/xml/PDFBOX-5835.xml
 (added)
+++ 
pdfbox/branches/2.0/xmpbox/src/test/resources/org/apache/xmpbox/xml/PDFBOX-5835.xml
 Fri Jun 14 14:39:31 2024
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+/*
+ * 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.
+ */
+ -->
+<?xpacket begin="?" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta 
xmlns:x="adobe:ns:meta/" x:xmptk="FIS/xee">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";>
+ <rdf:Description xmlns:pdfaid="http://www.aiim.org/pdfa/ns/id/";>
+   <pdfaid:part>3</pdfaid:part>
+   <pdfaid:conformance>A</pdfaid:conformance>
+ </rdf:Description>
+ <rdf:Description xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/"; 
xmlns:pdfaField="http://www.aiim.org/pdfa/ns/field#"; 
xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#"; 
xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#"; 
xmlns:pdfaType="http://www.aiim.org/pdfa/ns/type#"; rdf:about=""/>
+ <rdf:Description>
+   <schemas xmlns="http://www.aiim.org/pdfa/ns/extension/";>
+    <rdf:Bag>
+     <rdf:li rdf:parseType="Resource">
+      <schema xmlns="http://www.aiim.org/pdfa/ns/schema#";>Some Schema</schema>
+     </rdf:li>
+    </rdf:Bag>
+   </schemas>
+  </rdf:Description>
+ </rdf:RDF>
+</x:xmpmeta><?xpacket end="w"?>
\ No newline at end of file

Propchange: 
pdfbox/branches/2.0/xmpbox/src/test/resources/org/apache/xmpbox/xml/PDFBOX-5835.xml
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to