From: <st...@us...> - 2007-04-30 13:53:38
|
Revision: 4110 http://svn.sourceforge.net/smartfrog/?rev=4110&view=rev Author: steve_l Date: 2007-04-30 06:53:35 -0700 (Mon, 30 Apr 2007) Log Message: ----------- tweaking build to work properly, though a bit of test cleanup is still required Modified Paths: -------------- trunk/core/components/xml/build.xml trunk/core/components/xml/src/org/smartfrog/services/xml/impl/XmlDocumentImpl.java trunk/core/components/xml/test/org/smartfrog/services/xml/test/files/testInvalidXML.sf trunk/core/components/xml/test/org/smartfrog/services/xml/test/system/XmlParserTest.java trunk/core/components/xml/test/org/smartfrog/services/xml/test/system/XmlTestBase.java Added Paths: ----------- trunk/core/components/xml/test/org/smartfrog/services/xml/test/files/deploy.sf Modified: trunk/core/components/xml/build.xml =================================================================== --- trunk/core/components/xml/build.xml 2007-04-30 13:51:02 UTC (rev 4109) +++ trunk/core/components/xml/build.xml 2007-04-30 13:53:35 UTC (rev 4110) @@ -41,9 +41,10 @@ <!-- ========================================================== --> <target name="init" depends="init-standard-output-dirs,use-smartfrog-tasks,use-smartfrog-testharness"> - <property name="deploy.sf" value="files/success.sf"/> + <property name="deploy.sf" value="org/smartfrog/services/xml/test/files/deploy.sf"/> + <!-- <property name="default.ini" location="test/files/default.ini"/> - <property name="default.sf" location="test/files/default.sf"/> + <property name="default.sf" location="test/files/default.sf"/>--> <echo message="==================================================================="/> <echo message="= ${ant.project.name}"/> </target> @@ -96,32 +97,11 @@ <copy-useful-files src="${src.dir}" dest="${build.classes.dir}"/> </target> + <!-- ========================================================== --> - <!-- create a distro. - we want both sf-junit and the test har --> - <!-- ========================================================== --> - <target name="dist" depends="common.dist,jdocs" description="create a distribution"> -<!-- - <copy todir = "${dist.lib.dir}"> - <fileset dir ="${lib.dir}" /> - </copy> ---> - <copy todir = "${dist.doc.dir}"> - <fileset dir ="${doc.dir}" /> - </copy> - <copy todir = "${dist.src.dir}"> - <fileset dir ="${src.dir}"> - <include name="**/examples/**"/> - </fileset> - </copy> - <copy tofile="${dist.dir}/build.xml" file="releaseBuild.xml"/> - <copy tofile="${dist.dir}/build.example.properties" file="build.example.properties"/> - </target> - - <!-- ========================================================== --> <!-- parse the file --> <!-- ========================================================== --> - <target name="parse" depends="init,common.dist,init-codebase" + <target name="parse" depends="init-codebase,package-tests" description="parse the deployment descriptor"> <property name="parse.quiet" value="true"/> <sf-parse quiet="${parse.quiet}"> @@ -155,12 +135,10 @@ <!-- ========================================================== --> <!-- set--> <!-- ========================================================== --> - <target name="init-codebase" depends="init-deploy-properties,declare-classpaths" + <target name="init-codebase" depends="init-deploy-properties,declare-classpaths,package-tests" description="set up the codebase property"> <sf-tourl property="codebase"> - <fileset file="${target.jar}"/> - <fileset file="${test.jar}"/> - <path refid="compile.classpath"/> + <path refid="tests.run.classpath"/> </sf-tourl> <echo> deploying to ${deploy.host} @@ -199,7 +177,7 @@ <!-- ========================================================== --> <!-- system tests --> <!-- ========================================================== --> - <target name="system-tests" depends="parse,dist,compile-tests,init-codebase" + <target name="system-tests" depends="parse,dist,package-tests" description="run system tests" if="system.tests.enabled"> <parallel> @@ -253,10 +231,4 @@ <antcall target="stop-daemon-if-started"/> </target> - <target name="unzip" depends="dist"> - <property name="target.exploded" location="${build.dir}/exploded" /> - <unzip src="${target.jar}" dest="${target.exploded}"/> - </target> - - <target name="all" depends="dist,unzip,test,published" /> </project> Modified: trunk/core/components/xml/src/org/smartfrog/services/xml/impl/XmlDocumentImpl.java =================================================================== --- trunk/core/components/xml/src/org/smartfrog/services/xml/impl/XmlDocumentImpl.java 2007-04-30 13:51:02 UTC (rev 4109) +++ trunk/core/components/xml/src/org/smartfrog/services/xml/impl/XmlDocumentImpl.java 2007-04-30 13:53:35 UTC (rev 4110) @@ -209,7 +209,7 @@ if (sourceFilename != null) { File source = new File(sourceFilename); FileUsingComponentImpl.bind(this, source); - throw new SmartFrogDeploymentException(ERROR_UNSUPPORTED_FEATURE, + throw new SmartFrogDeploymentException(ERROR_UNSUPPORTED_FEATURE+": binding to source files", this); } } @@ -241,9 +241,9 @@ File file = new File(filename); FileOutputStream fileout; fileout = new FileOutputStream(file); - OutputStream out; - out = new BufferedOutputStream(fileout); + OutputStream out=null; try { + out = new BufferedOutputStream(fileout); Serializer serializer = new Serializer(out, encoding); serializer.write(getDocument()); } finally { Added: trunk/core/components/xml/test/org/smartfrog/services/xml/test/files/deploy.sf =================================================================== --- trunk/core/components/xml/test/org/smartfrog/services/xml/test/files/deploy.sf (rev 0) +++ trunk/core/components/xml/test/org/smartfrog/services/xml/test/files/deploy.sf 2007-04-30 13:53:35 UTC (rev 4110) @@ -0,0 +1,21 @@ +/** (C) Copyright 2007 Hewlett-Packard Development Company, LP + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +For more information: www.smartfrog.org + +*/ +#include "/org/smartfrog/services/xml/test/files/testDocument.sf" + Modified: trunk/core/components/xml/test/org/smartfrog/services/xml/test/files/testInvalidXML.sf =================================================================== --- trunk/core/components/xml/test/org/smartfrog/services/xml/test/files/testInvalidXML.sf 2007-04-30 13:51:02 UTC (rev 4109) +++ trunk/core/components/xml/test/org/smartfrog/services/xml/test/files/testInvalidXML.sf 2007-04-30 13:53:35 UTC (rev 4110) @@ -36,4 +36,32 @@ this file tests that we dont load an invalid XML document */ -sfConfig extends XmlNode( \ No newline at end of file + +rootDoc extends XmlDocument { + + root extends XmlElement { + localname "root"; + + a1 extends XmlAttribute { + localname "attr1"; + value PARENT:localname; + } + a2 extends XmlAttribute { + namespace "urn:isbn:0-201-61981-0"; + localname "s:soup"; + value "warm"; + } + /* + textElement extends XmlText { + text "this is a nested text element"; + }*/ + + text "inline text"; + } + + root2 extends root; + +} + + +sfConfig extends rootDoc ; \ No newline at end of file Modified: trunk/core/components/xml/test/org/smartfrog/services/xml/test/system/XmlParserTest.java =================================================================== --- trunk/core/components/xml/test/org/smartfrog/services/xml/test/system/XmlParserTest.java 2007-04-30 13:51:02 UTC (rev 4109) +++ trunk/core/components/xml/test/org/smartfrog/services/xml/test/system/XmlParserTest.java 2007-04-30 13:53:35 UTC (rev 4110) @@ -28,6 +28,7 @@ import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; +import java.util.logging.Logger; /** * Test some aspects of XMLL created 27-Jan-2005 14:05:29 @@ -35,6 +36,8 @@ public class XmlParserTest extends TestCase { + private Logger logger= Logger.getLogger(this.getClass().getName()); + public XmlParserTest(String s) { super(s); } @@ -68,7 +71,7 @@ assertNotNull("Sax parser factory", factory); SAXParser parser = factory.newSAXParser(); assertNotNull("Sax parser ", parser); - System.out.println("Sax 1 Parser=" + parser.getClass().getName()); + logger.info("Sax 1 Parser=" + parser.getClass().getName()); } public void testDomExists() throws ParserConfigurationException { Modified: trunk/core/components/xml/test/org/smartfrog/services/xml/test/system/XmlTestBase.java =================================================================== --- trunk/core/components/xml/test/org/smartfrog/services/xml/test/system/XmlTestBase.java 2007-04-30 13:51:02 UTC (rev 4109) +++ trunk/core/components/xml/test/org/smartfrog/services/xml/test/system/XmlTestBase.java 2007-04-30 13:53:35 UTC (rev 4110) @@ -138,7 +138,7 @@ /** * terminate a deployed app of type xmlnode. no-op if null - * @param node + * @param node node to terminate * @throws RemoteException */ protected void terminateNode(XmlNode node) throws RemoteException { @@ -147,8 +147,8 @@ /** * load an XML File - * @param file - * @param validate + * @param file file to load + * @param validate flag to ask for a validating parser * @return the loaded document. * @throws SAXException * @throws ParsingException @@ -165,7 +165,7 @@ /** * resolve the xmlnode name {@link #ATTR_XML} in the application - * @return + * @return the resolved node * @throws SmartFrogResolutionException * @throws RemoteException * @throws AssertionFailedError if the application is null This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |