Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2182 - in development/main/magic/core/src/main/net/dpml/magic: model tasks

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2182 - in development/main/magic/core/src/main/net/dpml/magic: model tasks
  • Date: Fri, 01 Apr 2005 00:58:44 -0500

Author: mcconnell AT dpml.net
Date: Fri Apr 1 00:58:41 2005
New Revision: 2182

Modified:
development/main/magic/core/src/main/net/dpml/magic/model/Policy.java

development/main/magic/core/src/main/net/dpml/magic/tasks/JUnitTestTask.java
Log:
Add a string to policy translation operation to the Policy class and update
the JUnit task to have a sensible name for the test dir.

Modified:
development/main/magic/core/src/main/net/dpml/magic/model/Policy.java
==============================================================================
--- development/main/magic/core/src/main/net/dpml/magic/model/Policy.java
(original)
+++ development/main/magic/core/src/main/net/dpml/magic/model/Policy.java
Fri Apr 1 00:58:41 2005
@@ -38,6 +38,33 @@
private final boolean m_test;
private final boolean m_runtime;

+ public static int getPolicy( final String policy )
+ {
+ String p = policy.trim().toLowerCase();
+ if( "runtime".equals( p ) )
+ {
+ return RUNTIME;
+ }
+ else if( "test".equals( p ) )
+ {
+ return TEST;
+ }
+ else if( "build".equals( p ) )
+ {
+ return BUILD;
+ }
+ else if( "any".equals( p ) )
+ {
+ return ANY;
+ }
+ else
+ {
+ final String error =
+ "Policy value [" + policy + "] out of range.";
+ throw new IllegalArgumentException( error );
+ }
+ }
+
public Policy()
{
this( true, true, true );

Modified:
development/main/magic/core/src/main/net/dpml/magic/tasks/JUnitTestTask.java
==============================================================================
---
development/main/magic/core/src/main/net/dpml/magic/tasks/JUnitTestTask.java
(original)
+++
development/main/magic/core/src/main/net/dpml/magic/tasks/JUnitTestTask.java
Fri Apr 1 00:58:41 2005
@@ -65,11 +65,9 @@
public static final String HALT_ON_FAILURE_KEY =
"project.test.halt-on-failure";
public static final boolean HALT_ON_FAILURE_VALUE = true;

-
-
public static final String CACHE_PATH_KEY = "dpml.cache";

- public static final String WORK_DIR_KEY = "project.dir";
+ public static final String WORK_DIR_KEY = "project.dir"; // <--- CHANGE
TO "project.test.dir"

private static final String ERROR_KEY = "project.test.error";
private static final String FAILURE_KEY = "project.test.failure";
@@ -345,6 +343,11 @@
work.setValue( working.toString() );
junit.addConfiguredSysproperty( work );

+ final Environment.Variable testBaseDir = new Environment.Variable();
+ testBaseDir .setKey( "project.test.dir" );
+ testBaseDir .setValue( working.toString() );
+ junit.addConfiguredSysproperty( testBaseDir );
+
final Environment.Variable basedir = new Environment.Variable();
basedir.setKey( "basedir" );
basedir.setValue( project.getBaseDir().toString() );



  • svn commit: r2182 - in development/main/magic/core/src/main/net/dpml/magic: model tasks, mcconnell, 03/31/2005

Archive powered by MHonArc 2.6.24.

Top of Page