notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r1416 - in trunk/main: . lang lang/process lang/process/etc lang/process/etc/test lang/process/src lang/process/src/test lang/process/src/test/net lang/process/src/test/net/dpml lang/process/src/test/net/dpml/lang lang/process/src/test/net/dpml/lang/process transit/core/src/main/net/dpml/util
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r1416 - in trunk/main: . lang lang/process lang/process/etc lang/process/etc/test lang/process/src lang/process/src/test lang/process/src/test/net lang/process/src/test/net/dpml lang/process/src/test/net/dpml/lang lang/process/src/test/net/dpml/lang/process transit/core/src/main/net/dpml/util
- Date: Fri, 28 Apr 2006 12:43:05 +0200
Author: mcconnell
Date: 2006-04-28 12:43:02 +0200 (Fri, 28 Apr 2006)
New Revision: 1416
Added:
trunk/main/lang/process/etc/test/
trunk/main/lang/process/etc/test/sample.xml
trunk/main/lang/process/src/
trunk/main/lang/process/src/test/
trunk/main/lang/process/src/test/net/
trunk/main/lang/process/src/test/net/dpml/
trunk/main/lang/process/src/test/net/dpml/lang/
trunk/main/lang/process/src/test/net/dpml/lang/process/
trunk/main/lang/process/src/test/net/dpml/lang/process/ProcessXsdTestCase.java
Modified:
trunk/main/bootstrap.bat
trunk/main/bootstrap.xml
trunk/main/lang/module.xml
trunk/main/lang/process/build.xml
trunk/main/lang/process/etc/process.xsd
trunk/main/transit/core/src/main/net/dpml/util/DOM3DocumentBuilder.java
Log:
add process xsd testcase
Modified: trunk/main/bootstrap.bat
===================================================================
--- trunk/main/bootstrap.bat 2006-04-27 18:05:19 UTC (rev 1415)
+++ trunk/main/bootstrap.bat 2006-04-28 10:43:02 UTC (rev 1416)
@@ -33,6 +33,8 @@
IF ERRORLEVEL 1 GOTO :exit
CALL :transit-tools
IF ERRORLEVEL 1 GOTO :exit
+CALL :dpml-lang-process
+IF ERRORLEVEL 1 GOTO :exit
CALL :dpml-library
IF ERRORLEVEL 1 GOTO :exit
CALL :depot-ant-builder
@@ -115,6 +117,13 @@
POPD
GOTO :EOF
+:dpml-lang-process
+PUSHD lang\process
+CALL :build clean install
+POPD
+GOTO :EOF
+
+
:dpml-library
PUSHD depot\library
CALL :build clean install
Modified: trunk/main/bootstrap.xml
===================================================================
--- trunk/main/bootstrap.xml 2006-04-27 18:05:19 UTC (rev 1415)
+++ trunk/main/bootstrap.xml 2006-04-28 10:43:02 UTC (rev 1416)
@@ -440,7 +440,9 @@
haltonfailure="yes" failureproperty="junit.failure"
haltonerror="yes" errorproperty="junit.error">
<sysproperty key="build.signature" value="${build.signature}"/>
+ <sysproperty key="project.basedir" value="${basedir}"/>
<sysproperty key="project.test.dir" value="${target.test.dir}"/>
+ <sysproperty key="project.version" value="${project.version}"/>
<classpath>
<path refid="project.test.path"/>
<pathelement location="${target.test-classes.dir}"/>
Modified: trunk/main/lang/module.xml
===================================================================
--- trunk/main/lang/module.xml 2006-04-27 18:05:19 UTC (rev 1415)
+++ trunk/main/lang/module.xml 2006-04-28 10:43:02 UTC (rev 1416)
@@ -14,6 +14,11 @@
<types>
<type id="xsd"/>
</types>
+ <dependencies>
+ <build>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </build>
+ </dependencies>
</resource>
<resource name="dpml-part" version="1.0">
@@ -63,6 +68,7 @@
<dependencies>
<build>
<include key="dpml-common"/>
+ <include key="dpml-process"/>
</build>
</dependencies>
</resource>
Modified: trunk/main/lang/process/build.xml
===================================================================
--- trunk/main/lang/process/build.xml 2006-04-27 18:05:19 UTC (rev 1415)
+++ trunk/main/lang/process/build.xml 2006-04-28 10:43:02 UTC (rev 1416)
@@ -28,6 +28,17 @@
<property name="home" value="../.."/>
<import file="${home}/bootstrap.xml"/>
+ <target name="setup-path" depends="init">
+ <echo message="TRANSIT: ${project.version}.jar"/>
+ <path id="project.main.path">
+ <pathelement
location="${dpml.local.cache}/dpml/transit/jars/dpml-transit-main-${project.version}.jar"/>
+ <pathelement location="${target.classes.dir}"/>
+ <pathelement location="${ENV.ANT_HOME}/lib/ant.jar"/>
+ <pathelement location="${ENV.ANT_HOME}/lib/ant-junit.jar"/>
+ <pathelement
location="${dpml.local.cache}/junit/jars/${junit.filename}"/>
+ </path>
+ </target>
+
<target name="init" depends="bootstrap.init">
<filter token="PROJECT-XSD-URI"
value="artifact:xsd:${project.group}/${project.name}#${project.version}"/>
</target>
Modified: trunk/main/lang/process/etc/process.xsd
===================================================================
--- trunk/main/lang/process/etc/process.xsd 2006-04-27 18:05:19 UTC (rev
1415)
+++ trunk/main/lang/process/etc/process.xsd 2006-04-28 10:43:02 UTC (rev
1416)
@@ -1,11 +1,9 @@
<?xml version="1.0"?>
-
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:this="@PROJECT-XSD-URI@"
targetNamespace="@PROJECT-XSD-URI@"
- elementFormDefault="qualified"
- >
+ elementFormDefault="qualified">
<element name="configuration" type="this:ConfigurationType"/>
<element name="process" type="this:ProcessType"/>
@@ -40,6 +38,17 @@
</simpleContent>
</complexType>
+ <!-- crteria: applies a processing constraint on a product -->
+ <!--
+ <complexType name="CriteriaType">
+ <complexContent>
+ <extension base="anyType">
+ <attribute name="id" type="string" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ -->
+
<complexType name="DirectoryType">
<complexContent>
<extension base="this:ProductType">
@@ -47,26 +56,29 @@
</extension>
</complexContent>
</complexType>
-
+
<complexType name="FileType">
<complexContent>
<extension base="this:ProductType">
+ <!--
<sequence>
- <element ref="CriteriaType" minOccurs="0" maxOccurs="1"/>
+ <element ref="this:CriteriaType" minOccurs="0" maxOccurs="1"/>
</sequence>
+ -->
<attribute name="type" type="string" use="required"/>
</extension>
</complexContent>
</complexType>
-
- <complexType name="CriteriaType">
- <complexContent>
- <extension base="anyType"/>
- </complexContent>
- </complextType>
-
+
+ <simpleType name="PolicyType">
+ <restriction base="string">
+ <enumeration value="optional"/>
+ <enumeration value="conditional"/>
+ </restriction>
+ </simpleType>
+
<!-- process definitions -->
-
+
<complexType name="ProcessType">
<sequence>
<element name="consumes" type="this:ConsumesType" minOccurs="0"
maxOccurs="1"/>
@@ -75,17 +87,17 @@
<attribute name="name" type="string" use="required"/>
<attribute name="class" type="string" use="required"/>
</complexType>
-
+
<complexType name="ConsumesType">
<sequence>
- <element ref="this:product" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="input" type="this:InputType" minOccurs="0"
maxOccurs="unbounded"/>
</sequence>
<attribute name="policy" type="this:PolicyType"/>
</complexType>
<complexType name="ProducesType">
<sequence>
- <element name="output" type="this:OutputType"/>
+ <element name="output" type="this:OutputType" minOccurs="0"
maxOccurs="unbounded"/>
</sequence>
<attribute name="policy" type="this:PolicyType"/>
</complexType>
Added: trunk/main/lang/process/etc/test/sample.xml
===================================================================
--- trunk/main/lang/process/etc/test/sample.xml 2006-04-27 18:05:19 UTC (rev
1415)
+++ trunk/main/lang/process/etc/test/sample.xml 2006-04-28 10:43:02 UTC (rev
1416)
@@ -0,0 +1,113 @@
+<?xml version="1.0"?>
+<configuration xmlns="@PROJECT-XSD-URI@">
+
+ <!-- products -->
+
+ <dir name="src.main" path="${project.src.main.dir}">
+ <description title="Project main source directory.">
+ Project source for primary content to be added to the
+ normalized ${target.build.main.dir} directory.
+ </description>
+ </dir>
+
+ <dir name="etc.main" path="${project.etc.main.dir}">
+ <description title="Project supplimentary main content directory.">
+ Project source for supplimentary content to be added to the
+ normalized ${target.build.main.dir} directory.
+ </description>
+ </dir>
+
+
+ <dir name="target.dir" path="${project.basedir}/target"/>
+ <dir name="target.test.dir" path="${target.dir}/test"/>
+ <dir name="target.reports.dir" path="${target.dir}/reports"/>
+ <dir name="target.reports.test.dir" path="${target.reports.dir}/test"/>
+
+ <dir name="target.build.dir" path="${target.dir}/build"/>
+ <dir name="target.build.main.dir" path="${target.build.dir}/main"/>
+ <dir name="target.build.test.dir" path="${target.build.dir}/test"/>
+
+ <dir name="target.classes.dir" path="${target.dir}/classes"/>
+ <dir name="target.classes.main.dir" path="${target.classes.dir}/main"/>
+ <dir name="target.classes.test.dir" path="${target.classes.dir}/test"/>
+
+ <file name="target.deliverables.jar" type="jar"/>
+ <file name="target.deliverables.part" type="part"/>
+
+ <!-- processes -->
+
+ <process name="prepare-main"
class="net.dpml.tools.process.PrepareMainProcess">
+ <consumes>
+ <input id="etc.main" policy="optional"/>
+ <input id="src.main" policy="optional"/>
+ </consumes>
+ <produces>
+ <output id="target.build.main.dir"/>
+ </produces>
+ </process>
+
+ <process name="prepare-test"
class="net.dpml.tools.process.PrepareTestProcess">
+ <consumes policy="conditional">
+ <input id="etc.test" policy="optional"/>
+ <input id="src.test" policy="optional"/>
+ </consumes>
+ <produces>
+ <output id="target.build.test.dir"/>
+ <output id="target.test.dir"/>
+ </produces>
+ </process>
+
+ <process name="compile-main"
class="net.dpml.tools.process.CompileMainProcess">
+ <consumes>
+ <input id="target.build.main.dir" policy="conditional"/>
+ </consumes>
+ <produces>
+ <output id="target.classes.main.dir"/>
+ </produces>
+ </process>
+
+ <process name="compile-test"
class="net.dpml.tools.process.CompileTestProcess">
+ <consumes>
+ <input id="target.build.test.dir" policy="conditional"/>
+ </consumes>
+ <produces>
+ <output id="target.classes.test.dir"/>
+ </produces>
+ </process>
+
+ <process name="junit" class="net.dpml.tools.process.JunitProcess">
+ <consumes>
+ <input id="target.test.dir" policy="optional"/>
+ <input id="target.classes.test.dir" policy="conditional"/>
+ </consumes>
+ <produces>
+ <output id="target.reports.test.dir"/>
+ </produces>
+ </process>
+
+ <process name="jar" class="net.dpml.tools.process.JarProcess">
+ <consumes>
+ <input id="target.reports.test.dir"/>
+ <input id="target.build.main.dir" policy="conditional"/>
+ </consumes>
+ <produces>
+ <output id="target.deliverables.jar"/>
+ </produces>
+ </process>
+
+ <process name="rmic" class="net.dpml.tools.process.RMICProcess">
+ <consumes>
+ <input id="target.classes.main.dir" policy="conditional"/>
+ </consumes>
+ </process>
+
+ <process name="part" class="net.dpml.tools.process.PartProcess">
+ <consumes>
+ <input id="target.classes.main.dir" policy="optional"/>
+ </consumes>
+ <produces>
+ <output id="target.deliverables.part"/>
+ </produces>
+ </process>
+
+</configuration>
Added:
trunk/main/lang/process/src/test/net/dpml/lang/process/ProcessXsdTestCase.java
===================================================================
---
trunk/main/lang/process/src/test/net/dpml/lang/process/ProcessXsdTestCase.java
2006-04-27 18:05:19 UTC (rev 1415)
+++
trunk/main/lang/process/src/test/net/dpml/lang/process/ProcessXsdTestCase.java
2006-04-28 10:43:02 UTC (rev 1416)
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2005 Stephen J. McConnell
+ *
+ * Licensed 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 net.dpml.lang.process;
+
+import java.io.File;
+import java.net.URI;
+
+import net.dpml.util.DOM3DocumentBuilder;
+
+import junit.framework.TestCase;
+
+/**
+ * The Process XSD class validates the prodicess XSD schema.
+ *
+ * @author <a href="http://www.dpml.net">The Digital Product Meta Library</a>
+ */
+public class ProcessXsdTestCase extends TestCase
+{
+
+ public void setUp() throws Exception
+ {
+ File testdir = new File( System.getProperty( "project.test.dir" ) );
+ File doc = new File( testdir, "sample.xml" );
+ URI uri = doc.toURI();
+
+ File basedir = new File( System.getProperty( "project.basedir" ) );
+ File target = new File( basedir, "target" );
+ File deliverables = new File( target, "deliverables" );
+ File xsds = new File( deliverables, "xsds" );
+ String version = System.getProperty( "project.version" ); // <--
ISSUE
+ File xsd = new File( xsds, "dpml-process-" + version + ".xsd" );
+ System.setProperty( "@PROJECT-XSD-URI@", xsd.toURI().toString() );
+
+ DOM3DocumentBuilder builder = new DOM3DocumentBuilder();
+ builder.parse( uri );
+ }
+
+ public void testProcessXsd() throws Exception
+ {
+
+ }
+}
Modified:
trunk/main/transit/core/src/main/net/dpml/util/DOM3DocumentBuilder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/util/DOM3DocumentBuilder.java
2006-04-27 18:05:19 UTC (rev 1415)
+++ trunk/main/transit/core/src/main/net/dpml/util/DOM3DocumentBuilder.java
2006-04-28 10:43:02 UTC (rev 1416)
@@ -220,6 +220,11 @@
private URI resolveURI( String namespace ) throws URISyntaxException
{
+ String value = System.getProperty( namespace );
+ if( null != value )
+ {
+ return new URI( value );
+ }
if( m_map.containsKey( namespace ) )
{
return (URI) m_map.get( namespace );
- r1416 - in trunk/main: . lang lang/process lang/process/etc lang/process/etc/test lang/process/src lang/process/src/test lang/process/src/test/net lang/process/src/test/net/dpml lang/process/src/test/net/dpml/lang lang/process/src/test/net/dpml/lang/process transit/core/src/main/net/dpml/util, mcconnell at BerliOS, 04/28/2006
Archive powered by MHonArc 2.6.24.