poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1879063 - in /xmlbeans/trunk: ./ resources/ src/common/ src/configschema/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/xmlbeans/impl/ src/main/java/org/apache/xmlbeans/impl/common/ src/main/java/org/apache/xmlbeans/...
Date Sun, 21 Jun 2020 14:22:59 GMT
Author: kiwiwings
Date: Sun Jun 21 14:22:59 2020
New Revision: 1879063

URL: http://svn.apache.org/viewvc?rev=1879063&view=rev
Log:
Restructure project directory to Maven layout

Added:
    xmlbeans/trunk/src/main/
    xmlbeans/trunk/src/main/java/
    xmlbeans/trunk/src/main/java/org/
      - copied from r1879062, xmlbeans/trunk/src/xmlpublic/org/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/
      - copied from r1879062, xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/common/
      - copied from r1879062, xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/config/
      - copied from r1879062, xmlbeans/trunk/src/xmlconfig/org/apache/xmlbeans/impl/config/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/inst2xsd/
      - copied from r1879062, xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/inst2xsd/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/repackage/
      - copied from r1879062, xmlbeans/trunk/src/repackage/org/apache/xmlbeans/impl/repackage/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/richParser/
      - copied from r1879062, xmlbeans/trunk/src/marshal/org/apache/xmlbeans/impl/richParser/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/TypeSystemHolder.java
      - copied unchanged from r1879062, xmlbeans/trunk/src/typeholder/org/apache/xmlbeans/impl/schema/TypeSystemHolder.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/soap/
      - copied from r1879062, xmlbeans/trunk/src/saaj_api/org/apache/xmlbeans/impl/soap/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/
      - copied from r1879062, xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/
      - copied from r1879062, xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/NamespaceManager.java
      - copied unchanged from r1879062, xmlbeans/trunk/src/typestore/org/apache/xmlbeans/impl/values/NamespaceManager.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/TypeStore.java
      - copied unchanged from r1879062, xmlbeans/trunk/src/typestore/org/apache/xmlbeans/impl/values/TypeStore.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/TypeStoreUser.java
      - copied unchanged from r1879062, xmlbeans/trunk/src/typestore/org/apache/xmlbeans/impl/values/TypeStoreUser.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/TypeStoreUserFactory.java
      - copied unchanged from r1879062, xmlbeans/trunk/src/typestore/org/apache/xmlbeans/impl/values/TypeStoreUserFactory.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/values/TypeStoreVisitor.java
      - copied unchanged from r1879062, xmlbeans/trunk/src/typestore/org/apache/xmlbeans/impl/values/TypeStoreVisitor.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/xpath/
      - copied from r1879062, xmlbeans/trunk/src/xpath_xquery/org/apache/xmlbeans/impl/xpath/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/xpathgen/
      - copied from r1879062, xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/xpathgen/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/xquery/
      - copied from r1879062, xmlbeans/trunk/src/xpath_xquery/org/apache/xmlbeans/impl/xquery/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/xsd2inst/
      - copied from r1879062, xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/xsd2inst/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/soap/
      - copied from r1879062, xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/soap/
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/xml/
      - copied from r1879062, xmlbeans/trunk/src/xmlinputstream/org/apache/xmlbeans/xml/
    xmlbeans/trunk/src/main/resources/
      - copied from r1879062, xmlbeans/trunk/resources/
    xmlbeans/trunk/src/main/schema/
    xmlbeans/trunk/src/main/schema/config/
      - copied from r1879062, xmlbeans/trunk/src/configschema/schema/
    xmlbeans/trunk/src/main/schema/tools/
      - copied from r1879062, xmlbeans/trunk/src/toolschema/
    xmlbeans/trunk/src/main/schema/xml/
      - copied from r1879062, xmlbeans/trunk/src/xmlschema/schema/
    xmlbeans/trunk/src/main/schema/xsd/
      - copied from r1879062, xmlbeans/trunk/src/xsdschema/schema/
    xmlbeans/trunk/src/main/shell/
      - copied from r1879062, xmlbeans/trunk/src/shell/
    xmlbeans/trunk/src/test/
    xmlbeans/trunk/src/test/java/
      - copied from r1879062, xmlbeans/trunk/test/src/
    xmlbeans/trunk/src/test/java/tools/JUnit/
      - copied from r1879062, xmlbeans/trunk/test/tools/src/tools/JUnit/
    xmlbeans/trunk/src/test/java/tools/ant/
      - copied from r1879062, xmlbeans/trunk/test/tools/src/tools/ant/
    xmlbeans/trunk/src/test/java/tools/io/
      - copied from r1879062, xmlbeans/trunk/test/tools/src/tools/io/
    xmlbeans/trunk/src/test/java/tools/util/
      - copied from r1879062, xmlbeans/trunk/test/tools/src/tools/util/
    xmlbeans/trunk/src/test/java/tools/xml/
      - copied from r1879062, xmlbeans/trunk/test/tools/src/tools/xml/
    xmlbeans/trunk/src/test/resources/
      - copied from r1879062, xmlbeans/trunk/test/cases/
Removed:
    xmlbeans/trunk/resources/
    xmlbeans/trunk/src/common/
    xmlbeans/trunk/src/configschema/
    xmlbeans/trunk/src/marshal/
    xmlbeans/trunk/src/repackage/
    xmlbeans/trunk/src/saaj_api/
    xmlbeans/trunk/src/shell/
    xmlbeans/trunk/src/store/
    xmlbeans/trunk/src/test/java/tools/ant/BuildFileTest.java
    xmlbeans/trunk/src/tools/
    xmlbeans/trunk/src/toolschema/
    xmlbeans/trunk/src/typeholder/
    xmlbeans/trunk/src/typeimpl/
    xmlbeans/trunk/src/typestore/
    xmlbeans/trunk/src/xmlcomp/
    xmlbeans/trunk/src/xmlconfig/
    xmlbeans/trunk/src/xmlinputstream/
    xmlbeans/trunk/src/xmlpublic/
    xmlbeans/trunk/src/xmlschema/
    xmlbeans/trunk/src/xpath_xquery/
    xmlbeans/trunk/src/xsdschema/
    xmlbeans/trunk/src/zipcompare/
    xmlbeans/trunk/test/cases/
    xmlbeans/trunk/test/src/
    xmlbeans/trunk/test/tools/src/
Modified:
    xmlbeans/trunk/build.xml
    xmlbeans/trunk/src/test/java/common/Common.java
    xmlbeans/trunk/src/test/java/compile/scomp/checkin/CompilationTests.java
    xmlbeans/trunk/src/test/java/compile/scomp/detailed/XmlBeanCompilationTests.java
    xmlbeans/trunk/src/test/java/misc/detailed/SampleRunner.java
    xmlbeans/trunk/src/test/java/xmlcursor/xquery/detailed/NISTTest.java

Modified: xmlbeans/trunk/build.xml
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/build.xml?rev=1879063&r1=1879062&r2=1879063&view=diff
==============================================================================
--- xmlbeans/trunk/build.xml (original)
+++ xmlbeans/trunk/build.xml Sun Jun 21 14:22:59 2020
@@ -24,6 +24,8 @@
     <property name="version.base" value="4.0.0"/>
     <property name="version.rc" value="rc0"/>
 
+    <property name="cases.location" location="src/test/resources"/>
+
     <property name="repository.m2" value="https://repo1.maven.org/maven2"/>
     <property environment="ENV"/>
 
@@ -88,7 +90,7 @@
     <path id="xmlbeans-test">
         <pathelement location="build/classes"/>
         <pathelement location="build/generated-resources"/>
-        <dirset dir="resources" includes="*" excludes="maven"/>
+        <dirset dir="src/main/resources" includes="*" excludes="maven"/>
         <pathelement location="${saxon.jar}"/>
         <pathelement location="test/lib/w3c_domts.jar"/>
         <pathelement location="${junit.jar}"/>
@@ -99,22 +101,8 @@
     </path>
 
     <path id="sources">
-        <pathelement location="src/xmlinputstream"/>
-        <pathelement location="src/xmlpublic"/>
-        <pathelement location="src/common"/>
-        <pathelement location="src/typestore"/>
-        <pathelement location="src/saaj_api"/>
-        <pathelement location="src/store"/>
-        <pathelement location="src/xpath_xquery"/>
+        <pathelement location="src/main/java"/>
         <!-- the next sources depend on the oldxbean.jar -->
-        <pathelement location="src/typeimpl"/>
-        <pathelement location="src/marshal"/>
-        <pathelement location="src/repackage"/>
-        <pathelement location="src/tools"/>
-        <pathelement location="src/toolschema"/>
-        <pathelement location="src/typestore"/>
-        <pathelement location="src/xmlcomp"/>
-        <pathelement location="src/xmlconfig"/>
         <pathelement location="build/generated-sources"/>
     </path>
 
@@ -209,7 +197,7 @@
         <sequential>
             <!-- if replaceHolder: copy TypeSystemHolder and replace package name, then
compile -->
             <mkdir dir="@{srcDir}/org/apache/xmlbeans/metadata/system/@{schemaName}"/>
-            <copy file="src/typeholder/org/apache/xmlbeans/impl/schema/TypeSystemHolder.java"
todir="@{srcDir}/org/apache/xmlbeans/metadata/system/@{schemaName}">
+            <copy file="src/main/java/org/apache/xmlbeans/impl/schema/TypeSystemHolder.java"
todir="@{srcDir}/org/apache/xmlbeans/metadata/system/@{schemaName}">
                 <filterchain>
                     <replacestring from="package org.apache.xmlbeans.impl.schema" to="package
org.apache.xmlbeans.metadata.system.@{schemaName}"/>
                 </filterchain>
@@ -228,10 +216,10 @@
         <attribute name="classpathref"/>
         <attribute name="dest"/>
         <sequential>
-            <schemaComp schemaName="sXMLLANG" src="src/xmlschema/schema" dest="@{dest}"
classpathref="@{classpathref}"/>
-            <schemaComp schemaName="sXMLSCHEMA" src="src/xsdschema/schema" dest="@{dest}"
classpathref="@{classpathref}"/>
-            <schemaComp schemaName="sXMLCONFIG" src="src/configschema/schema" dest="@{dest}"
classpathref="@{classpathref}"/>
-            <schemaComp schemaName="sXMLTOOLS" src="src/toolschema" dest="@{dest}" classpathref="@{classpathref}"/>
+            <schemaComp schemaName="sXMLLANG" src="src/main/schema/xml" dest="@{dest}"
classpathref="@{classpathref}"/>
+            <schemaComp schemaName="sXMLSCHEMA" src="src/main/schema/xsd" dest="@{dest}"
classpathref="@{classpathref}"/>
+            <schemaComp schemaName="sXMLCONFIG" src="src/main/schema/config" dest="@{dest}"
classpathref="@{classpathref}"/>
+            <schemaComp schemaName="sXMLTOOLS" src="src/main/schema/tools" dest="@{dest}"
classpathref="@{classpathref}"/>
         </sequential>
     </macrodef>
 
@@ -260,7 +248,6 @@
         <javac destdir="build/classes" debug="true" debuglevel="lines,vars,source" includeantruntime="true">
             <src refid="sources"/>
             <src path="build/bootstrap/generated-sources"/>
-            <src path="src/typeholder"/>
             <classpath>
                 <path refid="oldxbean"/>
                 <pathelement location="${saxon.jar}"/>
@@ -280,7 +267,7 @@
         <path id="oldschemas">
             <pathelement location="build/classes"/>
             <pathelement location="build/bootstrap/generated-resources"/>
-            <dirset dir="resources" includes="*" excludes="maven"/>
+            <dirset dir="src/main/resources" includes="*" excludes="maven"/>
         </path>
 
         <schemaCompProd classpathref="oldschemas" dest="build"/>
@@ -311,14 +298,14 @@
         <pathconvert property="extensions-dir" pathsep=" ">
             <path>
                 <dirset dir="test/src/xmlobject/extensions/" includes="interfaceFeature/*,prePostFeature/readOnlyBean"/>
-                <dirset dir="test/cases/xbean/extensions/" includes="interfaceFeature/*,prePostFeature/readOnlyBean"/>
+                <dirset dir="${cases.location}/xbean/extensions/" includes="interfaceFeature/*,prePostFeature/readOnlyBean"/>
             </path>
         </pathconvert>
         <schemaComp schemaName="sEXTENSIONS" src="${extensions-dir}" dest="build/test-extensions"
classpathref="xmlbeans-test"/>
-        <schemaComp schemaName="sEXTENSIONS2" src="test/cases/xbean/extensions/prePostFeature/ValueRestriction
test/src/xmlobject/extensions/prePostFeature/ValueRestriction" dest="build/test-extensions"
classpathref="xmlbeans-test"/>
+        <schemaComp schemaName="sEXTENSIONS2" src="${cases.location}/xbean/extensions/prePostFeature/ValueRestriction
test/src/xmlobject/extensions/prePostFeature/ValueRestriction" dest="build/test-extensions"
classpathref="xmlbeans-test"/>
         -->
 
-        <untar src="test/cases/xbean/tranxml.tar.bz2" dest="build/test-tranxml/schemas"
compression="bzip2" overwrite="false">
+        <untar src="${cases.location}/xbean/tranxml.tar.bz2" dest="build/test-tranxml/schemas"
compression="bzip2" overwrite="false">
             <patternset>
                 <include name="tranxml/Version4.0/schemas/StandAlone/CarLocationMessage_40_LX.xsd"/>
             </patternset>
@@ -326,17 +313,17 @@
         </untar>
         <schemaComp schemaName="sTRAN" src="build/test-tranxml/schemas" dest="build/test-tranxml"
classpathref="xmlbeans-test"/>
         <schemaComp schemaName="sTOOLS" src="test/tools/lib/xsl" dest="build/test-tools"
classpathref="xmlbeans-test"/>
-        <schemaComp schemaName="sXMLCURSOR" src="test/cases/xbean/xmlcursor" dest="build/test-xmlcursor"
classpathref="xmlbeans-test"/>
-        <schemaComp schemaName="sDOM" src="test/cases/xbean/dom" dest="build/test-dom"
classpathref="xmlbeans-test"/>
-        <schemaComp schemaName="sSCOMP" src="test/cases/xbean/scomp" dest="build/test-scomp"
classpathref="xmlbeans-test"/>
-        <schemaComp schemaName="sSIMPLE" src="test/cases/xbean/simple" dest="build/test-simple"
classpathref="xmlbeans-test"/>
-        <schemaComp schemaName="sVALIDATE" src="test/cases/xbean/ValidatingStream" dest="build/test-validate"
classpathref="xmlbeans-test"/>
-        <schemaComp schemaName="sUSERTYPE" src="test/cases/xbean/usertype" dest="build/test-usertype"
classpathref="xmlbeans-test"/>
-        <schemaComp schemaName="sLAX" src="test/cases/xbean/compile/scomp/detailed" dest="build/test-lax"
classpathref="xmlbeans-test"/>
+        <schemaComp schemaName="sXMLCURSOR" src="${cases.location}/xbean/xmlcursor" dest="build/test-xmlcursor"
classpathref="xmlbeans-test"/>
+        <schemaComp schemaName="sDOM" src="${cases.location}/xbean/dom" dest="build/test-dom"
classpathref="xmlbeans-test"/>
+        <schemaComp schemaName="sSCOMP" src="${cases.location}/xbean/scomp" dest="build/test-scomp"
classpathref="xmlbeans-test"/>
+        <schemaComp schemaName="sSIMPLE" src="${cases.location}/xbean/simple" dest="build/test-simple"
classpathref="xmlbeans-test"/>
+        <schemaComp schemaName="sVALIDATE" src="${cases.location}/xbean/ValidatingStream"
dest="build/test-validate" classpathref="xmlbeans-test"/>
+        <schemaComp schemaName="sUSERTYPE" src="${cases.location}/xbean/usertype" dest="build/test-usertype"
classpathref="xmlbeans-test"/>
+        <schemaComp schemaName="sLAX" src="${cases.location}/xbean/compile/scomp/detailed"
dest="build/test-lax" classpathref="xmlbeans-test"/>
 
         <pathconvert property="xmlobjects" pathsep=" ">
             <path>
-                <fileset dir="test/cases/xbean/xmlobject">
+                <fileset dir="${cases.location}/xbean/xmlobject">
                     <include name="CR192525.xsd"/>
                     <include name="defaults.xsd"/>
                     <include name="easypo.xsd*"/>
@@ -364,7 +351,7 @@
 
         <pathconvert property="miscs" pathsep=" ">
             <path>
-                <fileset dir="test/cases/xbean/misc/jira">
+                <fileset dir="${cases.location}/xbean/misc/jira">
                     <include name="xmlbeans_33b.xsd"/>
                     <include name="xmlbeans_46.xsd"/>
                     <include name="xmlbeans_48.xsd"/>
@@ -381,22 +368,21 @@
                     <include name="xmlbeans_307_maxallowedenum.xsd"/>
                     <include name="xmlbeans_307_morethanallowedenum.xsd"/>
                 </fileset>
-                <pathelement location="test/cases/xbean/xmltokensource"/>
+                <pathelement location="${cases.location}/xbean/xmltokensource"/>
             </path>
         </pathconvert>
         <schemaComp schemaName="sMISC" src="${miscs}" dest="build/test-misc" classpathref="xmlbeans-test"/>
 
         <!-- don't include in normal test classpath -->
-        <schemaComp schemaName="sSYSCACHE" src="test/cases/xbean/misc/syscachetest1.xsd"
dest="build/test-syscache/1" classpathref="xmlbeans-test"/>
-        <schemaComp schemaName="sSYSCACHE" src="test/cases/xbean/misc/syscachetest2.xsd"
dest="build/test-syscache/2" classpathref="xmlbeans-test"/>
+        <schemaComp schemaName="sSYSCACHE" src="${cases.location}/xbean/misc/syscachetest1.xsd"
dest="build/test-syscache/1" classpathref="xmlbeans-test"/>
+        <schemaComp schemaName="sSYSCACHE" src="${cases.location}/xbean/misc/syscachetest2.xsd"
dest="build/test-syscache/2" classpathref="xmlbeans-test"/>
     </target>
 
 
 
     <target name="test-compile" depends="process-test-resources" description="Compile
test sources and resources">
         <javac destdir="build/test-classes" debug="true" debuglevel="lines,vars,source"
includeantruntime="true" classpathref="xmlbeans-test">
-            <src path="test/src"/>
-            <src path="test/tools/src"/>
+            <src path="src/test/java"/>
             <src>
                 <dirset dir="build" includes="test-*/generated-sources"/>
             </src>
@@ -416,7 +402,7 @@
         <junit printsummary="yes" showoutput="no" haltonerror="true" haltonfailure="true">
             <classpath refid="xmlbeans-test"/>
             <classpath>
-                <pathelement location="test/cases"/>
+                <pathelement location="${cases.location}"/>
                 <pathelement location="build/test-classes"/>
                 <dirset dir="build" includes="test-*/generated-resources"/>
             </classpath>
@@ -429,11 +415,11 @@
             <jvmarg value="-Djava.io.tmpdir=${basedir}/build/tmp"/>
 
             <!-- For tests that need to access case files directly -->
-            <sysproperty key="cases.location" path="${basedir}/test/cases"/>
+            <sysproperty key="cases.location" path="${basedir}/src/test/resources"/>
             <sysproperty key="xbean.rootdir" path="${basedir}"/>
 
             <batchtest fork="yes" todir="build/test-results">
-                <fileset dir="test/src">
+                <fileset dir="src/test/java">
                     <include name="**/*Tests.java"/>
                     <include name="**/*Test.java"/>
                     <exclude name="**/extensions/**"/>
@@ -471,7 +457,7 @@
             <fileset dir="." includes="LICENSE.txt,NOTICE.txt"/>
             <fileset dir="build/generated-resources"/>
             <mappedresources>
-                <fileset dir="resources" excludes="maven"/>
+                <fileset dir="src/main/resources" excludes="maven"/>
                 <cutdirsmapper dirs="1"/>
             </mappedresources>
             <manifest>
@@ -509,6 +495,9 @@
 
         <jar jarfile="build/xmlbeans-${version.base}-sources.jar" update="false" index="false"
duplicate="preserve">
             <fileset dir="." includes="LICENSE.txt,NOTICE.txt"/>
+            <fileset dir="src/main/java"/>
+            <fileset dir="build/generated-sources"/>
+<!--
             <mappedresources>
                 <fileset dir="src" excludes="toolschema/**,shell/**"/>
                 <mapper refid="src-mapper"/>
@@ -518,6 +507,7 @@
                 <fileset dir="build" includes="generated-sources/**,generated-resources/**"
excludes="**/*.xsb,**/*.class"/>
                 <mapper refid="src-mapper"/>
             </mappedresources>
+-->
 
             <manifest>
                 <section name="org/apache/xmlbeans/">
@@ -537,24 +527,24 @@
         <property name="prefix" value="xmlbeans-${version.base}"/>
 
         <zip destfile="build/xmlbeans-src-${version.base}-${tstamp.dist}.zip" update="false">
-            <zipfileset dir="." excludes="build/**,tmp/**,.idea/**,bin/**,lib/**,/src/shell/**,.settings/**,.project,build.javacheck.xml,release-guide.txt"
prefix="${prefix}"/>
-        	<zipfileset dir="src/shell" prefix="${prefix}/bin" />
+            <zipfileset dir="." excludes="build/**,tmp/**,.idea/**,bin/**,lib/**,/src/main/shell/**,.settings/**,.project,build.javacheck.xml,release-guide.txt"
prefix="${prefix}"/>
+        	<zipfileset dir="src/main/shell" prefix="${prefix}/bin" />
             <zipfileset dir="build/javadocs" prefix="${prefix}/javadocs" />
         </zip>
         <tar destfile="build/xmlbeans-src-${version.base}-${tstamp.dist}.tgz" compression="gzip">
-            <tarfileset dir="." excludes="build/**,tmp/**,.idea/**,bin/**,lib/**,/src/shell/**,.settings/**,.project,build.javacheck.xml,release-guide.txt"
prefix="${prefix}"/>
-        	<tarfileset dir="src/shell" prefix="${prefix}/bin" />
+            <tarfileset dir="." excludes="build/**,tmp/**,.idea/**,bin/**,lib/**,/src/main/shell/**,.settings/**,.project,build.javacheck.xml,release-guide.txt"
prefix="${prefix}"/>
+        	<tarfileset dir="src/main/shell" prefix="${prefix}/bin" />
             <tarfileset dir="build/javadocs" prefix="${prefix}/javadocs" />
         </tar>
 
         <zip destfile="build/xmlbeans-bin-${version.base}-${tstamp.dist}.zip" update="false">
             <zipfileset dir="." includes="LICENSE.txt,NOTICE.txt,docs/**" prefix="${prefix}"/>
             <zipfileset dir="samples" includes="Any/**,DateTime/**,MixedContent/**,OrderMatters/**,SchemaEnum/**,Validation/**,XQueryXPath/**,XsdConfig/**"
prefix="${prefix}/samples"/>
-            <zipfileset dir="src/shell" prefix="${prefix}/bin"/>
+            <zipfileset dir="src/main/shell" prefix="${prefix}/bin"/>
             <zipfileset dir="xkit" prefix="${prefix}"/>
-            <zipfileset dir="src/xsdschema/schema" includes="*.xsd" prefix="${prefix}/schemas/s4s"/>
-            <zipfileset dir="src/xmlschema/schema" includes="*.xsd" prefix="${prefix}/schemas/s4s"/>
-            <zipfileset dir="test/cases/xbean/xmlobject" includes="numerals.xsd,easypo.xsd*,nameworld.xsd"
prefix="${prefix}/schemas"/>
+            <zipfileset dir="src/main/schema/xsd" includes="*.xsd" prefix="${prefix}/schemas/s4s"/>
+            <zipfileset dir="src/main/schema/xml" includes="*.xsd" prefix="${prefix}/schemas/s4s"/>
+            <zipfileset dir="${cases.location}/xbean/xmlobject" includes="numerals.xsd,easypo.xsd*,nameworld.xsd"
prefix="${prefix}/schemas"/>
             <zipfileset dir="build" prefix="${prefix}/lib">
                 <include name="xmlbeans-${version.base}.jar"/>
                 <include name="xmlbeans-${version.base}-javadoc.jar"/>
@@ -564,11 +554,11 @@
         <tar destfile="build/xmlbeans-bin-${version.base}-${tstamp.dist}.tgz" compression="gzip">
             <tarfileset dir="." includes="LICENSE.txt,NOTICE.txt,docs/**" prefix="${prefix}"/>
             <tarfileset dir="samples" includes="Any/**,DateTime/**,MixedContent/**,OrderMatters/**,SchemaEnum/**,Validation/**,XQueryXPath/**,XsdConfig/**"
prefix="${prefix}/samples"/>
-            <tarfileset dir="src/shell" prefix="${prefix}/bin"/>
+            <tarfileset dir="src/main/shell" prefix="${prefix}/bin"/>
             <tarfileset dir="xkit" prefix="${prefix}"/>
-            <tarfileset dir="src/xsdschema/schema" includes="*.xsd" prefix="${prefix}/schemas/s4s"/>
-            <tarfileset dir="src/xmlschema/schema" includes="*.xsd" prefix="${prefix}/schemas/s4s"/>
-            <tarfileset dir="test/cases/xbean/xmlobject" includes="numerals.xsd,easypo.xsd*,nameworld.xsd"
prefix="${prefix}/schemas"/>
+            <tarfileset dir="src/main/schema/xsd" includes="*.xsd" prefix="${prefix}/schemas/s4s"/>
+            <tarfileset dir="src/main/schema/xml" includes="*.xsd" prefix="${prefix}/schemas/s4s"/>
+            <tarfileset dir="${cases.location}/xbean/xmlobject" includes="numerals.xsd,easypo.xsd*,nameworld.xsd"
prefix="${prefix}/schemas"/>
             <tarfileset dir="build" prefix="${prefix}/lib">
                 <include name="xmlbeans-${version.base}.jar"/>
                 <include name="xmlbeans-${version.base}-javadoc.jar"/>
@@ -592,7 +582,7 @@
                 <exclude name="**/XML.xsd"/>
                 <exclude name="**/XMLSchema.xsd"/>
             </fileset>
-            <fileset dir="resources">
+            <fileset dir="src/main/resources">
                 <exclude name="**/META-INF/services/**"/>
             </fileset>
         </rat:report>
@@ -666,7 +656,7 @@
     </target>
 
     <target name="mvn-install" depends="maven.ant.tasks-check,package" description="Install
XmlBeans artifacts into the local repository. Equivalent of 'mvn install'">
-        <copy file="${basedir}/resources/maven/pom.xml" todir="${basedir}/build" filtering="true">
+        <copy file="${basedir}/main/resources/maven/pom.xml" todir="${basedir}/build"
filtering="true">
             <filterset>
                 <filter token="VERSION" value="${version.base}"/>
             </filterset>

Modified: xmlbeans/trunk/src/test/java/common/Common.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/common/Common.java?rev=1879063&r1=1879062&r2=1879063&view=diff
==============================================================================
--- xmlbeans/trunk/src/test/java/common/Common.java (original)
+++ xmlbeans/trunk/src/test/java/common/Common.java Sun Jun 21 14:22:59 2020
@@ -63,17 +63,16 @@ public class Common
 
     /**
      * If System.property for 'cases.location' == null
-     * use '.' as basePath and add test/cases/xbea'.'
+     * use '.' as basePath and add src/test/resources.
      * should be where the build.xml file lives
      *
-     * @return
      * @throws IllegalStateException
      */
     public static String getCaseLocation() throws IllegalStateException
     {
         String baseDir = System.getProperty("cases.location");
         if (baseDir == null) {
-            return new File("." + P + "test" + P + "cases").getAbsolutePath();
+            return new File("." + P + "src" + P + "test" + P + "resources").getAbsolutePath();
         } else {
             return new File(baseDir).getAbsolutePath();
         }

Modified: xmlbeans/trunk/src/test/java/compile/scomp/checkin/CompilationTests.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/compile/scomp/checkin/CompilationTests.java?rev=1879063&r1=1879062&r2=1879063&view=diff
==============================================================================
--- xmlbeans/trunk/src/test/java/compile/scomp/checkin/CompilationTests.java (original)
+++ xmlbeans/trunk/src/test/java/compile/scomp/checkin/CompilationTests.java Sun Jun 21 14:22:59
2020
@@ -15,6 +15,8 @@
 
 package compile.scomp.checkin;
 
+import common.Common;
+import compile.scomp.common.CompileCommon;
 import org.apache.xmlbeans.*;
 import org.apache.xmlbeans.impl.common.QNameHelper;
 import org.apache.xmlbeans.impl.tool.CodeGenUtil;
@@ -40,6 +42,7 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
+import static common.Common.getRootFile;
 import static org.junit.Assert.*;
 
 
@@ -218,7 +221,7 @@ public class CompilationTests {
         assertTrue("Build failed", SchemaCompiler.compile(params));
 
         // Then, compile java classes
-        File javasrc = new File("test/src/scomp/simple");
+        File javasrc = new File(CompileCommon.fileLocation+"/simple");
         File javaclasses = xbeanOutput("compile/scomp/simple/javaclasses");
         javaclasses.mkdirs();
         List<File> testcp = new ArrayList<File>(Arrays.asList(CodeGenUtil.systemClasspath()));
@@ -398,12 +401,12 @@ public class CompilationTests {
 
     //TESTENV:
 
-    private static File fwroot = getRootFile();
-    private static File caseroot = new File(fwroot, "test/cases");
+    private static final File fwroot = new File(getRootFile());
+    private static final File caseroot = new File(Common.getCaseLocation());
 
     //location of files under "cases folder"
-    static String fileLocation = "/xbean/compile/scomp/";
-    private static File outputroot = new File(fwroot, "build/test/output");
+    private static final String fileLocation = CompileCommon.fileLocation;
+    private static final File outputroot = new File(fwroot, "build/test/output");
 
     private static void dumpErrors(List errors, PrintWriter out) {
         // Display the errors
@@ -414,16 +417,8 @@ public class CompilationTests {
         }
     }
 
-    private static File getRootFile() throws IllegalStateException {
-        try {
-            return new File(System.getProperty("xbean.rootdir")).getCanonicalFile();
-        } catch (IOException e) {
-            throw new IllegalStateException(e.toString());
-        }
-    }
-
     private static File xbeanCase(String str) {
-        return (new File(caseroot.getPath() + fileLocation, str));
+        return new File(fileLocation, str);
     }
 
     private static File xbeanOutput(String str) {

Modified: xmlbeans/trunk/src/test/java/compile/scomp/detailed/XmlBeanCompilationTests.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/compile/scomp/detailed/XmlBeanCompilationTests.java?rev=1879063&r1=1879062&r2=1879063&view=diff
==============================================================================
--- xmlbeans/trunk/src/test/java/compile/scomp/detailed/XmlBeanCompilationTests.java (original)
+++ xmlbeans/trunk/src/test/java/compile/scomp/detailed/XmlBeanCompilationTests.java Sun Jun
21 14:22:59 2020
@@ -59,8 +59,8 @@ public class XmlBeanCompilationTests ext
         TestFiler f = new TestFiler();
         //initialize all of the values
         String extCaseDir = XBEAN_CASE_ROOT + P + "extensions" + P;
-        String extSrcDir = CASEROOT + P +
-                           ".." + P + "src" + P + "xmlobject" + P + "extensions" + P;
+        String extSrcDir = getRootFile() + P +
+                           "src" + P + "test" + P + "java" + P + "xmlobject" + P + "extensions"
+ P;
         File[] cPath = CompileTestBase.getClassPath();
         String dir = extCaseDir + P + "interfaceFeature" + P + "averageCase";
         String dir2 = extCaseDir + P + "prePostFeature" + P +

Modified: xmlbeans/trunk/src/test/java/misc/detailed/SampleRunner.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/misc/detailed/SampleRunner.java?rev=1879063&r1=1879062&r2=1879063&view=diff
==============================================================================
--- xmlbeans/trunk/src/test/java/misc/detailed/SampleRunner.java (original)
+++ xmlbeans/trunk/src/test/java/misc/detailed/SampleRunner.java Sun Jun 21 14:22:59 2020
@@ -14,15 +14,13 @@
  */
 package misc.detailed;
 
+import org.apache.tools.ant.*;
 import org.junit.Before;
 import org.junit.Test;
-import tools.ant.*;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Target;
-import org.apache.tools.ant.BuildException;
 
 import java.io.File;
 import java.io.FilenameFilter;
+import java.io.PrintStream;
 import java.util.ArrayList;
 
 /**
@@ -31,6 +29,13 @@ import java.util.ArrayList;
  */
 public class SampleRunner {
 
+    private ArrayList samples;
+    private Project proj;
+    private Target target;
+    private String XMLBEANS_HOME;
+    private SamplesBuildFileTest runSampleTest;
+
+
     @Before
     protected void setUp() throws Exception {
         proj = new Project();
@@ -107,11 +112,191 @@ public class SampleRunner {
             return this.getBuildException();
         }
     }
+}
+
+abstract class BuildFileTest {
+
+    protected Project project;
+
+    private StringBuilder logBuffer;
+    private StringBuilder fullLogBuffer;
+    private StringBuilder outBuffer;
+    private StringBuilder errBuffer;
+    private BuildException buildException;
+
+    protected String getOutput() {
+        return cleanBuffer(outBuffer);
+    }
+
+    protected String getError() {
+        return cleanBuffer(errBuffer);
+    }
+
+    protected BuildException getBuildException() {
+        return buildException;
+    }
+
+    private String cleanBuffer(StringBuilder buffer) {
+        StringBuilder cleanedBuffer = new StringBuilder();
+        boolean cr = false;
+        for (int i = 0; i < buffer.length(); i++) {
+            char ch = buffer.charAt(i);
+            if (ch == '\r') {
+                cr = true;
+                continue;
+            }
+
+            if (!cr) {
+                cleanedBuffer.append(ch);
+            } else {
+                if (ch == '\n') {
+                    cleanedBuffer.append(ch);
+                } else {
+                    cleanedBuffer.append('\r').append(ch);
+                }
+            }
+        }
+        return cleanedBuffer.toString();
+    }
+
+    /**
+     *  set up to run the named project
+     *
+     * @param  filename name of project file to run
+     */
+    protected void configureProject(String filename) throws BuildException {
+        logBuffer = new StringBuilder();
+        fullLogBuffer = new StringBuilder();
+        project = new Project();
+        project.init();
+        project.setUserProperty( "ant.file" , new File(filename).getAbsolutePath() );
+        project.addBuildListener(new BuildFileTest.AntTestListener());
+        //ProjectHelper.configureProject(project, new File(filename));
+        ProjectHelper.getProjectHelper().parse(project, new File(filename));
+    }
+
+    /**
+     *  execute a target we have set up
+     * @pre configureProject has been called
+     * @param  targetName  target to run
+     */
+    protected void executeTarget(String targetName) {
+        PrintStream sysOut = System.out;
+        PrintStream sysErr = System.err;
+        try {
+            sysOut.flush();
+            sysErr.flush();
+            outBuffer = new StringBuilder();
+            PrintStream out = new PrintStream(new BuildFileTest.AntOutputStream());
+            System.setOut(out);
+            errBuffer = new StringBuilder();
+            PrintStream err = new PrintStream(new BuildFileTest.AntOutputStream());
+            System.setErr(err);
+            logBuffer = new StringBuilder();
+            fullLogBuffer = new StringBuilder();
+            buildException = null;
+            project.executeTarget(targetName);
+        } finally {
+            System.setOut(sysOut);
+            System.setErr(sysErr);
+            // rajus: 2004/04/07
+            System.out.println("STDOUT+STDERR:\n" + getOutput() + getError());
+            System.out.println("END STDOUT+STDERR:");
+        }
+
+    }
+
+    /**
+     * Get the project which has been configured for a test.
+     *
+     * @return the Project instance for this test.
+     */
+    protected Project getProject() {
+        return project;
+    }
+
+    /**
+     * an output stream which saves stuff to our buffer.
+     */
+    private class AntOutputStream extends java.io.OutputStream {
+        public void write(int b) {
+            outBuffer.append((char)b);
+        }
+    }
+
+    /**
+     * our own personal build listener
+     */
+    private class AntTestListener implements BuildListener {
+        /**
+         *  Fired before any targets are started.
+         */
+        public void buildStarted(BuildEvent event) {
+        }
+
+        /**
+         *  Fired after the last target has finished. This event
+         *  will still be thrown if an error occured during the build.
+         *
+         *  @see BuildEvent#getException()
+         */
+        public void buildFinished(BuildEvent event) {
+        }
+
+        /**
+         *  Fired when a target is started.
+         *
+         *  @see BuildEvent#getTarget()
+         */
+        public void targetStarted(BuildEvent event) {
+            //System.out.println("targetStarted " + event.getTarget().getName());
+        }
+
+        /**
+         *  Fired when a target has finished. This event will
+         *  still be thrown if an error occured during the build.
+         *
+         *  @see BuildEvent#getException()
+         */
+        public void targetFinished(BuildEvent event) {
+            //System.out.println("targetFinished " + event.getTarget().getName());
+        }
+
+        /**
+         *  Fired when a task is started.
+         *
+         *  @see BuildEvent#getTask()
+         */
+        public void taskStarted(BuildEvent event) {
+            //System.out.println("taskStarted " + event.getTask().getTaskName());
+        }
+
+        /**
+         *  Fired when a task has finished. This event will still
+         *  be throw if an error occured during the build.
+         *
+         *  @see BuildEvent#getException()
+         */
+        public void taskFinished(BuildEvent event) {
+            //System.out.println("taskFinished " + event.getTask().getTaskName());
+        }
+
+        /**
+         *  Fired whenever a message is logged.
+         *
+         *  @see BuildEvent#getMessage()
+         *  @see BuildEvent#getPriority()
+         */
+        public void messageLogged(BuildEvent event) {
+            if (event.getPriority() == Project.MSG_INFO ||
+                event.getPriority() == Project.MSG_WARN ||
+                event.getPriority() == Project.MSG_ERR) {
+                logBuffer.append(event.getMessage());
+            }
+            fullLogBuffer.append(event.getMessage());
+
+        }
+    }
 
-    ArrayList samples;
-    Project proj;
-    Target target;
-    String XMLBEANS_HOME;
-    SamplesBuildFileTest runSampleTest;
 
 }

Modified: xmlbeans/trunk/src/test/java/xmlcursor/xquery/detailed/NISTTest.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlcursor/xquery/detailed/NISTTest.java?rev=1879063&r1=1879062&r2=1879063&view=diff
==============================================================================
--- xmlbeans/trunk/src/test/java/xmlcursor/xquery/detailed/NISTTest.java (original)
+++ xmlbeans/trunk/src/test/java/xmlcursor/xquery/detailed/NISTTest.java Sun Jun 21 14:22:59
2020
@@ -14,6 +14,7 @@
  */
 package xmlcursor.xquery.detailed;
 
+import common.Common;
 import noNamespace.TestCase;
 import noNamespace.TestSuiteDocument;
 import noNamespace.TestSuiteDocument.TestSuite.TestGroup;
@@ -61,7 +62,7 @@ public class NISTTest {
 
     @Parameterized.Parameters(name = "{index}: {0} {1}")
     public static Iterable<Object[]> files() throws IOException, XmlException {
-        zf = new ZipFile("test/cases/xbean/xmlcursor/xquery/xmlQuery.zip");
+        zf = new ZipFile(Common.getCaseLocation()+"/xbean/xmlcursor/xquery/xmlQuery.zip");
 
         ZipEntry e = zf.getEntry("testSuite/NIST/files/catalog.xml");
         InputStream is = zf.getInputStream(e);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message