Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit 89257a9

Browse files
author
Radu Preotiuc
committed
Updated the build to download a new version of the JSR-173 jar licensed under Apache.
Contributed by Lawrence Jones git-svn-id: https://svn.apache.org/repos/asf/xmlbeans/trunk@312915 13f79535-47bb-0310-9956-ffa450edef68
1 parent 47308f6 commit 89257a9

File tree

7 files changed

+74
-107
lines changed

7 files changed

+74
-107
lines changed

NOTICE.txt

+3
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@
2424

2525
- Piccolo XML Parser for Java from http://piccolo.sourceforge.net/,
2626
Copyright 2002 Yuval Oren under the terms of the Apache Software License 2.0
27+
28+
- JSR-173 Streaming API for XML from http://sourceforge.net/projects/xmlpullparser/,
29+
Copyright 2005 BEA under the terms of the Apache Software License 2.0

build.xml

+22-23
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,18 @@
5454
<delete>
5555
<fileset dir="external/lib">
5656
<include name="saxonb8-2.zip"/>
57-
<include name="jsr173_1.0_api-mini-bundle.jar"/>
57+
<include name="jsr173_1.0_api_bundle.jar"/>
5858
<include name="jsr173_1.0_api.jar"/>
59-
<include name="jsr173_1.0_ri.jar"/>
60-
<include name="BEA Binary RI License (JSR 173).1(Clean).txt"/>
61-
<include name="README(jsr_173 api and ri).txt"/>
6259
<include name="saxon8.jar"/>
6360
<include name="xcresolver.zip"/>
64-
<!-- the 3 entries below are to delete the previous versions of the jsr173 jars -->
61+
<!-- the entries below are to delete the previous versions of the jsr173 jars -->
6562
<include name="jsr173.jar"/>
6663
<include name="jsr173_api.jar"/>
6764
<include name="jsr173_ri.jar"/>
65+
<include name="jsr173_1.0_api-mini-bundle.jar"/>
66+
<include name="jsr173_1.0_ri.jar"/>
67+
<include name="BEA Binary RI License (JSR 173).1(Clean).txt"/>
68+
<include name="README(jsr_173 api and ri).txt"/>
6869
</fileset>
6970
</delete>
7071
</target>
@@ -110,39 +111,37 @@
110111
<copy file="external/lib/saxon8.jar" tofile="build/lib/saxon8.jar"/>
111112
</target>
112113

113-
<target name="jsr173-mini-bundle.downloaded">
114-
<condition property="jsr173-mini-bundle.exists">
115-
<available file="external/lib/jsr173_1.0_api-mini-bundle.jar"/>
114+
<target name="jsr173-bundle.downloaded">
115+
<condition property="jsr173-bundle.exists">
116+
<available file="external/lib/jsr173_1.0_api_bundle.jar"/>
116117
</condition>
117118
</target>
118119

119-
<target name="jsr173-mini-bundle.jar"
120-
depends="jsr173-mini-bundle.downloaded, dirs"
121-
unless="jsr173-mini-bundle.exists">
122-
<get dest="external/lib/jsr173_1.0_api-mini-bundle.jar"
123-
src="http://workshop.bea.com/xmlbeans/jsr173v1/jsr173_1.0_api-mini-bundle.jar"
120+
<target name="jsr173-bundle.jar"
121+
depends="jsr173-bundle.downloaded, dirs"
122+
unless="jsr173-bundle.exists">
123+
<get dest="external/lib/jsr173_1.0_api_bundle.jar"
124+
src="http://workshop.bea.com/xmlbeans/jsr173v1/jsr173_1.0_api_bundle.jar"
124125
verbose="true" usetimestamp="true" ignoreerrors="true"/>
125126
</target>
126127

127128
<target name="jsr173_1.0.jars.extracted">
128129
<condition property="jsr173_1.0.jars.exist">
129-
<and>
130-
<available file="build/lib/jsr173_1.0_api.jar"/>
131-
<available file="build/lib/jsr173_1.0_ri.jar"/>
132-
</and>
130+
<available file="build/lib/jsr173_1.0_api.jar"/>
133131
</condition>
134132
</target>
135133

136134
<target name="jsr173_1.0.jars"
137-
depends="jsr173-mini-bundle.jar, jsr173_1.0.jars.extracted"
135+
depends="jsr173-bundle.jar, jsr173_1.0.jars.extracted"
138136
unless="jsr173_1.0.jars.exist">
139-
<unjar src="external/lib/jsr173_1.0_api-mini-bundle.jar" dest="external/lib" />
137+
<unjar src="external/lib/jsr173_1.0_api_bundle.jar" dest="external/lib" >
138+
<patternset>
139+
<include name="jsr173_1.0_api.jar"/>
140+
</patternset>
141+
</unjar>
140142

141-
<!-- copy jsr173 API and RI jars and license files to build/lib -->
143+
<!-- copy jsr173 API jar and license files to build/lib -->
142144
<copy file="external/lib/jsr173_1.0_api.jar" tofile="build/lib/jsr173_1.0_api.jar"/>
143-
<copy file="external/lib/jsr173_1.0_ri.jar" tofile="build/lib/jsr173_1.0_ri.jar"/>
144-
<copy file="external/lib/BEA Binary RI License (JSR 173).1(Clean).txt" tofile="build/lib/BEA Binary RI License (JSR 173).1(Clean).txt"/>
145-
<copy file="external/lib/README(jsr_173 api and ri).txt" tofile="build/lib/README(jsr_173 api and ri).txt"/>
146145
</target>
147146

148147
<!-- get resolver.jar -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* Copyright 2004 The Apache Software Foundation
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
package javax.xml.namespace;
17+
18+
import java.util.Iterator;
19+
20+
public interface NamespaceContext {
21+
22+
public String getNamespaceURI(String prefix);
23+
public String getPrefix(String namespaceURI);
24+
public Iterator getPrefixes(String namespaceURI);
25+
}

test/src/ValidatingXSRTests/checkin/ValidatingXMLStreamReaderTests.java

+17-5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.io.FileNotFoundException;
3030
import java.io.FileInputStream;
3131
import java.io.File;
32+
import java.io.IOException;
3233
import java.io.StringReader;
3334
import java.util.Collection;
3435
import java.util.ArrayList;
@@ -41,6 +42,7 @@
4142
import org.apache.xmlbeans.XmlObject;
4243
import org.apache.xmlbeans.XmlCursor;
4344
import org.apache.xmlbeans.XmlOptions;
45+
import org.apache.xmlbeans.XmlException;
4446

4547
import org.openuri.testNumerals.DocDocument;
4648

@@ -75,13 +77,18 @@ public void testValidateDoc() throws FileNotFoundException, XMLStreamException,E
7577
}
7678
}
7779

78-
private static void validate(ValidatingXMLStreamReader valXsr, File file) throws XMLStreamException, FileNotFoundException
80+
private static void validate(ValidatingXMLStreamReader valXsr, File file) throws XMLStreamException, IOException
7981
{
8082
Collection errors = new ArrayList();
81-
XMLStreamReader xsr = XMLInputFactory.newInstance().
82-
createXMLStreamReader(new FileInputStream(file));
83+
XMLStreamReader xsr = null;
84+
try {
85+
xsr = XmlObject.Factory.
86+
parse(new FileInputStream(file)).newXMLStreamReader();
87+
} catch (XmlException e) {
88+
throw new XMLStreamException(e);
89+
}
8390

84-
valXsr.init(xsr, false, null /* validate an entire document */ ,
91+
valXsr.init(xsr, true, null /* validate an entire document */ ,
8592
XmlBeans.typeLoaderForClassLoader(ValidatingXMLStreamReader.class.getClassLoader()),
8693
null,
8794
errors);
@@ -508,7 +515,12 @@ public void testValidateContent2() throws XMLStreamException
508515
{
509516
String doc = "<doc xmlns='" + URI_NUMERALS + "'><int>5</int><float>7.654321</float></doc>";
510517

511-
XMLStreamReader xsr = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(doc));
518+
XMLStreamReader xsr = null;
519+
try {
520+
xsr = XmlObject.Factory.parse(doc).newXMLStreamReader();
521+
} catch (XmlException e) {
522+
throw new XMLStreamException(e);
523+
}
512524
xsr.nextTag();
513525

514526
Collection errors = new ArrayList();

test/src/misc/checkin/RichParserTests.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import org.apache.xmlbeans.GDuration;
2525
import org.apache.xmlbeans.GDurationBuilder;
2626
import org.apache.xmlbeans.XmlCalendar;
27+
import org.apache.xmlbeans.XmlObject;
28+
import org.apache.xmlbeans.XmlException;
2729
import org.apache.xmlbeans.impl.richParser.XMLStreamReaderExt;
2830
import org.apache.xmlbeans.impl.richParser.XMLStreamReaderExtImpl;
2931

@@ -57,9 +59,9 @@ public class RichParserTests extends TestCase
5759

5860
public void testPrimitiveTypes() throws Exception
5961
{
60-
XMLInputFactory factory = XMLInputFactory.newInstance();
61-
XMLStreamReader xsr = factory.createXMLStreamReader(new FileInputStream(
62-
JarUtil.getResourceFromJarasFile("xbean/misc/primitiveTypes.xml")));
62+
XMLStreamReader xsr = XmlObject.Factory.parse(new FileInputStream(
63+
JarUtil.getResourceFromJarasFile("xbean/misc/primitiveTypes.xml"))).
64+
newXMLStreamReader();
6365
XMLStreamReaderExt xsrext = new XMLStreamReaderExtImpl(xsr);
6466

6567
while (xsrext.hasNext())

test/src/xmlcursor/jsr173/checkin/SaveLoadTests.java

-74
This file was deleted.

testbuild.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@
851851
<target name="checkin">
852852
<property name="test.area" value="checkin"/>
853853
<property name="excludes"
854-
value="**/compile/scomp/checkin/**"/>
854+
value="**/compile/scomp/checkin/**,**/tools/inst2xsd/checkin/**"/>
855855
<antcall target="build"/>
856856
<antcall target="run.junit"/>
857857
<antcall target="-compile.run.exluded"/>
@@ -860,7 +860,7 @@
860860
<!-- convenience target for just running compile tests -->
861861
<target name="compile.run">
862862
<property name="excludes"
863-
value="**/compile/scomp/checkin/**"/>
863+
value="**/compile/scomp/checkin/**,**/tools/inst2xsd/checkin/**"/>
864864
<antcall target="-compile.run.exluded"/>
865865
</target>
866866
<!-- This test, for some reason, upon compilation,

0 commit comments

Comments
 (0)