Skip to Content.
Sympa Menu

notify-dpml - r1502 - trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks

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: r1502 - trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks
  • Date: Tue, 6 Jun 2006 14:28:30 +0200

Author: mcconnell
Date: 2006-06-06 14:28:29 +0200 (Tue, 06 Jun 2006)
New Revision: 1502

Modified:

trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/JUnitTestTask.java
Log:
Update the JUnit testrunner to include the filename of all declared
deliverables.

Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/JUnitTestTask.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/JUnitTestTask.java
2006-06-06 12:24:59 UTC (rev 1501)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/JUnitTestTask.java
2006-06-06 12:28:29 UTC (rev 1502)
@@ -19,8 +19,12 @@
package net.dpml.tools.tasks;

import java.io.File;
+import java.io.IOException;
import java.util.StringTokenizer;

+import net.dpml.library.Feature;
+import net.dpml.library.Type;
+import net.dpml.library.Resource;
import net.dpml.library.info.Scope;

import net.dpml.tools.Context;
@@ -334,7 +338,31 @@
logging.setKey( "java.util.logging.config.class" );
logging.setValue( "net.dpml.util.ConfigurationHandler" );
junit.addConfiguredSysproperty( logging );
-
+
+ try
+ {
+ Context context = getContext();
+ Resource resource = context.getResource();
+ Type[] types = context.getResource().getTypes();
+ for( int i=0; i<types.length; i++ )
+ {
+ Type type = types[i];
+ String id = type.getID();
+ File file = context.getTargetDeliverable( id );
+ String path = file.getCanonicalPath();
+ final Environment.Variable variable = new
Environment.Variable();
+ variable.setKey( "project.deliverable." + id + ".filename" );
+ variable.setValue( path );
+ junit.addConfiguredSysproperty( variable );
+ }
+ }
+ catch( IOException ioe )
+ {
+ final String error =
+ "Unexpected IO error while building deliverable filename
properties.";
+ throw new BuildException( error, ioe );
+ }
+
junit.setErrorProperty( ERROR_KEY );
junit.setFailureProperty( FAILURE_KEY );
junit.setTaskName( getTaskName() );




  • r1502 - trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks, mcconnell at BerliOS, 06/06/2006

Archive powered by MHonArc 2.6.24.

Top of Page