Skip to Content.
Sympa Menu

notify-dpml - r1424 - in trunk/main/lang/process: etc etc/test src/test/net/dpml/lang/process

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1424 - in trunk/main/lang/process: etc etc/test src/test/net/dpml/lang/process
  • Date: Mon, 1 May 2006 20:14:55 +0200

Author: mcconnell
Date: 2006-05-01 20:14:53 +0200 (Mon, 01 May 2006)
New Revision: 1424

Modified:
trunk/main/lang/process/etc/process.xsd
trunk/main/lang/process/etc/test/sample.xml

trunk/main/lang/process/src/test/net/dpml/lang/process/ProcessXsdTestCase.java
Log:
add validator process id sequence to process element model

Modified: trunk/main/lang/process/etc/process.xsd
===================================================================
--- trunk/main/lang/process/etc/process.xsd 2006-05-01 17:25:01 UTC (rev
1423)
+++ trunk/main/lang/process/etc/process.xsd 2006-05-01 18:14:53 UTC (rev
1424)
@@ -68,6 +68,7 @@
<element name="dependencies" type="this:DependenciesType"
minOccurs="0" maxOccurs="1"/>
<element name="consumes" type="this:ConsumesType" minOccurs="0"
maxOccurs="1"/>
<element name="produces" type="this:ProducesType" minOccurs="0"
maxOccurs="1"/>
+ <element name="validators" type="this:ValidatorsType" minOccurs="0"
maxOccurs="1"/>
</sequence>
<attribute name="name" type="string" use="required"/>
<attribute name="class" type="string" use="required"/>
@@ -79,6 +80,12 @@
<element name="include" type="this:DependencyType" minOccurs="0"
maxOccurs="unbounded"/>
</sequence>
</complexType>
+
+ <complexType name="ValidatorsType">
+ <sequence>
+ <element name="include" type="this:DependencyType" minOccurs="0"
maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>

<complexType name="ConsumesType">
<sequence>

Modified: trunk/main/lang/process/etc/test/sample.xml
===================================================================
--- trunk/main/lang/process/etc/test/sample.xml 2006-05-01 17:25:01 UTC (rev
1423)
+++ trunk/main/lang/process/etc/test/sample.xml 2006-05-01 18:14:53 UTC (rev
1424)
@@ -75,7 +75,9 @@

<process name="compile-main"
class="net.dpml.tools.process.CompileMainProcess" implicit="true">
<consumes>
- <input id="target.build.main.dir" policy="conditional"/>
+ <input xsi:type="Selection" id="target.build.main.dir"
policy="conditional">
+ <exclude name="**/*.java,**/package.html"/>
+ </input>
</consumes>
<produces id="target.classes.main.dir"/>
</process>
@@ -88,7 +90,7 @@
<produces id="target.classes.test.dir"/>
</process>

- <process name="prepare-junit"
class="net.dpml.tools.process.PrepareJUnitProcess">
+ <process name="setup-junit"
class="net.dpml.tools.process.PrepareJUnitProcess">
<dependencies>
<include id="prepare-test"/>
</dependencies>
@@ -98,29 +100,28 @@
<produces id="target.test.dir"/>
</process>

- <process name="junit" class="net.dpml.tools.process.JunitProcess">
+ <process name="jar" class="net.dpml.tools.process.JarProcess">
+ <consumes>
+ <input id="target.classes.main.dir" policy="conditional"/>
+ </consumes>
+ <produces id="target.deliverables.jar"/>
+ <validators>
+ <include id="junit"/>
+ </validators>
+ </process>
+
+ <process name="junit" class="net.dpml.tools.process.JavaUnitProcess">
<dependencies>
- <include id="prepare-junit"/>
+ <include id="jar"/>
<include id="compile-test"/>
</dependencies>
<consumes>
<input id="target.test.dir"/>
<input id="target.classes.test.dir" policy="conditional"/>
- <input id="target.classes.main.dir"/>
</consumes>
<produces id="target.reports.test.dir"/>
</process>

- <process name="jar" class="net.dpml.tools.process.JarProcess">
- <dependencies>
- <include id="junit"/>
- </dependencies>
- <consumes>
- <input id="target.build.main.dir" policy="conditional"/>
- </consumes>
- <produces id="target.deliverables.jar"/>
- </process>
-
<process name="rmic" class="net.dpml.tools.process.RMICProcess">
<dependencies>
<include id="compile-main"/>

Modified:
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-05-01 17:25:01 UTC (rev 1423)
+++
trunk/main/lang/process/src/test/net/dpml/lang/process/ProcessXsdTestCase.java
2006-05-01 18:14:53 UTC (rev 1424)
@@ -114,9 +114,6 @@

public void testSampleParse() throws Exception
{
- System.out.println( "products: " + m_products.size() );
- System.out.println( "processes: " + m_processes.size() );
-
String[] keys = (String[]) m_processes.keySet().toArray( new
String[0] );
for( int i=0; i<keys.length; i++ )
{
@@ -207,6 +204,10 @@

private void getImpliedProcesses( List list, Element process ) throws
DecodingException
{
+ if( list.contains( process ) )
+ {
+ return;
+ }
getDepedentProcessors( list, process );
Element[] inputs = getInputElements( process );
for( int i=0; i<inputs.length; i++ )
@@ -220,6 +221,7 @@
{
list.add( process );
}
+ processValidators( list, process );
}

private void getDepedentProcessors( List list, Element process ) throws
DecodingException
@@ -254,6 +256,41 @@
}
}

+ private void processValidators( List list, Element process ) throws
DecodingException
+ {
+ Element validators = ElementHelper.getChild( process, "validators" );
+ if( null == validators )
+ {
+ return;
+ }
+ else
+ {
+ Element[] children = ElementHelper.getChildren( validators );
+ String[] keys = new String[ children.length ];
+ for( int i=0; i<children.length; i++ )
+ {
+ Element child = children[i];
+ String key = ElementHelper.getAttribute( child, "id" );
+ Element proc = (Element) m_processes.get( key );
+ if( null == proc )
+ {
+ final String error =
+ "Processor validation dependency ["
+ + key
+ + "] not recognized.";
+ throw new DecodingException( child, error );
+ }
+ else
+ {
+ if( !list.contains( proc ) )
+ {
+ getImpliedProcesses( list, proc );
+ }
+ }
+ }
+ }
+ }
+
private void getInputProcesses( List list, Element product ) throws
DecodingException
{
if( null == product )
@@ -266,6 +303,7 @@

private void getProducers( List list, String id ) throws
DecodingException
{
+
String[] keys = (String[]) m_processes.keySet().toArray( new
String[0] );
for( int i=0; i<keys.length; i++ )
{
@@ -274,10 +312,13 @@
String productionId = getProcessProductionID( process );
if( id.equals( productionId ) )
{
- getImpliedProcesses( list, process );
if( !list.contains( process ) )
{
- list.add( process );
+ getImpliedProcesses( list, process );
+ if( !list.contains( process ) )
+ {
+ list.add( process );
+ }
}
}
}




  • r1424 - in trunk/main/lang/process: etc etc/test src/test/net/dpml/lang/process, mcconnell at BerliOS, 05/01/2006

Archive powered by MHonArc 2.6.24.

Top of Page