brett 2005/03/21 22:51:59
Modified: maven-plugin/src/main/java/org/apache/maven/plugin
PluginExecutionRequest.java
maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade
MarmaladeMojo.java
maven-script/maven-script-marmalade/src/test/java/org/apache/maven/script/marmalade
MarmaladeMojoTest.java
Log:
remove context from request
Revision Changes Path
1.4 +2 -17
maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/PluginExecutionRequest.java
Index: PluginExecutionRequest.java
===================================================================
RCS file:
/home/cvs/maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/PluginExecutionRequest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PluginExecutionRequest.java 21 Mar 2005 00:07:39 -0000 1.3
+++ PluginExecutionRequest.java 22 Mar 2005 06:51:59 -0000 1.4
@@ -16,24 +16,19 @@
* limitations under the License.
*/
-import java.util.HashMap;
import java.util.Map;
/**
- * @deprecated
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @version $Id$
+ * @deprecated
*/
public class PluginExecutionRequest
{
private Map parameters;
- private Map context;
-
public PluginExecutionRequest( Map parameters )
{
- context = new HashMap();
-
this.parameters = parameters;
}
@@ -51,14 +46,4 @@
{
return parameters.get( key );
}
-
- public void addContextValue( Object key, Object value )
- {
- context.put( key, value );
- }
-
- public Object getContextValue( String key )
- {
- return context.get( key );
- }
}
1.6 +10 -11
maven-components/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/MarmaladeMojo.java
Index: MarmaladeMojo.java
===================================================================
RCS file:
/home/cvs/maven-components/maven-script/maven-script-marmalade/src/main/java/org/apache/maven/script/marmalade/MarmaladeMojo.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- MarmaladeMojo.java 25 Feb 2005 05:09:14 -0000 1.5
+++ MarmaladeMojo.java 22 Mar 2005 06:51:59 -0000 1.6
@@ -25,9 +25,6 @@
import org.codehaus.marmalade.runtime.MarmaladeExecutionContext;
import org.codehaus.marmalade.runtime.MarmaladeExecutionException;
-import java.util.Iterator;
-import java.util.Map;
-
/**
* @author jdcasey
*/
@@ -42,7 +39,8 @@
this.script = script;
}
- public void execute( PluginExecutionRequest request,
PluginExecutionResponse response ) throws Exception
+ public void execute( PluginExecutionRequest request,
PluginExecutionResponse response )
+ throws Exception
{
MarmaladeExecutionContext context = new DefaultContext(
request.getParameters() );
@@ -60,13 +58,14 @@
response.setExecutionFailure( failure );
}
- Map externalizedVars = context.getExternalizedVariables();
- for ( Iterator it = externalizedVars.entrySet().iterator();
it.hasNext(); )
- {
- Map.Entry entry = (Map.Entry) it.next();
-
- request.addContextValue( entry.getKey(), entry.getValue() );
- }
+ // TODO: need to be able to pass back results
+// Map externalizedVars = context.getExternalizedVariables();
+// for ( Iterator it = externalizedVars.entrySet().iterator();
it.hasNext(); )
+// {
+// Map.Entry entry = (Map.Entry) it.next();
+//
+// request.addContextValue( entry.getKey(), entry.getValue() );
+// }
}
}
\ No newline at end of file
1.4 +7 -6
maven-components/maven-script/maven-script-marmalade/src/test/java/org/apache/maven/script/marmalade/MarmaladeMojoTest.java
Index: MarmaladeMojoTest.java
===================================================================
RCS file:
/home/cvs/maven-components/maven-script/maven-script-marmalade/src/test/java/org/apache/maven/script/marmalade/MarmaladeMojoTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MarmaladeMojoTest.java 4 Mar 2005 09:04:21 -0000 1.3
+++ MarmaladeMojoTest.java 22 Mar 2005 06:51:59 -0000 1.4
@@ -16,6 +16,7 @@
* limitations under the License.
*/
+import junit.framework.TestCase;
import org.apache.maven.plugin.PluginExecutionRequest;
import org.apache.maven.plugin.PluginExecutionResponse;
import org.codehaus.marmalade.metamodel.ScriptBuilder;
@@ -27,8 +28,6 @@
import java.io.StringReader;
import java.util.Collections;
-import junit.framework.TestCase;
-
/**
* @author jdcasey
*/
@@ -38,7 +37,8 @@
private static final String TEST_SCRIPT = "<set xmlns=\"marmalade:core\"
var=\"testvar\" value=\"${param}/testval\" extern=\"true\"/>";
- public void testShouldProduceOutputWithRequest_Dot_ToStringInline()
throws Exception
+ public void testShouldProduceOutputWithRequest_Dot_ToStringInline()
+ throws Exception
{
MarmaladeParsingContext parseContext = new DefaultParsingContext();
parseContext.setInput( new StringReader( TEST_SCRIPT ) );
@@ -57,9 +57,10 @@
mojo.execute( request, response );
- Object result = request.getContextValue( "testvar" );
-
- assertEquals( "paramValue/testval", result );
+ // TODO: need to be able to pass back results
+// Object result = request.getContextValue( "testvar" );
+//
+// assertEquals( "paramValue/testval", result );
}
}
\ No newline at end of file